diff --git a/l1-contracts/deploy-scripts/AcceptAdmin.s.sol b/l1-contracts/deploy-scripts/AcceptAdmin.s.sol index 2e712787d..50f26c32b 100644 --- a/l1-contracts/deploy-scripts/AcceptAdmin.s.sol +++ b/l1-contracts/deploy-scripts/AcceptAdmin.s.sol @@ -5,10 +5,12 @@ import {Script} from "forge-std/Script.sol"; import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import {IZkSyncHyperchain} from "contracts/state-transition/chain-interfaces/IZkSyncHyperchain.sol"; +import {ChainAdmin} from "contracts/governance/ChainAdmin.sol"; +import {IChainAdmin} from "contracts/governance/IChainAdmin.sol"; import {Utils} from "./Utils.sol"; contract AcceptAdmin is Script { - // This function should be called by the owner to accept the admin role + // This function should be called by the owner to accept the owner role function acceptOwner(address governor, address target) public { Ownable2Step adminContract = Ownable2Step(target); Utils.executeUpgrade({ @@ -22,15 +24,15 @@ contract AcceptAdmin is Script { } // This function should be called by the owner to accept the admin role - function acceptAdmin(address admin, address target) public { - IZkSyncHyperchain adminContract = IZkSyncHyperchain(target); - Utils.executeUpgrade({ - _governor: admin, - _salt: bytes32(0), - _target: target, - _data: abi.encodeCall(adminContract.acceptAdmin, ()), - _value: 0, - _delay: 0 - }); + function acceptAdmin(address payable _admin, address _target) public { + IZkSyncHyperchain hyperchain = IZkSyncHyperchain(_target); + ChainAdmin chainAdmin = ChainAdmin(_admin); + + IChainAdmin.Call[] memory calls = new IChainAdmin.Call[](1); + calls[0] = IChainAdmin.Call({target: _target, value: 0, data: abi.encodeCall(hyperchain.acceptAdmin, ())}); + + vm.startBroadcast(); + chainAdmin.multicall(calls, true); + vm.stopBroadcast(); } }