-
Notifications
You must be signed in to change notification settings - Fork 65
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
nicholaspai
merged 37 commits into
march-25-evm-audit
from
spokepool-periphery-multiple-exchanges
Mar 13, 2025
Merged
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 df04404
rename
nicholaspai 1954009
Update SpokeV3PoolPeriphery.sol
nicholaspai fc1ff8f
Update SpokeV3PoolPeriphery.sol
nicholaspai c1b6d4f
Update SpokeV3PoolPeriphery.sol
nicholaspai 3b3352e
Add unit tests
nicholaspai aca4b06
Add whitelistExchanges only owner method
nicholaspai 7149287
rename
nicholaspai dda8499
Remove onlyOwner
nicholaspai 2da9c63
Remove whitelist of exchanges, add proxy to bypass approval abuse
nicholaspai 90e7cd0
Add some protection to callSpokePoolPeriphery
nicholaspai 9511666
Only call swapAndBridge through proxy
nicholaspai e0bead2
move periphery funcs into proxy
nicholaspai 5494ee5
Update SpokePoolV3Periphery.sol
nicholaspai b6db47b
remove depositERC20
nicholaspai 66df238
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai d0a9d0f
Update SpokePoolV3Periphery.sol
nicholaspai 6635803
Add back safeTransferFron's to permit funcs
nicholaspai 6b995e5
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai 0de384e
Add unit tests that check if calling deposit and swapAndBridge with n…
nicholaspai 100e707
Add interfaces to make sure we don't add new functions as easily
nicholaspai 6db7d87
Add Create2Factory
nicholaspai 3a16809
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai 022a8ec
feat: add permit2 entrypoints to the periphery (#782)
bmzig 372d9cb
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai c9017ff
feat: sponsored swap and deposits (#790)
bmzig 9bc7d91
feat: Delete SwapAndBridge and add submission fees to gasless flow (#…
nicholaspai f4250d0
Update SpokePoolV3Periphery.sol
nicholaspai 9a4ef73
Update SpokePoolPeriphery.t.sol
nicholaspai f319487
Move all comments to interface and use inherit doc
nicholaspai 26110a9
fix: eip712 types and hashes (#821)
dohaki c1f6181
refactor comments
bmzig 87fa646
Merge branch 'spokepool-periphery-multiple-exchanges' of https://gith…
nicholaspai 64bdab7
Merge branch 'master' into spokepool-periphery-multiple-exchanges
nicholaspai abaeb01
Create IERC20Auth.sol
nicholaspai fc9a03c
fix tests
nicholaspai 214cb5f
Comments
nicholaspai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.