Skip to content

feat(SpokePoolPeriphery): Support multiple exchanges #777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
db4bf7b
feat(SpokePoolPeriphery): Support multiple exchanges
nicholaspai Nov 27, 2024
df04404
rename
nicholaspai Nov 27, 2024
1954009
Update SpokeV3PoolPeriphery.sol
nicholaspai Nov 27, 2024
fc1ff8f
Update SpokeV3PoolPeriphery.sol
nicholaspai Nov 27, 2024
c1b6d4f
Update SpokeV3PoolPeriphery.sol
nicholaspai Nov 27, 2024
3b3352e
Add unit tests
nicholaspai Nov 27, 2024
aca4b06
Add whitelistExchanges only owner method
nicholaspai Nov 27, 2024
7149287
rename
nicholaspai Nov 27, 2024
dda8499
Remove onlyOwner
nicholaspai Nov 27, 2024
2da9c63
Remove whitelist of exchanges, add proxy to bypass approval abuse
nicholaspai Nov 28, 2024
90e7cd0
Add some protection to callSpokePoolPeriphery
nicholaspai Nov 28, 2024
9511666
Only call swapAndBridge through proxy
nicholaspai Dec 1, 2024
e0bead2
move periphery funcs into proxy
nicholaspai Dec 2, 2024
5494ee5
Update SpokePoolV3Periphery.sol
nicholaspai Dec 3, 2024
b6db47b
remove depositERC20
nicholaspai Dec 3, 2024
66df238
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai Dec 4, 2024
d0a9d0f
Update SpokePoolV3Periphery.sol
nicholaspai Dec 4, 2024
6635803
Add back safeTransferFron's to permit funcs
nicholaspai Dec 4, 2024
6b995e5
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai Dec 4, 2024
0de384e
Add unit tests that check if calling deposit and swapAndBridge with n…
nicholaspai Dec 5, 2024
100e707
Add interfaces to make sure we don't add new functions as easily
nicholaspai Dec 5, 2024
6db7d87
Add Create2Factory
nicholaspai Dec 6, 2024
3a16809
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai Dec 6, 2024
022a8ec
feat: add permit2 entrypoints to the periphery (#782)
bmzig Dec 6, 2024
372d9cb
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai Dec 9, 2024
c9017ff
feat: sponsored swap and deposits (#790)
bmzig Dec 18, 2024
9bc7d91
feat: Delete SwapAndBridge and add submission fees to gasless flow (#…
nicholaspai Dec 19, 2024
f4250d0
Update SpokePoolV3Periphery.sol
nicholaspai Dec 19, 2024
9a4ef73
Update SpokePoolPeriphery.t.sol
nicholaspai Dec 19, 2024
f319487
Move all comments to interface and use inherit doc
nicholaspai Dec 19, 2024
26110a9
fix: eip712 types and hashes (#821)
dohaki Dec 24, 2024
c1f6181
refactor comments
bmzig Dec 25, 2024
87fa646
Merge branch 'spokepool-periphery-multiple-exchanges' of https://gith…
nicholaspai Mar 3, 2025
64bdab7
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai Mar 3, 2025
abaeb01
Create IERC20Auth.sol
nicholaspai Mar 3, 2025
fc9a03c
fix tests
nicholaspai Mar 3, 2025
214cb5f
Comments
nicholaspai Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions contracts/Create2Factory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { Create2 } from "@openzeppelin/contracts/utils/Create2.sol";
import { Lockable } from "./Lockable.sol";

/**
* @title Create2Factory
* @notice Deploys a new contract via create2 at a deterministic address and then atomically initializes the contract
* @dev Contracts designed to be deployed at deterministic addresses should initialize via a non-constructor
* initializer to maintain bytecode across different chains.
* @custom:security-contact bugs@across.to
*/
contract Create2Factory is Lockable {
/// @notice Emitted when the initialization to a newly deployed contract fails
error InitializationFailed();

/**
* @notice Deploys a new contract via create2 at a deterministic address and then atomically initializes the contract
* @param amount The amount of ETH to send with the deployment. If this is not zero then the contract must have a payable constructor
* @param salt The salt to use for the create2 deployment. Must not have been used before for the bytecode
* @param bytecode The bytecode of the contract to deploy
* @param initializationCode The initialization code to call on the deployed contract
*/
function deploy(
uint256 amount,
bytes32 salt,
bytes calldata bytecode,
bytes calldata initializationCode
) external nonReentrant returns (address) {
address deployedAddress = Create2.deploy(amount, salt, bytecode);
(bool success, ) = deployedAddress.call(initializationCode);
if (!success) revert InitializationFailed();
return deployedAddress;
}
}
683 changes: 683 additions & 0 deletions contracts/SpokePoolV3Periphery.sol

Large diffs are not rendered by default.

310 changes: 0 additions & 310 deletions contracts/SwapAndBridge.sol

This file was deleted.

35 changes: 35 additions & 0 deletions contracts/external/interfaces/IERC20Auth.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

/*
* @notice Minimal interface for an EIP-3009 compliant token.
* https://eips.ethereum.org/EIPS/eip-3009
*/
interface IERC20Auth {
/**
* @notice Receive a transfer with a signed authorization from the payer
* @dev This has an additional check to ensure that the payee's address matches
* the caller of this function to prevent front-running attacks. (See security
* considerations)
* @param from Payer's address (Authorizer)
* @param to Payee's address
* @param value Amount to be transferred
* @param validAfter The time after which this is valid (unix time)
* @param validBefore The time before which this is valid (unix time)
* @param nonce Unique nonce
* @param v v of the signature
* @param r r of the signature
* @param s s of the signature
*/
function receiveWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
Loading
Loading