|
| 1 | +// SPDX-License-Identifier: BUSL-1.1 |
| 2 | +pragma solidity ^0.8.12; |
| 3 | + |
| 4 | +import "../Env.sol"; |
| 5 | +import {TransferDAOwnershipConstants as C} from "./TransferDAOwnershipConstants.sol"; |
| 6 | + |
| 7 | +import {MultisigBuilder} from "zeus-templates/templates/MultisigBuilder.sol"; |
| 8 | +import "zeus-templates/utils/Encode.sol"; |
| 9 | + |
| 10 | +import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol"; |
| 11 | +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; |
| 12 | + |
| 13 | +/** |
| 14 | + * Purpose: |
| 15 | + * * enqueue a multisig transaction which; |
| 16 | + * - transfers DA Proxy Admin ownership to the EigenDA ops multisig |
| 17 | + * This should be run via the protocol council multisig. |
| 18 | + */ |
| 19 | +contract QueueTransferProxyAdmin is MultisigBuilder { |
| 20 | + using Env for *; |
| 21 | + using Encode for *; |
| 22 | + |
| 23 | + function _runAsMultisig() internal virtual override prank(Env.opsMultisig()) { |
| 24 | + bytes memory calldata_to_executor = _getCalldataToExecutor(); |
| 25 | + |
| 26 | + TimelockController timelock = Env.timelockController(); |
| 27 | + timelock.schedule({ |
| 28 | + target: Env.executorMultisig(), |
| 29 | + value: 0, |
| 30 | + data: calldata_to_executor, |
| 31 | + predecessor: 0, |
| 32 | + salt: 0, |
| 33 | + delay: timelock.getMinDelay() |
| 34 | + }); |
| 35 | + } |
| 36 | + |
| 37 | + /// @dev Get the calldata to be sent from the timelock to the executor |
| 38 | + function _getCalldataToExecutor() internal returns (bytes memory) { |
| 39 | + MultisigCall[] storage executorCalls = Encode.newMultisigCalls().append({ |
| 40 | + to: C.EIGEN_DA_PROXY_ADMIN, |
| 41 | + data: abi.encodeCall(Ownable.transferOwnership, (C.EIGEN_DA_OPS_MULTISIG)) |
| 42 | + }); |
| 43 | + |
| 44 | + return Encode.gnosisSafe.execTransaction({ |
| 45 | + from: address(Env.timelockController()), |
| 46 | + to: Env.multiSendCallOnly(), |
| 47 | + op: Encode.Operation.DelegateCall, |
| 48 | + data: Encode.multiSend(executorCalls) |
| 49 | + }); |
| 50 | + } |
| 51 | + |
| 52 | + function testScript() public virtual { |
| 53 | + TimelockController timelock = Env.timelockController(); |
| 54 | + bytes memory calldata_to_executor = _getCalldataToExecutor(); |
| 55 | + bytes32 txHash = timelock.hashOperation({ |
| 56 | + target: Env.executorMultisig(), |
| 57 | + value: 0, |
| 58 | + data: calldata_to_executor, |
| 59 | + predecessor: 0, |
| 60 | + salt: 0 |
| 61 | + }); |
| 62 | + |
| 63 | + // Check that the upgrade does not exist in the timelock |
| 64 | + assertFalse(timelock.isOperationPending(txHash), "Transaction should NOT be queued."); |
| 65 | + |
| 66 | + execute(); |
| 67 | + |
| 68 | + // Check that the upgrade has been added to the timelock |
| 69 | + assertTrue(timelock.isOperationPending(txHash), "Transaction should be queued."); |
| 70 | + } |
| 71 | +} |
0 commit comments