-
Notifications
You must be signed in to change notification settings - Fork 75
Ethereum Spoke Pool #36
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
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7240628
Update hub for protocol fees
chrismaree c3f90c3
nit
chrismaree 8a9e37a
Update test/chain-adapters/Arbitrum_Adapter.ts
chrismaree e2874df
Update test/chain-adapters/Arbitrum_Adapter.ts
chrismaree 9d4e545
nit
chrismaree cb280b3
nit
chrismaree 1e6a3c5
WIP
chrismaree ac12a87
Merge branch 'master' into chrismaree/todo
chrismaree 79e3769
WIP
chrismaree 929057d
nit
chrismaree 699bdcf
WIP
chrismaree f6654bf
nit
chrismaree 50b8ec3
nit
chrismaree 5460f3e
nit
chrismaree c538776
feat: add L1 SpokePool
chrismaree 77b4315
nit
chrismaree b98e2cd
nit
chrismaree 3c043f5
nit
chrismaree 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,63 @@ | ||
| //SPDX-License-Identifier: Unlicense | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import "./interfaces/WETH9.sol"; | ||
|
|
||
| import "@openzeppelin/contracts/access/Ownable.sol"; | ||
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
|
||
| import "./SpokePool.sol"; | ||
| import "./SpokePoolInterface.sol"; | ||
|
|
||
| /** | ||
| * @notice Ethereum L1 specific SpokePool. | ||
| * @dev Used on Ethereum L1 to facilitate L2->L1 transfers. | ||
| */ | ||
|
|
||
| contract Ethereum_SpokePool is SpokePoolInterface, SpokePool, Ownable { | ||
| constructor( | ||
| address _l1EthWrapper, | ||
| address _l2Eth, | ||
| address _crossDomainAdmin, | ||
| address _hubPool, | ||
| address _wethAddress, | ||
| address timerAddress | ||
| ) SpokePool(_crossDomainAdmin, _hubPool, _wethAddress, timerAddress) {} | ||
|
|
||
| /************************************** | ||
| * ADMIN FUNCTIONS * | ||
| **************************************/ | ||
|
|
||
| function setCrossDomainAdmin(address newCrossDomainAdmin) public override onlyOwner nonReentrant { | ||
| _setCrossDomainAdmin(newCrossDomainAdmin); | ||
| } | ||
|
|
||
| function setHubPool(address newHubPool) public override onlyOwner nonReentrant { | ||
| _setHubPool(newHubPool); | ||
| } | ||
|
|
||
| function setEnableRoute( | ||
| address originToken, | ||
| uint32 destinationChainId, | ||
| bool enable | ||
| ) public override onlyOwner nonReentrant { | ||
| _setEnableRoute(originToken, destinationChainId, enable); | ||
| } | ||
|
|
||
| function setDepositQuoteTimeBuffer(uint32 buffer) public override onlyOwner nonReentrant { | ||
| _setDepositQuoteTimeBuffer(buffer); | ||
| } | ||
|
|
||
| function initializeRelayerRefund(bytes32 relayerRepaymentDistributionRoot, bytes32 slowRelayRoot) | ||
| public | ||
| override | ||
| onlyOwner | ||
| nonReentrant | ||
| { | ||
| _initializeRelayerRefund(relayerRepaymentDistributionRoot, slowRelayRoot); | ||
| } | ||
|
|
||
| function _bridgeTokensToHubPool(DestinationDistributionLeaf memory distributionLeaf) internal override { | ||
| IERC20(distributionLeaf.l2TokenAddress).transfer(hubPool, distributionLeaf.amountToReturn); | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed IRL, we might want to add a TODO to refactor the SpokePool inheritance setup s.t. we can have most of these methods implemented in the base contract and just have an
_calledByAdmin()function that's implemented in each derived class, and have the base class callrequire(_calledByAdmin(), "not authorized");