@@ -6,13 +6,13 @@ import {QueueUpgrade} from "./2-queueUpgrade.s.sol";
66import {MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol " ;
77import "zeus-templates/utils/Encode.sol " ;
88
9+ /// @notice Executes the upgrade for redistribution v1.5.0
910contract Execute is QueueUpgrade {
1011 using Env for * ;
1112 using Encode for * ;
1213
1314 function _runAsMultisig () internal override prank (Env.protocolCouncilMultisig ()) {
1415 bytes memory calldata_to_executor_v1_5_queue = _getCalldataToExecutor_v1_5_queue ();
15- bytes memory calldata_to_executor_v1_6_queue = _getCalldataToExecutor ();
1616 TimelockController timelock = Env.timelockController ();
1717
1818 if (_isMainnet ()) {
@@ -24,14 +24,6 @@ contract Execute is QueueUpgrade {
2424 salt: 0
2525 });
2626 }
27-
28- timelock.execute ({
29- target: Env.executorMultisig (),
30- value: 0 ,
31- payload: calldata_to_executor_v1_6_queue,
32- predecessor: 0 ,
33- salt: 0
34- });
3527 }
3628
3729 /// @dev Get the calldata to be sent from the timelock to the executor
@@ -92,7 +84,9 @@ contract Execute is QueueUpgrade {
9284 }
9385
9486 function testScript () public virtual override {
95- runAsEOA ();
87+ if (! _isMainnet ()) {
88+ return ;
89+ }
9690
9791 TimelockController timelock = Env.timelockController ();
9892 bytes memory calldata_to_executor_v1_5_queue = _getCalldataToExecutor_v1_5_queue ();
@@ -103,90 +97,23 @@ contract Execute is QueueUpgrade {
10397 predecessor: 0 ,
10498 salt: 0
10599 });
100+ // 1 - Deploy. The contracts have been deployed in the redistro upgrade script
106101
107- bytes memory calldata_to_executor = _getCalldataToExecutor ();
108- bytes32 txHash = timelock.hashOperation ({
109- target: Env.executorMultisig (),
110- value: 0 ,
111- data: calldata_to_executor,
112- predecessor: 0 ,
113- salt: 0
114- });
115-
116- if (_isMainnet ()) {
117- assertTrue (timelock.isOperationPending (txHash_v1_5), "v 1.5 txn SHOULD be queued. " );
118- }
119- assertFalse (timelock.isOperationPending (txHash), "Transaction should NOT be queued. " );
120-
121- // 1- run queueing logic
122- QueueUpgrade._runAsMultisig ();
123- _unsafeResetHasPranked (); // reset hasPranked so we can use it again
124-
125- if (_isMainnet ()) {
126- assertTrue (timelock.isOperationPending (txHash_v1_5), "v 1.5 txn SHOULD be queued. " );
127- assertFalse (timelock.isOperationReady (txHash_v1_5), "v 1.5 txn sh;ould NOT be ready for execution. " );
128- assertFalse (timelock.isOperationDone (txHash_v1_5), "v 1.5 should NOT be complete. " );
129- }
130- assertTrue (timelock.isOperationPending (txHash), "Transaction should be queued. " );
131- assertFalse (timelock.isOperationReady (txHash), "Transaction should NOT be ready for execution. " );
132- assertFalse (timelock.isOperationDone (txHash), "Transaction should NOT be complete. " );
102+ /// 2 - Queue. The contracts have been deployed in the redistribution upgrade script.
103+ /// At the time of writing, the operation IS ready
104+ assertEq (timelock.isOperationReady (txHash_v1_5), true , "v1.5 txn should be executable. " );
133105
134- // 2- warp past delay
135- vm.warp (block .timestamp + timelock.getMinDelay ()); // 1 tick after ETA
136- if (_isMainnet ()) {
137- assertEq (timelock.isOperationReady (txHash_v1_5), true , "v1.5 txn should be executable. " );
138- }
139- assertEq (timelock.isOperationReady (txHash), true , "Transaction should be executable. " );
140-
141- // 3- execute
106+ // 3 - execute
142107 execute ();
143-
144108 assertTrue (timelock.isOperationDone (txHash_v1_5), "v1.5 txn should be complete. " );
145- assertTrue (timelock.isOperationDone (txHash), "Transaction should be complete. " );
146109
147- _validateNewImplAddresses ({areMatching: true });
110+ // 4. Validate
148111 _validateNewImplAddresses_v1_5 ({areMatching: true });
149- _validateProxyAdmins ();
150112 _validateProxyAdmins_v1_5 ();
151- _validateProxyConstructors ();
152113 _validateProxyConstructors_v1_5 ();
153- _validateProxiesInitialized ();
154114 _validateProxiesInitialized_v1_5 ();
155115 }
156116
157- /// @dev Mirrors the checks done in 1-deployContracts, but now we check each contract's
158- /// proxy, as the upgrade should mean that each proxy can see these methods/immutables
159- function _validateProxyConstructors () internal view {
160- {
161- UpgradeableBeacon eigenPodBeacon = Env.beacon.eigenPod ();
162- assertTrue (eigenPodBeacon.implementation () == address (Env.impl.eigenPod ()), "eigenPodBeacon.impl invalid " );
163-
164- /// EigenPod
165- EigenPod eigenPod = Env.impl.eigenPod ();
166- assertTrue (eigenPod.ethPOS () == Env.ethPOS (), "ep.ethPOS invalid " );
167- assertTrue (eigenPod.eigenPodManager () == Env.proxy.eigenPodManager (), "ep.epm invalid " );
168- assertEq (eigenPod.version (), Env.deployVersion (), "ep.version failed " );
169- }
170-
171- {
172- /// Eigen
173- Eigen eigen = Eigen (address (Env.proxy.eigen ()));
174- assertTrue (address (eigen.bEIGEN ()) == address (Env.proxy.beigen ()), "eigen.beigen invalid " );
175- assertEq (eigen.version (), Env.deployVersion (), "eigen.version failed " );
176- }
177- }
178-
179- /// @dev Call initialize on all proxies to ensure they are initialized
180- /// Additionally, validate initialization variables
181- function _validateProxiesInitialized () internal {
182- bytes memory errInit = "Initializable: contract is already initialized " ;
183-
184- /// Eigen
185- Eigen eigen = Eigen (address (Env.proxy.eigen ()));
186- vm.expectRevert (errInit);
187- eigen.initialize (address (0 ), new address [](0 ), new uint256 [](0 ), new uint256 [](0 ));
188- }
189-
190117 /// @dev Validate that the `Env.impl` addresses are updated to be distinct from what the proxy
191118 /// admin reports as the current implementation address.
192119 ///
0 commit comments