diff --git a/script/Release.s.sol b/script/Release.s.sol index db62bf4e6..a02653ea6 100644 --- a/script/Release.s.sol +++ b/script/Release.s.sol @@ -21,10 +21,13 @@ contract Release_X is Releasoor { // _printAddrs(addrs); Snake s = new Snake(); + Snake s2 = new Snake(); addrs.eigenPodManager.setPending(address(s)); + addrs.eigenPod.setPending(address(s2)); - _log("pending", addrs.eigenPodManager.getPending()); + _log("pending pod", addrs.eigenPod.getPending()); + _log("pending podManager", addrs.eigenPodManager.getPending()); } // function deploy(Addresses memory addrs) public override { @@ -90,6 +93,8 @@ contract Release_X is Releasoor { op: EncGnosisSafe.Operation.DelegateCall }); + emit log_named_bytes("final_calldata_to_executor_multisig", final_calldata_to_executor_multisig); + bytes memory calldata_to_timelock_queueing_action = EncTimelock.queueTransaction({ target: addrs.executorMultisig, data: final_calldata_to_executor_multisig, @@ -97,6 +102,29 @@ contract Release_X is Releasoor { }); emit log_named_bytes("calldata_to_timelock_queueing_action", calldata_to_timelock_queueing_action); + } + + function executeUpgrade(Addresses memory addrs) public override { + Txs storage txs = _newTxs(); + + txs.append({ + to: addrs.eigenPod.beacon, + data: EncUpgradeableBeacon.upgradeTo(addrs.eigenPod.getPending()) + }); + + txs.append({ + to: addrs.eigenPodManager.proxy, + data: EncProxyAdmin.upgrade(addrs.eigenPodManager.proxy, addrs.eigenPodManager.getPending()) + }); + + bytes memory calldata_to_multisend_contract = EncMultiSendCallOnly.multiSend(txs); + + bytes memory final_calldata_to_executor_multisig = EncGnosisSafe.execTransaction({ + from: addrs.timelock, + to: params.multiSendCallOnly, + data: calldata_to_multisend_contract, + op: EncGnosisSafe.Operation.DelegateCall + }); bytes memory calldata_to_timelock_executing_action = EncTimelock.executeTransaction({ target: addrs.executorMultisig, @@ -105,6 +133,10 @@ contract Release_X is Releasoor { }); emit log_named_bytes("calldata_to_timelock_executing_action", calldata_to_timelock_executing_action); + + // Update config + addrs.eigenPod.updateFromPending(); + addrs.eigenPodManager.updateFromPending(); } // function queueUpgrade(Addresses memory addrs) public override returns (Txns storage) { diff --git a/script/utils/AddressUtils.sol b/script/utils/AddressUtils.sol index aa121677f..8f48f8d6c 100644 --- a/script/utils/AddressUtils.sol +++ b/script/utils/AddressUtils.sol @@ -63,6 +63,18 @@ library AddressUtils { info.pendingImpl = pendingAddress; } + function updateFromPending(TUPInfo memory info) internal pure { + info.pendingImpl = getPending(info); + } + + function updateFromPending(BeaconInfo memory info) internal pure { + info.pendingImpl = getPending(info); + } + + function updateFromPending(TokenInfo memory info) internal pure { + info.pendingImpl = getPending(info); + } + function getPending(TUPInfo memory info) internal pure returns (address) { if (info.pendingImpl == address(0)) { revert("no pending implementation found");