-
Notifications
You must be signed in to change notification settings - Fork 51
Priority withdrawal queue #356
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 46 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
3ac8cdd
init
pankajjagtapp 7811d33
refactor: Update PriorityWithdrawalQueue contract to improve withdraw…
pankajjagtapp 73b0ed4
refactor: Update LiquidityPool contract to use immutable priorityWith…
pankajjagtapp fe06cb4
refactor: Update LiquidityPool and PriorityWithdrawalQueue tests for …
pankajjagtapp 59c6819
refactor: Optimize
pankajjagtapp 27daab0
refactor: Enhance LiquidityPool and PriorityWithdrawalQueue for impro…
pankajjagtapp f199f40
refactor: Simplify PriorityWithdrawalQueue contract
pankajjagtapp 3a27a08
refactor: Update PriorityWithdrawalQueue to use immutable MIN_DELAY
pankajjagtapp d31e074
refactor: Clean up PriorityWithdrawalQueue contract by removing redun…
pankajjagtapp 1152b54
refactor: Updated claimWithdraw and batchClaimWithdraw functions to …
pankajjagtapp 365b62e
refactor: Improve cancellation logic in PriorityWithdrawalQueue contract
pankajjagtapp 1c07a43
feat: Add minAmountOut parameter for withdrawal requests
pankajjagtapp 89c23e7
refactor: Eliminated ethAmountLockedForPriorityWithdrawal and related…
pankajjagtapp 30d87da
revert: liquidityPool updated checks
pankajjagtapp 307698f
feat: Integrate PriorityWithdrawalQueue into EtherFiRedemptionManager
pankajjagtapp 80b99a3
feat: Updated the permit handling logic to revert with a specific err…
pankajjagtapp 7385ac9
feat: Add deployment and transaction scripts for PriorityWithdrawalQueue
pankajjagtapp 61b4d23
Merge remote-tracking branch 'origin/master' into pankaj/feat/priorit…
pankajjagtapp ac99058
refactor: Update test setups and scripts to fix broken tests
pankajjagtapp 79386cd
feat: Integrate EtherFiRedemptionManager into deployment and transact…
pankajjagtapp 288d12b
audit fix -> H-01, H-02, M-02
pankajjagtapp c5cc902
audit fix: L-01 Incorrect Event Argument in RemainderHandled
pankajjagtapp 3e61412
audit fix: L-02 => Non-Idempotent CREATE2 Deploy Can DoS Deployment S…
pankajjagtapp 8d299e1
audit fix: I-01 => Rounding Loss in Treasury Split Calculation
pankajjagtapp c44e471
audit fix: I-03 =>Unused OwnableUpgradeable Inheritance
pankajjagtapp 8d2111e
audit fix: I-04 => Inaccurate NatSpec in invalidateRequests
pankajjagtapp f11cdd6
audit fix: I-05. Batch Claim Bypasses User Balance Check
pankajjagtapp 4afb260
audit fix: I-06. Potential Gas Griefing in claimWithdraw
pankajjagtapp cebb37a
audit fix: I-08. Deployment/Upgrade Scripts Print Inaccurate Logs
pankajjagtapp 84ce16f
fix tests as per the new changes
pankajjagtapp bfb5dbd
audit fix: L-03. requestWithdrawWithPermit Can Be Griefed via Permit …
pankajjagtapp 4e35487
audit fix: M-01. PriorityWithdrawalQueue Ignores Liquidity Pool Withd…
pankajjagtapp 6a3448e
refactor: update error handling and minAmountOut logic in PriorityWit…
pankajjagtapp 040eb3c
refactor: rename minAmountOut to amountWithFee in PriorityWithdrawalQ…
pankajjagtapp 17a5375
fix: return 0 for claimable amount if request is not finalized or not…
pankajjagtapp 3b6b81b
feat: enhance liquidity withdrawal logic to account for priority queu…
pankajjagtapp 40d643e
Merge pull request #362 from etherfi-protocol/pankaj/priority-queue-f…
pankajjagtapp 3c53b44
Merge branch 'master' into pankaj/feat/priority-withdrawal-queue
pankajjagtapp 80d78f2
feat: add deployment scripts and verification functions
pankajjagtapp 3f39933
fix: minor bug fixes
pankajjagtapp d21731b
feat: add new audit report for Certora on Priority Queue
pankajjagtapp 0ba348c
feat: add UUPSProxy integration for priority withdrawal queue verific…
pankajjagtapp 34c219a
feat: add weETH withdrawal functionality to PriorityWithdrawalQueue
pankajjagtapp d381b7a
feat: implement weETH withdrawal request handling and permit function…
pankajjagtapp 7fc5100
feat: update deployment and transaction scripts to include weETH and …
pankajjagtapp ec1482b
Merge pull request #374 from etherfi-protocol/pankaj/feat/weETH-suppo…
pankajjagtapp 30dfc30
feat: add priority withdrawal queue address and update treasury refer…
pankajjagtapp 2ab0f0b
feat: add new deployment files for EtherFiRedemptionManager, Liquidit…
pankajjagtapp 7d4c977
chore: remove outdated Certora audit report and add new report for Pr…
pankajjagtapp 3c5d76b
feat: add new script and JSON configuration for setting priority queu…
pankajjagtapp a169db3
refactor: update pubkey and legacy ID in EL-withdrawals test, comment…
pankajjagtapp 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
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
deployment/EtherFiRedemptionManager/2026-02-27-17-16-11.json
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,17 @@ | ||
| { | ||
| "contractName": "EtherFiRedemptionManager", | ||
| "deploymentParameters": { | ||
| "factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99", | ||
| "salt": "0x3b6b81bae101b8bfe24eca53b038a986f5959e74000000000000000000000000", | ||
| "constructorArgs": { | ||
| "_liquidityPool": "0x308861A430be4cce5502d0A12724771Fc6DaF216", | ||
| "_eEth": "0x35fA164735182de50811E8e2E824cFb9B6118ac2", | ||
| "_weEth": "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee", | ||
| "_treasury": "0x0c83EAe1FE72c390A02E426572854931EefF93BA", | ||
| "_roleRegistry": "0x62247D29B4B9BECf4BB73E0c722cf6445cfC7cE9", | ||
| "_etherFiRestaker": "0x1B7a4C3797236A1C37f8741c0Be35c2c72736fFf", | ||
| "_priorityWithdrawalQueue": "0x06fce94d05CC4bC7ff75A210CC3d7FC254362FeE" | ||
| } | ||
| }, | ||
| "deployedAddress": "0x61a4df8965926Bd4b2Ddb2c6f67c7B05D5ED2018" | ||
| } |
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,11 @@ | ||
| { | ||
| "contractName": "LiquidityPool", | ||
| "deploymentParameters": { | ||
| "factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99", | ||
| "salt": "0x3b6b81bae101b8bfe24eca53b038a986f5959e74000000000000000000000000", | ||
| "constructorArgs": { | ||
| "_priorityWithdrawalQueue": "0x06fce94d05CC4bC7ff75A210CC3d7FC254362FeE" | ||
| } | ||
| }, | ||
| "deployedAddress": "0xD97b8a3A1119a2C30ADaf9605da0b552F359adfe" | ||
| } |
15 changes: 15 additions & 0 deletions
15
deployment/PriorityWithdrawalQueue/2026-02-27-17-16-11.json
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,15 @@ | ||
| { | ||
| "contractName": "PriorityWithdrawalQueue", | ||
| "deploymentParameters": { | ||
| "factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99", | ||
| "salt": "0x3b6b81bae101b8bfe24eca53b038a986f5959e74000000000000000000000000", | ||
| "constructorArgs": { | ||
| "_liquidityPool": "0x308861A430be4cce5502d0A12724771Fc6DaF216", | ||
| "_eETH": "0x35fA164735182de50811E8e2E824cFb9B6118ac2", | ||
| "_roleRegistry": "0x62247D29B4B9BECf4BB73E0c722cf6445cfC7cE9", | ||
| "_treasury": "0x0c83EAe1FE72c390A02E426572854931EefF93BA", | ||
| "_minDelay": "3600" | ||
| } | ||
| }, | ||
| "deployedAddress": "0x94190737Ff3540a8990864F41c149159224878A0" | ||
| } |
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,12 @@ | ||
| { | ||
| "contractName": "UUPSProxy", | ||
| "deploymentParameters": { | ||
| "factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99", | ||
| "salt": "0x3b6b81bae101b8bfe24eca53b038a986f5959e74000000000000000000000000", | ||
| "constructorArgs": { | ||
| "_implementation": "0x94190737Ff3540a8990864F41c149159224878A0", | ||
| "_data": "0x8129fc1c" | ||
| } | ||
| }, | ||
| "deployedAddress": "0x06fce94d05CC4bC7ff75A210CC3d7FC254362FeE" | ||
| } |
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
133 changes: 133 additions & 0 deletions
133
script/upgrades/priority-queue/deployPriorityQueue.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,133 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.27; | ||
|
|
||
| import "forge-std/Script.sol"; | ||
| import {LiquidityPool} from "../../../src/LiquidityPool.sol"; | ||
| import {PriorityWithdrawalQueue} from "../../../src/PriorityWithdrawalQueue.sol"; | ||
| import {UUPSProxy} from "../../../src/UUPSProxy.sol"; | ||
| import {Utils, ICreate2Factory} from "../../utils/utils.sol"; | ||
| import {EtherFiRedemptionManager} from "../../../src/EtherFiRedemptionManager.sol"; | ||
|
|
||
| contract DeployPriorityQueue is Script, Utils { | ||
| ICreate2Factory constant factory = ICreate2Factory(0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99); | ||
|
|
||
| address priorityWithdrawalQueueImpl; | ||
| address priorityWithdrawalQueueProxy; | ||
| address liquidityPoolImpl; | ||
| address etherFiRedemptionManagerImpl; | ||
| bytes32 commitHashSalt = hex"3b6b81bae101b8bfe24eca53b038a986f5959e74"; | ||
|
|
||
| uint32 constant MIN_DELAY = 1 hours; // TODO: Set appropriate min delay (e.g., 1 hours = 3600) | ||
|
|
||
| function dryRun() public view { | ||
| console2.log("================================================"); | ||
| console2.log("============= DRY RUN - CONFIG ============"); | ||
| console2.log("================================================"); | ||
| console2.log(""); | ||
|
|
||
| console2.log("Constructor Args for PriorityWithdrawalQueue:"); | ||
| console2.log(" _liquidityPool:", LIQUIDITY_POOL); | ||
| console2.log(" _eETH:", EETH); | ||
| console2.log(" _roleRegistry:", ROLE_REGISTRY); | ||
| console2.log(" _treasury:", TREASURY); | ||
| console2.log(" _minDelay:", MIN_DELAY); | ||
| console2.log(""); | ||
|
|
||
| console2.log("Constructor Args for LiquidityPool:"); | ||
| console2.log(" _priorityWithdrawalQueue: <computed from Create2>"); | ||
| console2.log(""); | ||
|
|
||
| console2.log("Salt:", vm.toString(commitHashSalt)); | ||
| console2.log(""); | ||
|
|
||
| console2.log("To compute exact addresses, run with mainnet fork:"); | ||
| console2.log(" forge script script/upgrades/priority-queue/deployPriorityQueue.s.sol:DeployPriorityQueue --sig 'dryRun()' --fork-url <RPC_URL>"); | ||
| } | ||
|
|
||
| function run() public { | ||
| console2.log("================================================"); | ||
| console2.log("======== Deploying Priority Queue & LP ========="); | ||
| console2.log("================================================"); | ||
| console2.log(""); | ||
|
|
||
| vm.startBroadcast(); | ||
|
|
||
| // Step 1: Deploy PriorityWithdrawalQueue implementation | ||
| { | ||
| string memory contractName = "PriorityWithdrawalQueue"; | ||
| bytes memory constructorArgs = abi.encode( | ||
| LIQUIDITY_POOL, | ||
| EETH, | ||
| WEETH, | ||
| ROLE_REGISTRY, | ||
| WITHDRAW_REQUEST_NFT_BUYBACK_SAFE, | ||
| MIN_DELAY | ||
| ); | ||
| bytes memory bytecode = abi.encodePacked( | ||
| type(PriorityWithdrawalQueue).creationCode, | ||
| constructorArgs | ||
| ); | ||
| priorityWithdrawalQueueImpl = deploy(contractName, constructorArgs, bytecode, commitHashSalt, true, factory); | ||
| } | ||
|
|
||
| // Step 2: Deploy PriorityWithdrawalQueue proxy with initialization | ||
| { | ||
| string memory contractName = "UUPSProxy"; // Use actual contract name for artifact lookup | ||
| // Encode initialize() call for proxy deployment | ||
| bytes memory initData = abi.encodeWithSelector(PriorityWithdrawalQueue.initialize.selector); | ||
| bytes memory constructorArgs = abi.encode(priorityWithdrawalQueueImpl, initData); | ||
| bytes memory bytecode = abi.encodePacked( | ||
| type(UUPSProxy).creationCode, | ||
| constructorArgs | ||
| ); | ||
| priorityWithdrawalQueueProxy = deploy(contractName, constructorArgs, bytecode, commitHashSalt, true, factory); | ||
| } | ||
|
|
||
| // Step 3: Deploy EtherFiRedemptionManager implementation | ||
| { | ||
| string memory contractName = "EtherFiRedemptionManager"; | ||
| bytes memory constructorArgs = abi.encode( | ||
| LIQUIDITY_POOL, | ||
| EETH, | ||
| WEETH, | ||
| TREASURY, | ||
| ROLE_REGISTRY, | ||
| ETHERFI_RESTAKER, | ||
| priorityWithdrawalQueueProxy | ||
| ); | ||
| bytes memory bytecode = abi.encodePacked( | ||
| type(EtherFiRedemptionManager).creationCode, | ||
| constructorArgs | ||
| ); | ||
| etherFiRedemptionManagerImpl = deploy(contractName, constructorArgs, bytecode, commitHashSalt, true, factory); | ||
| } | ||
|
|
||
| // Step 4: Deploy LiquidityPool implementation with predicted proxy address | ||
| { | ||
| string memory contractName = "LiquidityPool"; | ||
| bytes memory constructorArgs = abi.encode(priorityWithdrawalQueueProxy); | ||
| bytes memory bytecode = abi.encodePacked( | ||
| type(LiquidityPool).creationCode, | ||
| constructorArgs | ||
| ); | ||
| liquidityPoolImpl = deploy(contractName, constructorArgs, bytecode, commitHashSalt, true, factory); | ||
| } | ||
|
|
||
| vm.stopBroadcast(); | ||
|
|
||
| // Summary | ||
| console2.log(""); | ||
| console2.log("================================================"); | ||
| console2.log("============== DEPLOYMENT SUMMARY =============="); | ||
| console2.log("================================================"); | ||
| console2.log("LiquidityPool Implementation:", liquidityPoolImpl); | ||
| console2.log("PriorityWithdrawalQueue Implementation:", priorityWithdrawalQueueImpl); | ||
| console2.log("PriorityWithdrawalQueue Proxy:", priorityWithdrawalQueueProxy); | ||
| console2.log("EtherFiRedemptionManager Implementation:", etherFiRedemptionManagerImpl); | ||
| console2.log(""); | ||
| console2.log("NEXT STEPS:"); | ||
| console2.log("1. Upgrade LiquidityPool proxy to new implementation"); | ||
| console2.log("2. Upgrade EtherFiRedemptionManager proxy to new implementation"); | ||
| console2.log("3. Grant necessary roles in RoleRegistry"); | ||
| } | ||
| } | ||
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.