-
Notifications
You must be signed in to change notification settings - Fork 14
Etherfi Withdrawal Request Gate #320
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
5 commits
Select commit
Hold shift + click to select a range
2a45a00
prevent non Adapter from claiming the Etherfi Withdrawal Requests
sparrowDom f188472
add test
sparrowDom 7b6b0bd
fix the weETH adapter as well
sparrowDom 4a70abd
prevent any type of ETH donation
sparrowDom 1f048a8
deploy updated EtherFi adapters
clement-ux 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 |
|---|---|---|
|
|
@@ -44,3 +44,6 @@ build/deployments-fork*.json | |
|
|
||
| # Other | ||
| .DS_Store | ||
|
|
||
| # Cursor solidity plugin | ||
| remappings.txt | ||
49 changes: 49 additions & 0 deletions
49
script/deploy/mainnet/041_RedeployEtherFiAdaptersScript.s.sol
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,49 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.23; | ||
|
|
||
| // Contracts | ||
| import {Proxy} from "contracts/Proxy.sol"; | ||
| import {Mainnet} from "contracts/utils/Addresses.sol"; | ||
| import {EtherFiAssetAdapter} from "contracts/adapters/EtherFiAssetAdapter.sol"; | ||
| import {WeETHAssetAdapter} from "contracts/adapters/WeETHAssetAdapter.sol"; | ||
|
|
||
| // Deployment | ||
| import {AbstractDeployScript} from "script/deploy/helpers/AbstractDeployScript.s.sol"; | ||
|
|
||
| /// @title Redeploy the WETH ARM Ether.fi adapters | ||
| /// @notice Deploys new implementations for the eETH and weETH adapters, then upgrades their existing | ||
| /// proxies. The proxies are owned directly by the mainnet 2/8 multisig, so the upgrades do not | ||
| /// require a governance proposal. | ||
| /// @dev Reusing the existing proxies preserves their addresses and withdrawal-request storage. | ||
| contract $041_RedeployEtherFiAdaptersScript is AbstractDeployScript("041_RedeployEtherFiAdaptersScript") { | ||
| function _execute() internal override { | ||
| address arm = resolver.resolve("WETH_ARM"); | ||
|
|
||
| EtherFiAssetAdapter eethAdapterImpl = new EtherFiAssetAdapter( | ||
| arm, Mainnet.EETH, Mainnet.WETH, Mainnet.ETHERFI_WITHDRAWAL, Mainnet.ETHERFI_WITHDRAWAL_NFT | ||
| ); | ||
| _recordDeployment("WETH_ARM_EETH_ADAPTER_IMPL", address(eethAdapterImpl)); | ||
|
|
||
| WeETHAssetAdapter weethAdapterImpl = new WeETHAssetAdapter( | ||
| arm, Mainnet.WEETH, Mainnet.EETH, Mainnet.WETH, Mainnet.ETHERFI_WITHDRAWAL, Mainnet.ETHERFI_WITHDRAWAL_NFT | ||
| ); | ||
| _recordDeployment("WETH_ARM_WEETH_ADAPTER_IMPL", address(weethAdapterImpl)); | ||
| } | ||
|
|
||
| function _fork() internal override { | ||
| _upgradeAdapter("WETH_ARM_EETH_ADAPTER", "WETH_ARM_EETH_ADAPTER_IMPL"); | ||
| _upgradeAdapter("WETH_ARM_WEETH_ADAPTER", "WETH_ARM_WEETH_ADAPTER_IMPL"); | ||
| } | ||
|
|
||
| function _upgradeAdapter(string memory proxyName, string memory implementationName) internal { | ||
| Proxy adapterProxy = Proxy(payable(resolver.resolve(proxyName))); | ||
| address adapterImpl = resolver.resolve(implementationName); | ||
|
|
||
| // Idempotent: the deployment runner can replay pending multisig actions on forks. | ||
| if (adapterProxy.implementation() == adapterImpl) return; | ||
|
|
||
| require(adapterProxy.owner() == Mainnet.MULTISIG_2_OF_8, "Unexpected adapter owner"); | ||
| vm.prank(Mainnet.MULTISIG_2_OF_8); | ||
| adapterProxy.upgradeTo(adapterImpl); | ||
| } | ||
| } |
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
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
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
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
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
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
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.
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.
@clement-ux is making a point that this check could be:
There are pros/cons to it:
🟢 code change would allow sending ETH to adapter in case there was a shortfall
🔴 code change would allow a donation attack
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.
I lean towards not allowing for a donation attack and accounting for everything. In case we ever need to infuse the adapter/ARM with funds I would rather we make a deliberate function for it
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.
You can always send weth
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.
After some thought, I agree that we should keep the first implementation
(msg.sender == address(etherfiWithdrawalNFT) && !claimingEtherFi).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.
nit: you probably ment this by the first implementation: