diff --git a/l1-contracts/deploy-scripts/AcceptAdmin.s.sol b/l1-contracts/deploy-scripts/AcceptAdmin.s.sol index 00ade426a..3a80c0ce4 100644 --- a/l1-contracts/deploy-scripts/AcceptAdmin.s.sol +++ b/l1-contracts/deploy-scripts/AcceptAdmin.s.sol @@ -2,39 +2,19 @@ pragma solidity ^0.8.0; import {Script} from "forge-std/Script.sol"; -import {stdToml} from "forge-std/StdToml.sol"; import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import {IZkSyncHyperchain} from "contracts/state-transition/chain-interfaces/IZkSyncHyperchain.sol"; import {Utils} from "./Utils.sol"; contract AcceptAdmin is Script { - using stdToml for string; - - struct Config { - address admin; - address governor; - } - - Config config; - - function initConfig() public { - string memory root = vm.projectRoot(); - string memory path = string.concat(root, "/script-config/config-accept-admin.toml"); - string memory toml = vm.readFile(path); - config.admin = toml.readAddress("$.target_addr"); - config.governor = toml.readAddress("$.governor"); - } - // This function should be called by the owner to accept the admin role - function acceptOwner() public { - initConfig(); - - Ownable2Step adminContract = Ownable2Step(config.admin); + function acceptOwner(address governor, address target) public { + Ownable2Step adminContract = Ownable2Step(target); Utils.executeUpgrade({ - _governor: config.governor, + _governor: governor, _salt: bytes32(0), - _target: config.admin, + _target: target, _data: abi.encodeCall(adminContract.acceptOwnership, ()), _value: 0, _delay: 0 @@ -42,13 +22,12 @@ contract AcceptAdmin is Script { } // This function should be called by the owner to accept the admin role - function acceptAdmin() public { - initConfig(); - IZkSyncHyperchain adminContract = IZkSyncHyperchain(config.admin); + function acceptAdmin(address governor, address target) public { + IZkSyncHyperchain adminContract = IZkSyncHyperchain(target); Utils.executeUpgrade({ - _governor: config.governor, + _governor: governor, _salt: bytes32(0), - _target: config.admin, + _target: target, _data: abi.encodeCall(adminContract.acceptAdmin, ()), _value: 0, _delay: 0