Skip to content

Commit 36e674c

Browse files
authored
Merge pull request #356 from etherfi-protocol/pankaj/feat/priority-withdrawal-queue
Priority withdrawal queue
2 parents 9ff8d08 + a169db3 commit 36e674c

25 files changed

Lines changed: 3478 additions & 100 deletions
467 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"contractName": "EtherFiRedemptionManager",
3+
"deploymentParameters": {
4+
"factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99",
5+
"salt": "0x7fc5100aa09ac0c9236907fe0330a15cb0fda6f8000000000000000000000000",
6+
"constructorArgs": {
7+
"_liquidityPool": "0x308861A430be4cce5502d0A12724771Fc6DaF216",
8+
"_eEth": "0x35fA164735182de50811E8e2E824cFb9B6118ac2",
9+
"_weEth": "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee",
10+
"_treasury": "0x2f5301a3D59388c509C65f8698f521377D41Fd0F",
11+
"_roleRegistry": "0x62247D29B4B9BECf4BB73E0c722cf6445cfC7cE9",
12+
"_etherFiRestaker": "0x1B7a4C3797236A1C37f8741c0Be35c2c72736fFf",
13+
"_priorityWithdrawalQueue": "0x35e7D6feF6f72aDd3c3e39dEc6d9CCc29e3345FA"
14+
}
15+
},
16+
"deployedAddress": "0x6BD191582F40012b2f2cdf66bD3D32bDe41191F7"
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"contractName": "LiquidityPool",
3+
"deploymentParameters": {
4+
"factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99",
5+
"salt": "0x7fc5100aa09ac0c9236907fe0330a15cb0fda6f8000000000000000000000000",
6+
"constructorArgs": {
7+
"_priorityWithdrawalQueue": "0x35e7D6feF6f72aDd3c3e39dEc6d9CCc29e3345FA"
8+
}
9+
},
10+
"deployedAddress": "0x83bc649fCdb2c8DA146b2154a559ddEDf937eF12"
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"contractName": "PriorityWithdrawalQueue",
3+
"deploymentParameters": {
4+
"factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99",
5+
"salt": "0x7fc5100aa09ac0c9236907fe0330a15cb0fda6f8000000000000000000000000",
6+
"constructorArgs": {
7+
"_liquidityPool": "0x308861A430be4cce5502d0A12724771Fc6DaF216",
8+
"_eETH": "0x35fA164735182de50811E8e2E824cFb9B6118ac2",
9+
"_weETH": "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee",
10+
"_roleRegistry": "0x62247D29B4B9BECf4BB73E0c722cf6445cfC7cE9",
11+
"_treasury": "0x2f5301a3D59388c509C65f8698f521377D41Fd0F",
12+
"_minDelay": "3600"
13+
}
14+
},
15+
"deployedAddress": "0x554B2a0c78840bBD4fDB24e198cdD93f99E29456"
16+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"contractName": "UUPSProxy",
3+
"deploymentParameters": {
4+
"factory": "0x356d1B83970CeF2018F2c9337cDdb67dff5AEF99",
5+
"salt": "0x7fc5100aa09ac0c9236907fe0330a15cb0fda6f8000000000000000000000000",
6+
"constructorArgs": {
7+
"_implementation": "0x554B2a0c78840bBD4fDB24e198cdD93f99E29456",
8+
"_data": "0x8129fc1c"
9+
}
10+
},
11+
"deployedAddress": "0x35e7D6feF6f72aDd3c3e39dEc6d9CCc29e3345FA"
12+
}

script/deploys/Deployed.s.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ contract Deployed {
2828
address public constant ETHERFI_NODES_MANAGER = 0x8B71140AD2e5d1E7018d2a7f8a288BD3CD38916F;
2929
address public constant ETHERFI_REDEMPTION_MANAGER = 0xDadEf1fFBFeaAB4f68A9fD181395F68b4e4E7Ae0;
3030
address public constant WEETH_WITHDRAW_ADAPTER = 0xFbfe6b9cEe0E555Bad7e2E7309EFFC75200cBE38;
31+
address public constant PRIORITY_WITHDRAWAL_QUEUE = 0x35e7D6feF6f72aDd3c3e39dEc6d9CCc29e3345FA;
3132

3233
// Oracle
3334
address public constant ETHERFI_ORACLE = 0x57AaF0004C716388B21795431CD7D5f9D3Bb6a41;

script/upgrades/CrossPodApproval/transactions.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,13 @@ contract CrossPodApprovalScript is Script, Deployed, Utils {
256256
}
257257

258258
function verifyBytecode() internal {
259-
LiquidityPool newLiquidityPoolImplementation = new LiquidityPool();
259+
// LiquidityPool newLiquidityPoolImplementation = new LiquidityPool();
260260
EtherFiNodesManager newEtherFiNodesManagerImplementation = new EtherFiNodesManager(
261261
address(STAKING_MANAGER),
262262
address(ROLE_REGISTRY),
263263
address(ETHERFI_RATE_LIMITER)
264264
);
265-
contractCodeChecker.verifyContractByteCodeMatch(liquidityPoolImpl, address(newLiquidityPoolImplementation));
265+
// contractCodeChecker.verifyContractByteCodeMatch(liquidityPoolImpl, address(newLiquidityPoolImplementation));
266266
contractCodeChecker.verifyContractByteCodeMatch(etherFiNodesManagerImpl, address(newEtherFiNodesManagerImplementation));
267267

268268
console2.log("[OK] Bytecode verified successfully");
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.27;
3+
4+
import "forge-std/Script.sol";
5+
import "forge-std/console2.sol";
6+
import "../../utils/utils.sol";
7+
import "../../../src/helpers/EtherFiOperationParameters.sol";
8+
9+
// Generate direct calldata for Operations Params updates:
10+
// forge script script/upgrades/priority-queue/SetPriorityQueueParams.s.sol --fork-url $MAINNET_RPC_URL -vvvv
11+
contract SetPriorityQueueParams is Script, Utils {
12+
EtherFiOperationParameters internal constant _OPERATION_PARAMS =
13+
EtherFiOperationParameters(payable(ETHERFI_OPERATION_PARAMETERS));
14+
15+
string internal constant _PRIORITY_WITHDRAWAL = "PRIORITY_WITHDRAWAL";
16+
string internal constant _PRIORITY_USERS_FEE_BPS = "PRIORITY_USERS_FEE_BPS";
17+
string internal constant _ORACLE = "ORACLE";
18+
string internal constant _ESTIMATED_WD_TIME_SECONDS = "14400";
19+
string internal constant _TEST_PRIORITY_USER = "0x6b6c4414f9fF7B1684380bc421A8b7036C040383";
20+
address internal constant _PANKAJ_LEDGER = 0x1B7Fd9679B2678F7e01897E0A3BA9aF18dF4f71e;
21+
22+
function run() external {
23+
_printCalldata();
24+
_writeGnosisTxFiles();
25+
_simulateOnFork();
26+
}
27+
28+
function _printCalldata() internal view {
29+
bytes memory a1 = abi.encodeWithSelector(
30+
EtherFiOperationParameters.updateTagAdmin.selector,
31+
_PRIORITY_WITHDRAWAL,
32+
ETHERFI_OPERATING_ADMIN,
33+
true
34+
);
35+
bytes memory a2 = abi.encodeWithSelector(
36+
EtherFiOperationParameters.updateTagAdmin.selector,
37+
_PRIORITY_USERS_FEE_BPS,
38+
ETHERFI_OPERATING_ADMIN,
39+
true
40+
);
41+
bytes memory a3 = abi.encodeWithSelector(
42+
EtherFiOperationParameters.updateTagAdmin.selector,
43+
_ORACLE,
44+
_PANKAJ_LEDGER,
45+
true
46+
);
47+
48+
bytes memory c1 = abi.encodeWithSelector(
49+
EtherFiOperationParameters.updateTagKeyValue.selector,
50+
_PRIORITY_WITHDRAWAL,
51+
"AUTO_FULFILL_LIMIT_ETH",
52+
"5000"
53+
);
54+
bytes memory c2 = abi.encodeWithSelector(
55+
EtherFiOperationParameters.updateTagKeyValue.selector,
56+
_PRIORITY_WITHDRAWAL,
57+
"DAILY_CAP_PER_USER_ETH",
58+
"10000"
59+
);
60+
bytes memory c3 = abi.encodeWithSelector(
61+
EtherFiOperationParameters.updateTagKeyValue.selector,
62+
_PRIORITY_WITHDRAWAL,
63+
"WEEKLY_CAP_PER_USER_ETH",
64+
"50000"
65+
);
66+
bytes memory c4 = abi.encodeWithSelector(
67+
EtherFiOperationParameters.updateTagKeyValue.selector,
68+
_PRIORITY_WITHDRAWAL,
69+
"FINALIZED_NOT_CLAIMED_EXPIRY_DAYS",
70+
"5"
71+
);
72+
bytes memory c5 = abi.encodeWithSelector(
73+
EtherFiOperationParameters.updateTagKeyValue.selector,
74+
_PRIORITY_WITHDRAWAL,
75+
"ESTIMATED_WD_TIME",
76+
_ESTIMATED_WD_TIME_SECONDS
77+
);
78+
bytes memory c6 = abi.encodeWithSelector(
79+
EtherFiOperationParameters.updateTagKeyValue.selector,
80+
_PRIORITY_USERS_FEE_BPS,
81+
_TEST_PRIORITY_USER,
82+
"100"
83+
);
84+
85+
console2.log("Target (all direct calls):", address(_OPERATION_PARAMS));
86+
console2.log("");
87+
88+
console2.log("A1) updateTagAdmin(PRIORITY_WITHDRAWAL, ETHERFI_OPERATING_ADMIN, true)");
89+
console2.logBytes(a1);
90+
console2.log("");
91+
92+
console2.log("A2) updateTagAdmin(PRIORITY_USERS_FEE_BPS, ETHERFI_OPERATING_ADMIN, true)");
93+
console2.logBytes(a2);
94+
console2.log("");
95+
96+
console2.log("A3) updateTagAdmin(ORACLE, 0x1B7Fd9679B2678F7e01897E0A3BA9aF18dF4f71e, true)");
97+
console2.logBytes(a3);
98+
console2.log("");
99+
100+
console2.log("1) PRIORITY_WITHDRAWAL.AUTO_FULFILL_LIMIT_ETH = 5000");
101+
console2.logBytes(c1);
102+
console2.log("");
103+
104+
console2.log("2) PRIORITY_WITHDRAWAL.DAILY_CAP_PER_USER_ETH = 10000");
105+
console2.logBytes(c2);
106+
console2.log("");
107+
108+
console2.log("3) PRIORITY_WITHDRAWAL.WEEKLY_CAP_PER_USER_ETH = 50000");
109+
console2.logBytes(c3);
110+
console2.log("");
111+
112+
console2.log("4) PRIORITY_WITHDRAWAL.FINALIZED_NOT_CLAIMED_EXPIRY_DAYS = 5");
113+
console2.logBytes(c4);
114+
console2.log("");
115+
116+
console2.log("5) PRIORITY_WITHDRAWAL.ESTIMATED_WD_TIME = 14400");
117+
console2.logBytes(c5);
118+
console2.log("");
119+
120+
console2.log("6) PRIORITY_USERS_FEE_BPS[0x6b6c4414f9fF7B1684380bc421A8b7036C040383] = 100");
121+
console2.logBytes(c6);
122+
}
123+
124+
function _simulateOnFork() internal {
125+
vm.startPrank(ETHERFI_OPERATING_ADMIN);
126+
_OPERATION_PARAMS.updateTagAdmin(_PRIORITY_WITHDRAWAL, ETHERFI_OPERATING_ADMIN, true);
127+
_OPERATION_PARAMS.updateTagAdmin(_PRIORITY_USERS_FEE_BPS, ETHERFI_OPERATING_ADMIN, true);
128+
_OPERATION_PARAMS.updateTagAdmin(_ORACLE, _PANKAJ_LEDGER, true);
129+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_WITHDRAWAL, "AUTO_FULFILL_LIMIT_ETH", "5000");
130+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_WITHDRAWAL, "DAILY_CAP_PER_USER_ETH", "10000");
131+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_WITHDRAWAL, "WEEKLY_CAP_PER_USER_ETH", "50000");
132+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_WITHDRAWAL, "FINALIZED_NOT_CLAIMED_EXPIRY_DAYS", "5");
133+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_WITHDRAWAL, "ESTIMATED_WD_TIME", _ESTIMATED_WD_TIME_SECONDS);
134+
_OPERATION_PARAMS.updateTagKeyValue(_PRIORITY_USERS_FEE_BPS, _TEST_PRIORITY_USER, "100");
135+
vm.stopPrank();
136+
}
137+
138+
function _writeGnosisTxFiles() internal {
139+
address[] memory targets = new address[](9);
140+
uint256[] memory values = new uint256[](9);
141+
bytes[] memory data = new bytes[](9);
142+
143+
for (uint256 i = 0; i < 9; i++) {
144+
targets[i] = address(_OPERATION_PARAMS);
145+
values[i] = 0;
146+
}
147+
148+
data[0] = abi.encodeWithSelector(
149+
EtherFiOperationParameters.updateTagAdmin.selector,
150+
_PRIORITY_WITHDRAWAL,
151+
ETHERFI_OPERATING_ADMIN,
152+
true
153+
);
154+
data[1] = abi.encodeWithSelector(
155+
EtherFiOperationParameters.updateTagAdmin.selector,
156+
_PRIORITY_USERS_FEE_BPS,
157+
ETHERFI_OPERATING_ADMIN,
158+
true
159+
);
160+
data[2] = abi.encodeWithSelector(
161+
EtherFiOperationParameters.updateTagAdmin.selector,
162+
_ORACLE,
163+
_PANKAJ_LEDGER,
164+
true
165+
);
166+
data[3] = abi.encodeWithSelector(
167+
EtherFiOperationParameters.updateTagKeyValue.selector,
168+
_PRIORITY_WITHDRAWAL,
169+
"AUTO_FULFILL_LIMIT_ETH",
170+
"5000"
171+
);
172+
data[4] = abi.encodeWithSelector(
173+
EtherFiOperationParameters.updateTagKeyValue.selector,
174+
_PRIORITY_WITHDRAWAL,
175+
"DAILY_CAP_PER_USER_ETH",
176+
"10000"
177+
);
178+
data[5] = abi.encodeWithSelector(
179+
EtherFiOperationParameters.updateTagKeyValue.selector,
180+
_PRIORITY_WITHDRAWAL,
181+
"WEEKLY_CAP_PER_USER_ETH",
182+
"50000"
183+
);
184+
data[6] = abi.encodeWithSelector(
185+
EtherFiOperationParameters.updateTagKeyValue.selector,
186+
_PRIORITY_WITHDRAWAL,
187+
"FINALIZED_NOT_CLAIMED_EXPIRY_DAYS",
188+
"5"
189+
);
190+
data[7] = abi.encodeWithSelector(
191+
EtherFiOperationParameters.updateTagKeyValue.selector,
192+
_PRIORITY_WITHDRAWAL,
193+
"ESTIMATED_WD_TIME",
194+
_ESTIMATED_WD_TIME_SECONDS
195+
);
196+
data[8] = abi.encodeWithSelector(
197+
EtherFiOperationParameters.updateTagKeyValue.selector,
198+
_PRIORITY_USERS_FEE_BPS,
199+
_TEST_PRIORITY_USER,
200+
"100"
201+
);
202+
203+
writeSafeJson(
204+
"script/upgrades/priority-queue",
205+
"set-priority-queue-params.json",
206+
ETHERFI_OPERATING_ADMIN,
207+
targets,
208+
values,
209+
data,
210+
1
211+
);
212+
}
213+
}

0 commit comments

Comments
 (0)