Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wadealexc committed Sep 16, 2024
1 parent d2bd273 commit 250b9b7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
34 changes: 33 additions & 1 deletion script/Release.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -90,13 +93,38 @@ 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,
eta: 0
});

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,
Expand All @@ -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) {
Expand Down
12 changes: 12 additions & 0 deletions script/utils/AddressUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 250b9b7

Please sign in to comment.