From 5deabd3cfade451e0482dca45e58dbe572760750 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:01:27 +0530 Subject: [PATCH 1/4] feat: add vip for multichain governance on zksync sepolia --- .../proposals/zksyncsepolia/vip-010/index.ts | 93 +++ .../vip-010/abi/AccessControlManagerAbi.json | 157 +++++ .../zksyncsepolia/vip-010/index.ts | 73 +++ .../vip-365/abi/AccessControlManager_ABI.json | 157 +++++ .../abi/OmnichainExecutorOwner_ABI.json | 145 +++++ .../abi/OmnichainGovernanceExecutor_ABI.json | 539 ++++++++++++++++++ .../vip-365/abi/OmnichainProposalSender.json | 314 ++++++++++ simulations/vip-365/bsctestnet.ts | 56 ++ simulations/vip-365/zksyncsepolia.ts | 97 ++++ .../vip-366/abi/AccessControlManager_ABI.json | 157 +++++ .../abi/OmnichainGovernanceExecutor_ABI.json | 539 ++++++++++++++++++ .../vip-366/abi/OmnichainProposalSender.json | 314 ++++++++++ simulations/vip-366/bsctestnet.ts | 26 + simulations/vip-366/zksyncsepolia.ts | 45 ++ src/networkAddresses.ts | 5 +- src/types.ts | 3 +- src/utils.ts | 8 + src/vip-framework/index.ts | 16 +- vips/vip-365/bsctestnet.ts | 173 ++++++ vips/vip-366/bsctestnet.ts | 132 +++++ 20 files changed, 3044 insertions(+), 5 deletions(-) create mode 100644 multisig/proposals/zksyncsepolia/vip-010/index.ts create mode 100644 multisig/simulations/zksyncsepolia/vip-010/abi/AccessControlManagerAbi.json create mode 100644 multisig/simulations/zksyncsepolia/vip-010/index.ts create mode 100644 simulations/vip-365/abi/AccessControlManager_ABI.json create mode 100644 simulations/vip-365/abi/OmnichainExecutorOwner_ABI.json create mode 100644 simulations/vip-365/abi/OmnichainGovernanceExecutor_ABI.json create mode 100644 simulations/vip-365/abi/OmnichainProposalSender.json create mode 100644 simulations/vip-365/bsctestnet.ts create mode 100644 simulations/vip-365/zksyncsepolia.ts create mode 100644 simulations/vip-366/abi/AccessControlManager_ABI.json create mode 100644 simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json create mode 100644 simulations/vip-366/abi/OmnichainProposalSender.json create mode 100644 simulations/vip-366/bsctestnet.ts create mode 100644 simulations/vip-366/zksyncsepolia.ts create mode 100644 vips/vip-365/bsctestnet.ts create mode 100644 vips/vip-366/bsctestnet.ts diff --git a/multisig/proposals/zksyncsepolia/vip-010/index.ts b/multisig/proposals/zksyncsepolia/vip-010/index.ts new file mode 100644 index 000000000..1790c7435 --- /dev/null +++ b/multisig/proposals/zksyncsepolia/vip-010/index.ts @@ -0,0 +1,93 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; +export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; +export const ZKSYNCSEPOLIA_NORMAL_TIMELOCK = "0x1730527a0f0930269313D77A317361b42971a67E"; +const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; + +export const vip010 = () => { + return makeProposal([ + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setMaxDailyReceiveLimit(uint256)", zksyncsepolia.GUARDIAN], + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "unpause()", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setTrustedRemoteAddress(uint16,bytes)", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setTimelockPendingAdmin(address,uint8)", + zksyncsepolia.GUARDIAN, + ], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "retryMessage(uint16,bytes,uint64,bytes)", + zksyncsepolia.GUARDIAN, + ], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSrcChainId(uint16)", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setConfig(uint16,uint16,uint256,bytes)", + zksyncsepolia.GUARDIAN, + ], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "transferBridgeOwnership(address)", zksyncsepolia.GUARDIAN], + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_NORMAL_TIMELOCK], + }, + ]); +}; +export default vip010; diff --git a/multisig/simulations/zksyncsepolia/vip-010/abi/AccessControlManagerAbi.json b/multisig/simulations/zksyncsepolia/vip-010/abi/AccessControlManagerAbi.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/multisig/simulations/zksyncsepolia/vip-010/abi/AccessControlManagerAbi.json @@ -0,0 +1,157 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToPermit", "type": "address" } + ], + "name": "giveCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "hasPermission", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "isAllowedToCall", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToRevoke", "type": "address" } + ], + "name": "revokeCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-010/index.ts new file mode 100644 index 000000000..7f0b96c1d --- /dev/null +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -0,0 +1,73 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip009, { + ZKSYNCSEPOLIA_ACM, + ZKSYNCSEPOLIA_NORMAL_TIMELOCK, + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, +} from "../../../proposals/zksyncsepolia/vip-010"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManagerAbi.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; + +forking(3771669, async () => { + let acm: Contract; + let defaultAdminRole: string; + before(async () => { + acm = await ethers.getContractAt(ACCESS_CONTROL_MANAGER_ABI, ZKSYNCSEPOLIA_ACM); + defaultAdminRole = await acm.DEFAULT_ADMIN_ROLE(); + }); + describe("Pre-VIP behaviour", async () => { + it("Normal Timelock does not has default admin role", async () => { + const hasRole = await acm.hasRole(defaultAdminRole, ZKSYNCSEPOLIA_NORMAL_TIMELOCK); + expect(hasRole).equals(false); + }); + + it("Guardian is not allowed to call retryMessage", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "retryMessage(uint16,bytes,uint64,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.false; + }); + + it("Guardian is not allowed to call forceResumeReceive", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.false; + }); + }); + describe("Post-VIP behavior", async () => { + before(async () => { + await pretendExecutingVip(await vip009()); + }); + it("Normal Timelock has default admin role", async () => { + const hasRole = await acm.hasRole(defaultAdminRole, ZKSYNCSEPOLIA_NORMAL_TIMELOCK); + expect(hasRole).equals(true); + }); + it("Guardian is allowed to call retryMessage", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "retryMessage(uint16,bytes,uint64,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + + it("Guardian is allowed to call forceResumeReceive", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + }); +}); diff --git a/simulations/vip-365/abi/AccessControlManager_ABI.json b/simulations/vip-365/abi/AccessControlManager_ABI.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/simulations/vip-365/abi/AccessControlManager_ABI.json @@ -0,0 +1,157 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToPermit", "type": "address" } + ], + "name": "giveCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "hasPermission", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "isAllowedToCall", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToRevoke", "type": "address" } + ], + "name": "revokeCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-365/abi/OmnichainExecutorOwner_ABI.json b/simulations/vip-365/abi/OmnichainExecutorOwner_ABI.json new file mode 100644 index 000000000..f75834e6c --- /dev/null +++ b/simulations/vip-365/abi/OmnichainExecutorOwner_ABI.json @@ -0,0 +1,145 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "omnichainGovernanceExecutor_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "string", "name": "signature", "type": "string" }, + { "indexed": false, "internalType": "bool", "name": "active", "type": "bool" } + ], + "name": "FunctionRegistryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "stateMutability": "nonpayable", "type": "fallback" }, + { + "inputs": [], + "name": "OMNICHAIN_GOVERNANCE_EXECUTOR", + "outputs": [{ "internalType": "contract IOmnichainGovernanceExecutor", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "name": "functionRegistry", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "srcAddress_", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner_", "type": "address" }], + "name": "transferBridgeOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string[]", "name": "signatures_", "type": "string[]" }, + { "internalType": "bool[]", "name": "active_", "type": "bool[]" } + ], + "name": "upsertSignature", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-365/abi/OmnichainGovernanceExecutor_ABI.json b/simulations/vip-365/abi/OmnichainGovernanceExecutor_ABI.json new file mode 100644 index 000000000..b40c3cf44 --- /dev/null +++ b/simulations/vip-365/abi/OmnichainGovernanceExecutor_ABI.json @@ -0,0 +1,539 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "endpoint_", "type": "address" }, + { "internalType": "address", "name": "guardian_", "type": "address" }, + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "InvalidProposalId", "type": "error" }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "_payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "_reason", "type": "bytes" } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldGuardian", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newGuardian", "type": "address" } + ], + "name": "NewGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "eta", "type": "uint256" } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "address[]", "name": "targets", "type": "address[]" }, + { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" }, + { "indexed": false, "internalType": "string[]", "name": "signatures", "type": "string[]" }, + { "indexed": false, "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, + { "indexed": false, "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "name": "ProposalReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "srcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "bytes", "name": "srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "ReceivePayloadFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes32", "name": "_payloadHash", "type": "bytes32" } + ], + "name": "RetryMessageSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyReceiveLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "_type", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "_minDstGas", "type": "uint256" } + ], + "name": "SetMinDstGas", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "precrime", "type": "address" }], + "name": "SetPrecrime", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "oldSrcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "uint16", "name": "newSrcChainId", "type": "uint16" } + ], + "name": "SetSrcChainId", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "", "type": "address" }, + { "indexed": false, "internalType": "uint8", "name": "", "type": "uint8" } + ], + "name": "SetTimelockPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "SetTrustedRemote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint8", "name": "routeType", "type": "uint8" }, + { "indexed": true, "internalType": "address", "name": "oldTimelock", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newTimelock", "type": "address" } + ], + "name": "TimelockAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ITimelock[]", "name": "timelocks_", "type": "address[]" }], + "name": "addTimelocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "cancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "bytes", "name": "", "type": "bytes" }, + { "internalType": "uint64", "name": "", "type": "uint64" } + ], + "name": "failedMessages", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "forceResumeReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }], + "name": "getTrustedRemoteAddress", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "isTrustedRemote", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourCommandsReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourReceiveWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastProposalReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lzEndpoint", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDailyReceiveLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "uint16", "name": "", "type": "uint16" } + ], + "name": "minDstGasLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "nonblockingLzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "payloadSizeLimitLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "precrime", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposalTimelocks", + "outputs": [{ "internalType": "contract ITimelock", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposals", + "outputs": [ + { "internalType": "uint256", "name": "id", "type": "uint256" }, + { "internalType": "uint256", "name": "eta", "type": "uint256" }, + { "internalType": "bool", "name": "canceled", "type": "bool" }, + { "internalType": "bool", "name": "executed", "type": "bool" }, + { "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "queued", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "srcAddress_", "type": "bytes" }, + { "internalType": "uint64", "name": "nonce_", "type": "uint64" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" } + ], + "name": "retryMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" }, + { "internalType": "bytes", "name": "_config", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newGuardian", "type": "address" }], + "name": "setGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit_", "type": "uint256" }], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint16", "name": "_packetType", "type": "uint16" }, + { "internalType": "uint256", "name": "_minGas", "type": "uint256" } + ], + "name": "setMinDstGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_size", "type": "uint256" } + ], + "name": "setPayloadSizeLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_precrime", "type": "address" }], + "name": "setPrecrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setReceiveVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }], + "name": "setSrcChainId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "pendingAdmin_", "type": "address" }, + { "internalType": "uint8", "name": "proposalType_", "type": "uint8" } + ], + "name": "setTimelockPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "setTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "srcChainId", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "state", + "outputs": [{ "internalType": "enum OmnichainGovernanceExecutor.ProposalState", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-365/abi/OmnichainProposalSender.json b/simulations/vip-365/abi/OmnichainProposalSender.json new file mode 100644 index 000000000..66fd4df02 --- /dev/null +++ b/simulations/vip-365/abi/OmnichainProposalSender.json @@ -0,0 +1,314 @@ +[ + { + "inputs": [ + { "internalType": "contract ILayerZeroEndpoint", "name": "lzEndpoint_", "type": "address" }, + { "internalType": "address", "name": "accessControlManager_", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes32", "name": "executionHash", "type": "bytes32" } + ], + "name": "ClearPayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" } + ], + "name": "ExecuteRemoteProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "FallbackWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "oldRemoteAddress", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "newRemoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "adapterParams", "type": "bytes" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "StorePayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }], + "name": "TrustedRemoteRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "LZ_ENDPOINT", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourCommandsSent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLastProposalSentTimestamp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToMaxDailyLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bool", "name": "useZro_", "type": "bool" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" } + ], + "name": "estimateFees", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to_", "type": "address" }, + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "fallbackWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "retryExecute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" }, + { "internalType": "bytes", "name": "config_", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "limit_", "type": "uint256" } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "version_", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "newRemoteAddress_", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "storedExecutionHashes", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-365/bsctestnet.ts b/simulations/vip-365/bsctestnet.ts new file mode 100644 index 000000000..7f8e66523 --- /dev/null +++ b/simulations/vip-365/bsctestnet.ts @@ -0,0 +1,56 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId } from "src/types"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip365, { MAX_DAILY_LIMIT, OMNICHAIN_PROPOSAL_SENDER } from "../../vips/vip-365/bsctestnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; +forking(43836268, async () => { + const provider = ethers.provider; + const omnichainProposalSender = new ethers.Contract( + OMNICHAIN_PROPOSAL_SENDER, + OMNICHAIN_PROPOSAL_SENDER_ABI, + provider, + ); + + describe("Pre-VIP behaviour", () => { + it("Daily limit should be 0", async () => { + expect(await omnichainProposalSender.chainIdToMaxDailyLimit(LzChainId.zksyncsepolia)).to.equals(0); + }); + it("Trusted remote should not be set", async () => { + expect(await omnichainProposalSender.trustedRemoteLookup(LzChainId.zksyncsepolia)).to.be.equals("0x"); + }); + }); + + testVip("vip365 give permissions to timelock", await vip365(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, OMNICHAIN_PROPOSAL_SENDER_ABI], + + ["SetMaxDailyLimit", "SetTrustedRemoteAddress", "ExecuteRemoteProposal", "StorePayload"], + [1, 1, 1, 0], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Daily limit should be 100 of zksyncsepolia", async () => { + expect(await omnichainProposalSender.chainIdToMaxDailyLimit(LzChainId.zksyncsepolia)).to.equals(MAX_DAILY_LIMIT); + }); + + it("Trusted remote should be set of zksyncsepolia", async () => { + expect(await omnichainProposalSender.trustedRemoteLookup(LzChainId.zksyncsepolia)).to.be.equals( + ethers.utils.solidityPack( + ["address", "address"], + [zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, OMNICHAIN_PROPOSAL_SENDER], + ), + ); + }); + }); +}); diff --git a/simulations/vip-365/zksyncsepolia.ts b/simulations/vip-365/zksyncsepolia.ts new file mode 100644 index 000000000..5cd8838e4 --- /dev/null +++ b/simulations/vip-365/zksyncsepolia.ts @@ -0,0 +1,97 @@ +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId } from "src/types"; +import { expectEvents, getOmnichainProposalSenderAddress } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip010 from "../../multisig/proposals/zksyncsepolia/vip-010"; +import vip365, { ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER } from "../../vips/vip-365/bsctestnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; +import OMNICHAIN_EXECUTOR_OWNER_ABI from "./abi/OmnichainExecutorOwner_ABI.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; +const FAST_TRACK_TIMELOCK = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; +const CRITICAL_TIMELOCK = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; + +forking(3771669, async () => { + const provider = ethers.provider; + let lastProposalReceived: BigNumber; + let executor: Contract; + let executorOwner: Contract; + + before(async () => { + executor = new ethers.Contract( + zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + executorOwner = new ethers.Contract(ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, OMNICHAIN_EXECUTOR_OWNER_ABI, provider); + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip010()); + }); + + testForkedNetworkVipCommands("vip365 configures bridge", await vip365(), { + callbackAfterExecution: async txResponse => { + await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [15]); + }, + }); + + describe("Post-VIP behaviour", async () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + it("check configuration", async () => { + // Check Timelock configurations + expect(await executor.proposalTimelocks(0)).equals(zksyncsepolia.NORMAL_TIMELOCK); + expect(await executor.proposalTimelocks(1)).equals(FAST_TRACK_TIMELOCK); + expect(await executor.proposalTimelocks(2)).equals(CRITICAL_TIMELOCK); + + // Check trusted remote + expect(await executor.trustedRemoteLookup(LzChainId.bscmainnet)).equals( + ethers.utils.solidityPack( + ["address", "address"], + [getOmnichainProposalSenderAddress(), zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], + ), + ); + + // Check receiving limit + expect(await executor.maxDailyReceiveLimit()).equals(100); + expect(await executor.last24HourCommandsReceived()).equals(16); + + // Check function registry + const functionSignatures: string[] = [ + "forceResumeReceive(uint16,bytes)", + "pause()", + "unpause()", + "setSendVersion(uint16)", + "setReceiveVersion(uint16)", + "setMaxDailyReceiveLimit(uint256)", + "setTrustedRemoteAddress(uint16,bytes)", + "setPrecrime(address)", + "setMinDstGas(uint16,uint16,uint256)", + "setPayloadSizeLimit(uint16,uint256)", + "setConfig(uint16,uint16,uint256,bytes)", + "addTimelocks(ITimelock[])", + "setTimelockPendingAdmin(address,uint8)", + "retryMessage(uint16,bytes,uint64,bytes)", + "setGuardian(address)", + "setSrcChainId(uint16)", + ]; + const getFunctionSelector = (signature: string): string => { + return ethers.utils.keccak256(ethers.utils.toUtf8Bytes(signature)).substring(0, 10); + }; + + for (const signature of functionSignatures) { + const selector = getFunctionSelector(signature); + expect(await executorOwner.functionRegistry(selector)).equals(signature); + } + }); + }); +}); diff --git a/simulations/vip-366/abi/AccessControlManager_ABI.json b/simulations/vip-366/abi/AccessControlManager_ABI.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/simulations/vip-366/abi/AccessControlManager_ABI.json @@ -0,0 +1,157 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToPermit", "type": "address" } + ], + "name": "giveCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "hasPermission", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "isAllowedToCall", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToRevoke", "type": "address" } + ], + "name": "revokeCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json b/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json new file mode 100644 index 000000000..b40c3cf44 --- /dev/null +++ b/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json @@ -0,0 +1,539 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "endpoint_", "type": "address" }, + { "internalType": "address", "name": "guardian_", "type": "address" }, + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "InvalidProposalId", "type": "error" }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "_payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "_reason", "type": "bytes" } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldGuardian", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newGuardian", "type": "address" } + ], + "name": "NewGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "eta", "type": "uint256" } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "address[]", "name": "targets", "type": "address[]" }, + { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" }, + { "indexed": false, "internalType": "string[]", "name": "signatures", "type": "string[]" }, + { "indexed": false, "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, + { "indexed": false, "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "name": "ProposalReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "srcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "bytes", "name": "srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "ReceivePayloadFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes32", "name": "_payloadHash", "type": "bytes32" } + ], + "name": "RetryMessageSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyReceiveLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "_type", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "_minDstGas", "type": "uint256" } + ], + "name": "SetMinDstGas", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "precrime", "type": "address" }], + "name": "SetPrecrime", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "oldSrcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "uint16", "name": "newSrcChainId", "type": "uint16" } + ], + "name": "SetSrcChainId", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "", "type": "address" }, + { "indexed": false, "internalType": "uint8", "name": "", "type": "uint8" } + ], + "name": "SetTimelockPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "SetTrustedRemote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint8", "name": "routeType", "type": "uint8" }, + { "indexed": true, "internalType": "address", "name": "oldTimelock", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newTimelock", "type": "address" } + ], + "name": "TimelockAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ITimelock[]", "name": "timelocks_", "type": "address[]" }], + "name": "addTimelocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "cancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "bytes", "name": "", "type": "bytes" }, + { "internalType": "uint64", "name": "", "type": "uint64" } + ], + "name": "failedMessages", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "forceResumeReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }], + "name": "getTrustedRemoteAddress", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "isTrustedRemote", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourCommandsReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourReceiveWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastProposalReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lzEndpoint", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDailyReceiveLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "uint16", "name": "", "type": "uint16" } + ], + "name": "minDstGasLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "nonblockingLzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "payloadSizeLimitLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "precrime", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposalTimelocks", + "outputs": [{ "internalType": "contract ITimelock", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposals", + "outputs": [ + { "internalType": "uint256", "name": "id", "type": "uint256" }, + { "internalType": "uint256", "name": "eta", "type": "uint256" }, + { "internalType": "bool", "name": "canceled", "type": "bool" }, + { "internalType": "bool", "name": "executed", "type": "bool" }, + { "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "queued", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "srcAddress_", "type": "bytes" }, + { "internalType": "uint64", "name": "nonce_", "type": "uint64" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" } + ], + "name": "retryMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" }, + { "internalType": "bytes", "name": "_config", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newGuardian", "type": "address" }], + "name": "setGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit_", "type": "uint256" }], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint16", "name": "_packetType", "type": "uint16" }, + { "internalType": "uint256", "name": "_minGas", "type": "uint256" } + ], + "name": "setMinDstGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_size", "type": "uint256" } + ], + "name": "setPayloadSizeLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_precrime", "type": "address" }], + "name": "setPrecrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setReceiveVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }], + "name": "setSrcChainId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "pendingAdmin_", "type": "address" }, + { "internalType": "uint8", "name": "proposalType_", "type": "uint8" } + ], + "name": "setTimelockPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "setTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "srcChainId", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "state", + "outputs": [{ "internalType": "enum OmnichainGovernanceExecutor.ProposalState", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-366/abi/OmnichainProposalSender.json b/simulations/vip-366/abi/OmnichainProposalSender.json new file mode 100644 index 000000000..66fd4df02 --- /dev/null +++ b/simulations/vip-366/abi/OmnichainProposalSender.json @@ -0,0 +1,314 @@ +[ + { + "inputs": [ + { "internalType": "contract ILayerZeroEndpoint", "name": "lzEndpoint_", "type": "address" }, + { "internalType": "address", "name": "accessControlManager_", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes32", "name": "executionHash", "type": "bytes32" } + ], + "name": "ClearPayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" } + ], + "name": "ExecuteRemoteProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "FallbackWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "oldRemoteAddress", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "newRemoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "adapterParams", "type": "bytes" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "StorePayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }], + "name": "TrustedRemoteRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "LZ_ENDPOINT", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourCommandsSent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLastProposalSentTimestamp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToMaxDailyLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bool", "name": "useZro_", "type": "bool" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" } + ], + "name": "estimateFees", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to_", "type": "address" }, + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "fallbackWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "retryExecute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" }, + { "internalType": "bytes", "name": "config_", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "limit_", "type": "uint256" } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "version_", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "newRemoteAddress_", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "storedExecutionHashes", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-366/bsctestnet.ts b/simulations/vip-366/bsctestnet.ts new file mode 100644 index 000000000..a1f11cde2 --- /dev/null +++ b/simulations/vip-366/bsctestnet.ts @@ -0,0 +1,26 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; + +import vip365 from "../../vips/vip-365/bsctestnet"; +import vip366 from "../../vips/vip-366/bsctestnet"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +forking(43839242, async () => { + before(async () => { + await pretendExecutingVip(await vip365(), bsctestnet.NORMAL_TIMELOCK); + }); + + testVip("vip329 give permissions to critical & fasttrack timelock", await vip366(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); +}); diff --git a/simulations/vip-366/zksyncsepolia.ts b/simulations/vip-366/zksyncsepolia.ts new file mode 100644 index 000000000..3ebb050de --- /dev/null +++ b/simulations/vip-366/zksyncsepolia.ts @@ -0,0 +1,45 @@ +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { ethers } from "hardhat"; +import vip010 from "multisig/proposals/zksyncsepolia/vip-010"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip366 from "../../vips/vip-366/bsctestnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; + +forking(3771669, async () => { + const provider = ethers.provider; + let lastProposalReceived: BigNumber; + let executor: Contract; + + before(async () => { + executor = new ethers.Contract( + zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip010()); + }); + + testForkedNetworkVipCommands("vip366 configures bridge", await vip366(), { + callbackAfterExecution: async txResponse => { + await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [12]); + }, + }); + + describe("Post-VIP behaviour", async () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + }); +}); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index 16922e8f8..69643392f 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -167,7 +167,7 @@ export const NETWORK_ADDRESSES = { GUARDIAN: "0x5961449d63149035aCfC0714D5155f24C9819004", }, zksyncsepolia: { - NORMAL_TIMELOCK: "", // To be deployed + NORMAL_TIMELOCK: "0x1730527a0f0930269313D77A317361b42971a67E", GUARDIAN: "0xa2f83de95E9F28eD443132C331B6a9C9B7a9F866", GENERIC_TEST_USER_ACCOUNT: "0x6f057A858171e187124ddEDF034dAc63De5dE5dB", RESILIENT_ORACLE: "0x748853B3bE26c46b4562Fd314dfb82708F395bDf", @@ -176,6 +176,9 @@ export const NETWORK_ADDRESSES = { XVS_VAULT_PROXY: "0x825f9EE3b2b1C159a5444A111A70607f3918564e", POOL_REGISTRY: "0x1401404e6279BB8C06E5E3999eCA3e2008B46A76", VTREASURY: "0x943eBE4460a12F551D60A68f510Ea10CD8d564BA", + ENDPOINT: "0x99b6359ce8E0eBdC27eBeDb76FE28F29303E78fF", + LZ_LIBRARY: "0xC6d12200b743A8F7e6b7228B8E920A71d94FA7Fb", + OMNICHAIN_GOVERNANCE_EXECUTOR: "0x83F79CfbaEee738173c0dfd866796743F4E25C9e", }, zksyncmainnet: { NORMAL_TIMELOCK: "", // To be deployed diff --git a/src/types.ts b/src/types.ts index bcc60a571..5c39ced0e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -16,7 +16,8 @@ export type REMOTE_NETWORKS = | "opbnbtestnet" | "opbnbmainnet" | "arbitrumsepolia" - | "arbitrumone"; + | "arbitrumone" + | "zksyncsepolia"; export const REMOTE_TESTNET_NETWORKS = ["sepolia", "opbnbtestnet", "arbitrumsepolia", "zksyncsepolia"]; export const REMOTE_MAINNET_NETWORKS = ["ethereum", "opbnbmainnet", "arbitrumone", "zksyncmainnet"]; diff --git a/src/utils.ts b/src/utils.ts index 14cb60edc..54abb4fd2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -143,6 +143,14 @@ export async function mineBlocks(blocks: NumberLike = 1, options: { interval?: N params: [blocksHex, intervalHex], }); } +export const mineOnZksync = async (blocks: number) => { + const blockTimestamp = (await ethers.provider.getBlock("latest")).timestamp; + // Actual timestamp on which block will get mine (assuming 1 sec/block) + const timestampOfBlocks = blocks * 1; + const targetTimestamp = blockTimestamp + timestampOfBlocks; + await ethers.provider.send("evm_setNextBlockTimestamp", [targetTimestamp.toString(16)]); + await mineBlocks(); +}; const getAdapterParam = (noOfCommands: number): string => { const requiredGas = calculateGasForAdapterParam(noOfCommands); diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index ff4bc7343..858c233e6 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -16,6 +16,8 @@ import { getPayload, getSourceChainId, initMainnetUser, + mineBlocks, + mineOnZksync, setForkBlock, } from "../utils"; import ENDPOINT_ABI from "./abi/LzEndpoint.json"; @@ -242,17 +244,25 @@ export const testForkedNetworkVipCommands = (description: string, proposal: Prop inboundNonce.add(1), gasLimit, ethers.utils.defaultAbiCoder.encode(["bytes", "uint256"], [payload, proposalId]), - { gasLimit: gasLimit }, + { gasLimit: gasLimit, maxFeePerGas: 2 * 10 ** 8 }, ); await tx.wait(); expect(await executor.queued(proposalId)).to.be.true; }); it("should be executed successfully", async () => { - await mineUpTo((await ethers.provider.getBlockNumber()) + DELAY_BLOCKS[proposalType]); + if (FORKED_NETWORK == "zksyncsepolia" || FORKED_NETWORK == "zksyncmainnet") { + await mineOnZksync((await ethers.provider.getBlockNumber()) + DELAY_BLOCKS[proposalType]); + } else { + await mineUpTo((await ethers.provider.getBlockNumber()) + DELAY_BLOCKS[proposalType]); + } const blockchainProposal = await executor.proposals(proposalId); + await ethers.provider.send("evm_setNextBlockTimestamp", [blockchainProposal.eta.toString(16)]); + await mineBlocks(); + await time.increaseTo(blockchainProposal.eta.toNumber()); - const tx = await executor.execute(proposalId); + const tx = await executor.execute(proposalId, { maxFeePerGas: 200000000 }); + await tx.wait(); if (options.callbackAfterExecution) { await options.callbackAfterExecution(tx); diff --git a/vips/vip-365/bsctestnet.ts b/vips/vip-365/bsctestnet.ts new file mode 100644 index 000000000..09ec70cad --- /dev/null +++ b/vips/vip-365/bsctestnet.ts @@ -0,0 +1,173 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; +export const OMNICHAIN_PROPOSAL_SENDER = "0xCfD34AEB46b1CB4779c945854d405E91D27A1899"; + +export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; +export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; + +export const MAX_DAILY_LIMIT = 100; + +const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; + +const vip365 = () => { + const meta = { + version: "v2", + title: "VIP-365 Enable Multichain Governance on zksync sepolia (1/2)", + description: `### Summary + +`, + forDescription: "I agree that Venus Protocol should proceed with this proposal", + againstDescription: "I do not think that Venus Protocol should proceed with this proposal", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", + }; + return makeProposal( + [ + { + target: OMNICHAIN_PROPOSAL_SENDER, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ZKSYNCSEPOLIA_CHAIN_ID, MAX_DAILY_LIMIT], + }, + { + target: OMNICHAIN_PROPOSAL_SENDER, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ZKSYNCSEPOLIA_CHAIN_ID, zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], + }, + + { + target: ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + signature: "acceptOwnership()", + params: [], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSrcChainId(uint16)", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "transferBridgeOwnership(address)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSendVersion(uint16)", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setMaxDailyReceiveLimit(uint256)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setPrecrime(address)", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setMinDstGas(uint16,uint16,uint256)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setPayloadSizeLimit(uint16,uint256)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setConfig(uint16,uint16,uint256,bytes)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setTrustedRemoteAddress(uint16,bytes)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setTimelockPendingAdmin(address,uint8)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "retryMessage(uint16,bytes,uint64,bytes)", + zksyncsepolia.NORMAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setGuardian(address)", zksyncsepolia.NORMAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; +export default vip365; diff --git a/vips/vip-366/bsctestnet.ts b/vips/vip-366/bsctestnet.ts new file mode 100644 index 000000000..cc3c9b205 --- /dev/null +++ b/vips/vip-366/bsctestnet.ts @@ -0,0 +1,132 @@ +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; +const ZKSYNCSEPOLIA_CRITICAL_TIMELOCK = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; +export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; +export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; + +const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; + +const vip366 = () => { + const meta = { + version: "v2", + title: "VIP-366 Enable Multichain Governance on Zksync sepolia (2/2)", + description: `### Description + +Related with the VIP-366, if passed, this VIP will grant permission to Fast-track and Critical timelocks to execute privilege commands on the OmnichainProposalExecutor on Zksync sepolia. Review VIP-365 for more details. + +### References +`, + forDescription: "I agree that Venus Protocol should proceed with this proposal", + againstDescription: "I do not think that Venus Protocol should proceed with this proposal", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", + }; + return makeProposal( + [ + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setMaxDailyReceiveLimit(uint256)", + ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setMaxDailyReceiveLimit(uint256)", + ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setConfig(uint16,uint16,uint256,bytes)", + ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "setConfig(uint16,uint16,uint256,bytes)", + ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "retryMessage(uint16,bytes,uint64,bytes)", + ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + + { + target: ZKSYNCSEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, + "retryMessage(uint16,bytes,uint64,bytes)", + ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, + ], + dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; +export default vip366; From a5c31829a09ee6afc6bdb1bded95e778c960ad58 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Tue, 17 Sep 2024 18:40:53 +0530 Subject: [PATCH 2/4] refactor: network name and vip framework --- hardhat.config.zksync.ts | 6 ++-- .../zksyncsepolia/vip-010/index.ts | 4 +-- simulations/vip-365/zksyncsepolia.ts | 2 +- simulations/vip-366/zksyncsepolia.ts | 2 +- src/utils.ts | 8 ++--- src/vip-framework/index.ts | 35 +++++++++++++------ 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/hardhat.config.zksync.ts b/hardhat.config.zksync.ts index 7a02859e6..583458f71 100644 --- a/hardhat.config.zksync.ts +++ b/hardhat.config.zksync.ts @@ -40,7 +40,7 @@ task("test", "Update fork config") .setAction(async function (taskArguments, hre, runSuper) { const { fork } = taskArguments; - if (hre.network.name === "zkSyncTestNode") { + if (hre.network.name === "zksynctestnode") { if (!process.env["ZKSYNC_ERA_LOCAL_TEST_NODE"]) { throw new Error("ZKSYNC_ERA_LOCAL_TEST_NODE env variable is not set"); } @@ -61,7 +61,7 @@ task("test", "Update fork config") allowUnlimitedContractSize: false, loggingEnabled: false, forking: - hre.network.name === "zkSyncTestNode" + hre.network.name === "zksynctestnode" ? { enabled: false, url: process.env["ZKSYNC_ERA_LOCAL_TEST_NODE"] as string, @@ -137,7 +137,7 @@ const config: HardhatUserConfig = { blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.zksyncmainnet, zksync: true, }, - zkSyncTestNode: { + zksynctestnode: { url: process.env.ZKSYNC_ERA_LOCAL_TEST_NODE || "http://localhost:8011", chainId: 260, accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-010/index.ts index 7f0b96c1d..e91f8531b 100644 --- a/multisig/simulations/zksyncsepolia/vip-010/index.ts +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -4,7 +4,7 @@ import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip009, { +import vip010, { ZKSYNCSEPOLIA_ACM, ZKSYNCSEPOLIA_NORMAL_TIMELOCK, ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, @@ -46,7 +46,7 @@ forking(3771669, async () => { }); describe("Post-VIP behavior", async () => { before(async () => { - await pretendExecutingVip(await vip009()); + await pretendExecutingVip(await vip010()); }); it("Normal Timelock has default admin role", async () => { const hasRole = await acm.hasRole(defaultAdminRole, ZKSYNCSEPOLIA_NORMAL_TIMELOCK); diff --git a/simulations/vip-365/zksyncsepolia.ts b/simulations/vip-365/zksyncsepolia.ts index 5cd8838e4..e42cb42a5 100644 --- a/simulations/vip-365/zksyncsepolia.ts +++ b/simulations/vip-365/zksyncsepolia.ts @@ -54,7 +54,7 @@ forking(3771669, async () => { expect(await executor.proposalTimelocks(2)).equals(CRITICAL_TIMELOCK); // Check trusted remote - expect(await executor.trustedRemoteLookup(LzChainId.bscmainnet)).equals( + expect(await executor.trustedRemoteLookup(LzChainId.bsctestnet)).equals( ethers.utils.solidityPack( ["address", "address"], [getOmnichainProposalSenderAddress(), zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], diff --git a/simulations/vip-366/zksyncsepolia.ts b/simulations/vip-366/zksyncsepolia.ts index 3ebb050de..9237d82e8 100644 --- a/simulations/vip-366/zksyncsepolia.ts +++ b/simulations/vip-366/zksyncsepolia.ts @@ -1,11 +1,11 @@ import { expect } from "chai"; import { BigNumber, Contract } from "ethers"; import { ethers } from "hardhat"; -import vip010 from "multisig/proposals/zksyncsepolia/vip-010"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { expectEvents } from "src/utils"; import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; +import vip010 from "../../multisig/proposals/zksyncsepolia/vip-010"; import vip366 from "../../vips/vip-366/bsctestnet"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; diff --git a/src/utils.ts b/src/utils.ts index 54abb4fd2..db2452a53 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -48,8 +48,8 @@ export const getPayload = (proposal: Proposal) => { const gasUsedPerCommand = 300000; export async function setForkBlock(_blockNumber: number) { - if (network.name === "zkSyncTestNode") { - console.log("zkSyncTestNode network does not support forking, skipping fork"); + if (network.name === "zksynctestnode") { + console.log("zksynctestnode network does not support forking, skipping fork"); return; } @@ -97,8 +97,8 @@ export const initMainnetUser = async (user: string, balance: NumberLike) => { let signer = await ethers.getSigner(user); // zksync test node provider does not support default impersonation - if (network.name === "zkSyncTestNode") { - provider = new ethers.providers.JsonRpcProvider(config.networks.hardhat.forking?.url); + if (network.name === "zksynctestnode" && config.networks.hardhat.forking?.url) { + provider = new ethers.providers.JsonRpcProvider({ url: config.networks.hardhat.forking.url, timeout: 1200000 }); signer = provider.getSigner(user) as unknown as SignerWithAddress; } diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index 858c233e6..86c84caef 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -3,7 +3,7 @@ import { loadFixture, mine, mineUpTo, time } from "@nomicfoundation/hardhat-netw import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import cliProgress from "cli-progress"; -import { Contract, ContractInterface } from "ethers"; +import { BigNumber, Contract, ContractInterface } from "ethers"; import { FORKED_NETWORK, ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "../networkAddresses"; @@ -235,7 +235,16 @@ export const testForkedNetworkVipCommands = (description: string, proposal: Prop const srcChainId = getSourceChainId(FORKED_NETWORK as REMOTE_NETWORKS); const inboundNonce = await endpoint.connect(impersonatedLibrary).getInboundNonce(srcChainId, srcAddress); const gasLimit = calculateGasForAdapterParam(targets.length); - const tx = await endpoint + + const feeData = await ethers.provider.getFeeData(); + const txnParams: { maxFeePerGas?: BigNumber; gasLimit: number } = { gasLimit: gasLimit }; + + if (feeData.maxFeePerGas) { + // Sometimes the gas estimation is wrong with some networks like zksync + txnParams.maxFeePerGas = feeData.maxFeePerGas.mul(15).div(10); + } + + await endpoint .connect(impersonatedLibrary) .receivePayload( srcChainId, @@ -244,25 +253,31 @@ export const testForkedNetworkVipCommands = (description: string, proposal: Prop inboundNonce.add(1), gasLimit, ethers.utils.defaultAbiCoder.encode(["bytes", "uint256"], [payload, proposalId]), - { gasLimit: gasLimit, maxFeePerGas: 2 * 10 ** 8 }, + txnParams, ); - await tx.wait(); + expect(await executor.queued(proposalId)).to.be.true; }); it("should be executed successfully", async () => { if (FORKED_NETWORK == "zksyncsepolia" || FORKED_NETWORK == "zksyncmainnet") { - await mineOnZksync((await ethers.provider.getBlockNumber()) + DELAY_BLOCKS[proposalType]); + await mineOnZksync(DELAY_BLOCKS[proposalType]); } else { - await mineUpTo((await ethers.provider.getBlockNumber()) + DELAY_BLOCKS[proposalType]); + await mine(DELAY_BLOCKS[proposalType]); } const blockchainProposal = await executor.proposals(proposalId); - await ethers.provider.send("evm_setNextBlockTimestamp", [blockchainProposal.eta.toString(16)]); + await ethers.provider.send("evm_setNextBlockTimestamp", [blockchainProposal.eta.toHexString()]); await mineBlocks(); - await time.increaseTo(blockchainProposal.eta.toNumber()); - const tx = await executor.execute(proposalId, { maxFeePerGas: 200000000 }); - await tx.wait(); + const feeData = await ethers.provider.getFeeData(); + const txnParams: { maxFeePerGas?: BigNumber } = {}; + + if (feeData.maxFeePerGas) { + // Sometimes the gas estimation is wrong with some networks like zksync + txnParams.maxFeePerGas = feeData.maxFeePerGas.mul(15).div(10); + } + + const tx = await executor.execute(proposalId, txnParams); if (options.callbackAfterExecution) { await options.callbackAfterExecution(tx); From e3ef16e461b6a7b46ccd3834b3496a40e9c2dead Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:32:29 +0530 Subject: [PATCH 3/4] refactor: give permissions using ACMAggregator --- .../proposals/zksyncsepolia/vip-010/index.ts | 77 --- .../zksyncsepolia/vip-010/index.ts | 44 +- simulations/vip-365/bsctestnet.ts | 1 - simulations/vip-365/zksyncsepolia.ts | 13 +- .../vip-366/abi/AccessControlManager_ABI.json | 157 ----- .../abi/OmnichainGovernanceExecutor_ABI.json | 539 ------------------ .../vip-366/abi/OmnichainProposalSender.json | 314 ---------- simulations/vip-366/bsctestnet.ts | 26 - simulations/vip-366/zksyncsepolia.ts | 45 -- vips/vip-365/bsctestnet.ts | 135 +---- vips/vip-366/bsctestnet.ts | 132 ----- 11 files changed, 26 insertions(+), 1457 deletions(-) delete mode 100644 simulations/vip-366/abi/AccessControlManager_ABI.json delete mode 100644 simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json delete mode 100644 simulations/vip-366/abi/OmnichainProposalSender.json delete mode 100644 simulations/vip-366/bsctestnet.ts delete mode 100644 simulations/vip-366/zksyncsepolia.ts delete mode 100644 vips/vip-366/bsctestnet.ts diff --git a/multisig/proposals/zksyncsepolia/vip-010/index.ts b/multisig/proposals/zksyncsepolia/vip-010/index.ts index 1790c7435..f0fea6d62 100644 --- a/multisig/proposals/zksyncsepolia/vip-010/index.ts +++ b/multisig/proposals/zksyncsepolia/vip-010/index.ts @@ -1,88 +1,11 @@ -import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { makeProposal } from "src/utils"; -export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; export const ZKSYNCSEPOLIA_NORMAL_TIMELOCK = "0x1730527a0f0930269313D77A317361b42971a67E"; const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; -const { zksyncsepolia } = NETWORK_ADDRESSES; - export const vip010 = () => { return makeProposal([ - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setMaxDailyReceiveLimit(uint256)", zksyncsepolia.GUARDIAN], - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "unpause()", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setTrustedRemoteAddress(uint16,bytes)", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setTimelockPendingAdmin(address,uint8)", - zksyncsepolia.GUARDIAN, - ], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "retryMessage(uint16,bytes,uint64,bytes)", - zksyncsepolia.GUARDIAN, - ], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSrcChainId(uint16)", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", zksyncsepolia.GUARDIAN], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setConfig(uint16,uint16,uint256,bytes)", - zksyncsepolia.GUARDIAN, - ], - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "transferBridgeOwnership(address)", zksyncsepolia.GUARDIAN], - }, { target: ZKSYNCSEPOLIA_ACM, signature: "grantRole(bytes32,address)", diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-010/index.ts index e91f8531b..11d0dee9b 100644 --- a/multisig/simulations/zksyncsepolia/vip-010/index.ts +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -1,18 +1,11 @@ import { expect } from "chai"; import { Contract } from "ethers"; import { ethers } from "hardhat"; -import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip010, { - ZKSYNCSEPOLIA_ACM, - ZKSYNCSEPOLIA_NORMAL_TIMELOCK, - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, -} from "../../../proposals/zksyncsepolia/vip-010"; +import vip010, { ZKSYNCSEPOLIA_ACM, ZKSYNCSEPOLIA_NORMAL_TIMELOCK } from "../../../proposals/zksyncsepolia/vip-010"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManagerAbi.json"; -const { zksyncsepolia } = NETWORK_ADDRESSES; - forking(3771669, async () => { let acm: Contract; let defaultAdminRole: string; @@ -25,24 +18,6 @@ forking(3771669, async () => { const hasRole = await acm.hasRole(defaultAdminRole, ZKSYNCSEPOLIA_NORMAL_TIMELOCK); expect(hasRole).equals(false); }); - - it("Guardian is not allowed to call retryMessage", async () => { - const role = ethers.utils.solidityPack( - ["address", "string"], - [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "retryMessage(uint16,bytes,uint64,bytes)"], - ); - const roleHash = ethers.utils.keccak256(role); - expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.false; - }); - - it("Guardian is not allowed to call forceResumeReceive", async () => { - const role = ethers.utils.solidityPack( - ["address", "string"], - [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)"], - ); - const roleHash = ethers.utils.keccak256(role); - expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.false; - }); }); describe("Post-VIP behavior", async () => { before(async () => { @@ -52,22 +27,5 @@ forking(3771669, async () => { const hasRole = await acm.hasRole(defaultAdminRole, ZKSYNCSEPOLIA_NORMAL_TIMELOCK); expect(hasRole).equals(true); }); - it("Guardian is allowed to call retryMessage", async () => { - const role = ethers.utils.solidityPack( - ["address", "string"], - [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "retryMessage(uint16,bytes,uint64,bytes)"], - ); - const roleHash = ethers.utils.keccak256(role); - expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; - }); - - it("Guardian is allowed to call forceResumeReceive", async () => { - const role = ethers.utils.solidityPack( - ["address", "string"], - [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)"], - ); - const roleHash = ethers.utils.keccak256(role); - expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; - }); }); }); diff --git a/simulations/vip-365/bsctestnet.ts b/simulations/vip-365/bsctestnet.ts index 7f8e66523..6f80e4ae9 100644 --- a/simulations/vip-365/bsctestnet.ts +++ b/simulations/vip-365/bsctestnet.ts @@ -32,7 +32,6 @@ forking(43836268, async () => { await expectEvents( txResponse, [ACCESS_CONTROL_MANAGER_ABI, OMNICHAIN_PROPOSAL_SENDER_ABI], - ["SetMaxDailyLimit", "SetTrustedRemoteAddress", "ExecuteRemoteProposal", "StorePayload"], [1, 1, 1, 0], ); diff --git a/simulations/vip-365/zksyncsepolia.ts b/simulations/vip-365/zksyncsepolia.ts index e42cb42a5..df54c3d7b 100644 --- a/simulations/vip-365/zksyncsepolia.ts +++ b/simulations/vip-365/zksyncsepolia.ts @@ -7,7 +7,12 @@ import { expectEvents, getOmnichainProposalSenderAddress } from "src/utils"; import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; import vip010 from "../../multisig/proposals/zksyncsepolia/vip-010"; -import vip365, { ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER } from "../../vips/vip-365/bsctestnet"; +import vip365, { + DEFAULT_ADMIN_ROLE, + ZKSYNCSEPOLIA_ACM, + ZKSYNCSEPOLIA_ACM_AGGREGATOR, + ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, +} from "../../vips/vip-365/bsctestnet"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; import OMNICHAIN_EXECUTOR_OWNER_ABI from "./abi/OmnichainExecutorOwner_ABI.json"; import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; @@ -16,7 +21,7 @@ const { zksyncsepolia } = NETWORK_ADDRESSES; const FAST_TRACK_TIMELOCK = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; const CRITICAL_TIMELOCK = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; -forking(3771669, async () => { +forking(3880136, async () => { const provider = ethers.provider; let lastProposalReceived: BigNumber; let executor: Contract; @@ -93,5 +98,9 @@ forking(3771669, async () => { expect(await executorOwner.functionRegistry(selector)).equals(signature); } }); + it("Default admin role must be revoked from ACMAggregator contract on ZKsync sepolia", async () => { + const acm = new ethers.Contract(ZKSYNCSEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + expect(await acm.hasRole(DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR)).to.be.false; + }); }); }); diff --git a/simulations/vip-366/abi/AccessControlManager_ABI.json b/simulations/vip-366/abi/AccessControlManager_ABI.json deleted file mode 100644 index 2ef119947..000000000 --- a/simulations/vip-366/abi/AccessControlManager_ABI.json +++ /dev/null @@ -1,157 +0,0 @@ -[ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, - { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } - ], - "name": "PermissionGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, - { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } - ], - "name": "PermissionRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], - "name": "getRoleAdmin", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "contractAddress", "type": "address" }, - { "internalType": "string", "name": "functionSig", "type": "string" }, - { "internalType": "address", "name": "accountToPermit", "type": "address" } - ], - "name": "giveCallPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "address", "name": "contractAddress", "type": "address" }, - { "internalType": "string", "name": "functionSig", "type": "string" } - ], - "name": "hasPermission", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "hasRole", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "string", "name": "functionSig", "type": "string" } - ], - "name": "isAllowedToCall", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "contractAddress", "type": "address" }, - { "internalType": "string", "name": "functionSig", "type": "string" }, - { "internalType": "address", "name": "accountToRevoke", "type": "address" } - ], - "name": "revokeCallPermission", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json b/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json deleted file mode 100644 index b40c3cf44..000000000 --- a/simulations/vip-366/abi/OmnichainGovernanceExecutor_ABI.json +++ /dev/null @@ -1,539 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "endpoint_", "type": "address" }, - { "internalType": "address", "name": "guardian_", "type": "address" }, - { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "InvalidProposalId", "type": "error" }, - { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, - { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, - { "indexed": false, "internalType": "bytes", "name": "_payload", "type": "bytes" }, - { "indexed": false, "internalType": "bytes", "name": "_reason", "type": "bytes" } - ], - "name": "MessageFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "oldGuardian", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newGuardian", "type": "address" } - ], - "name": "NewGuardian", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], - "name": "ProposalCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], - "name": "ProposalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "eta", "type": "uint256" } - ], - "name": "ProposalQueued", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, - { "indexed": false, "internalType": "address[]", "name": "targets", "type": "address[]" }, - { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" }, - { "indexed": false, "internalType": "string[]", "name": "signatures", "type": "string[]" }, - { "indexed": false, "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, - { "indexed": false, "internalType": "uint8", "name": "proposalType", "type": "uint8" } - ], - "name": "ProposalReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint16", "name": "srcChainId", "type": "uint16" }, - { "indexed": true, "internalType": "bytes", "name": "srcAddress", "type": "bytes" }, - { "indexed": false, "internalType": "uint64", "name": "nonce", "type": "uint64" }, - { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } - ], - "name": "ReceivePayloadFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, - { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, - { "indexed": false, "internalType": "bytes32", "name": "_payloadHash", "type": "bytes32" } - ], - "name": "RetryMessageSuccess", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } - ], - "name": "SetMaxDailyReceiveLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, - { "indexed": false, "internalType": "uint16", "name": "_type", "type": "uint16" }, - { "indexed": false, "internalType": "uint256", "name": "_minDstGas", "type": "uint256" } - ], - "name": "SetMinDstGas", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "precrime", "type": "address" }], - "name": "SetPrecrime", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint16", "name": "oldSrcChainId", "type": "uint16" }, - { "indexed": true, "internalType": "uint16", "name": "newSrcChainId", "type": "uint16" } - ], - "name": "SetSrcChainId", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "", "type": "address" }, - { "indexed": false, "internalType": "uint8", "name": "", "type": "uint8" } - ], - "name": "SetTimelockPendingAdmin", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "_path", "type": "bytes" } - ], - "name": "SetTrustedRemote", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } - ], - "name": "SetTrustedRemoteAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint8", "name": "routeType", "type": "uint8" }, - { "indexed": true, "internalType": "address", "name": "oldTimelock", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newTimelock", "type": "address" } - ], - "name": "TimelockAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_PAYLOAD_SIZE_LIMIT", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract ITimelock[]", "name": "timelocks_", "type": "address[]" }], - "name": "addTimelocks", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], - "name": "cancel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], - "name": "execute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "", "type": "uint16" }, - { "internalType": "bytes", "name": "", "type": "bytes" }, - { "internalType": "uint64", "name": "", "type": "uint64" } - ], - "name": "failedMessages", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } - ], - "name": "forceResumeReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_version", "type": "uint16" }, - { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "_configType", "type": "uint256" } - ], - "name": "getConfig", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }], - "name": "getTrustedRemoteAddress", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "guardian", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } - ], - "name": "isTrustedRemote", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "last24HourCommandsReceived", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "last24HourReceiveWindowStart", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastProposalReceived", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lzEndpoint", - "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, - { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, - { "internalType": "bytes", "name": "_payload", "type": "bytes" } - ], - "name": "lzReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "maxDailyReceiveLimit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "", "type": "uint16" }, - { "internalType": "uint16", "name": "", "type": "uint16" } - ], - "name": "minDstGasLookup", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, - { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, - { "internalType": "bytes", "name": "_payload", "type": "bytes" } - ], - "name": "nonblockingLzReceive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "payloadSizeLimitLookup", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "precrime", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "proposalTimelocks", - "outputs": [{ "internalType": "contract ITimelock", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "proposals", - "outputs": [ - { "internalType": "uint256", "name": "id", "type": "uint256" }, - { "internalType": "uint256", "name": "eta", "type": "uint256" }, - { "internalType": "bool", "name": "canceled", "type": "bool" }, - { "internalType": "bool", "name": "executed", "type": "bool" }, - { "internalType": "uint8", "name": "proposalType", "type": "uint8" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "queued", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "srcAddress_", "type": "bytes" }, - { "internalType": "uint64", "name": "nonce_", "type": "uint64" }, - { "internalType": "bytes", "name": "payload_", "type": "bytes" } - ], - "name": "retryMessage", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_version", "type": "uint16" }, - { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, - { "internalType": "uint256", "name": "_configType", "type": "uint256" }, - { "internalType": "bytes", "name": "_config", "type": "bytes" } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newGuardian", "type": "address" }], - "name": "setGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "limit_", "type": "uint256" }], - "name": "setMaxDailyReceiveLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, - { "internalType": "uint16", "name": "_packetType", "type": "uint16" }, - { "internalType": "uint256", "name": "_minGas", "type": "uint256" } - ], - "name": "setMinDstGas", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, - { "internalType": "uint256", "name": "_size", "type": "uint256" } - ], - "name": "setPayloadSizeLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_precrime", "type": "address" }], - "name": "setPrecrime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], - "name": "setReceiveVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], - "name": "setSendVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }], - "name": "setSrcChainId", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "pendingAdmin_", "type": "address" }, - { "internalType": "uint8", "name": "proposalType_", "type": "uint8" } - ], - "name": "setTimelockPendingAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_path", "type": "bytes" } - ], - "name": "setTrustedRemote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, - { "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } - ], - "name": "setTrustedRemoteAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "srcChainId", - "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], - "name": "state", - "outputs": [{ "internalType": "enum OmnichainGovernanceExecutor.ProposalState", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "trustedRemoteLookup", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } -] diff --git a/simulations/vip-366/abi/OmnichainProposalSender.json b/simulations/vip-366/abi/OmnichainProposalSender.json deleted file mode 100644 index 66fd4df02..000000000 --- a/simulations/vip-366/abi/OmnichainProposalSender.json +++ /dev/null @@ -1,314 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "contract ILayerZeroEndpoint", "name": "lzEndpoint_", "type": "address" }, - { "internalType": "address", "name": "accessControlManager_", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, - { "indexed": false, "internalType": "bytes32", "name": "executionHash", "type": "bytes32" } - ], - "name": "ClearPayload", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, - { "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, - { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" } - ], - "name": "ExecuteRemoteProposal", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "FallbackWithdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newAccessControlManager", "type": "address" } - ], - "name": "NewAccessControlManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }, - { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } - ], - "name": "SetMaxDailyLimit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "oldRemoteAddress", "type": "bytes" }, - { "indexed": false, "internalType": "bytes", "name": "newRemoteAddress", "type": "bytes" } - ], - "name": "SetTrustedRemoteAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, - { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, - { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" }, - { "indexed": false, "internalType": "bytes", "name": "adapterParams", "type": "bytes" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, - { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } - ], - "name": "StorePayload", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }], - "name": "TrustedRemoteRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "LZ_ENDPOINT", - "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "accessControlManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "chainIdToLast24HourCommandsSent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "chainIdToLast24HourWindowStart", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "chainIdToLastProposalSentTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "chainIdToMaxDailyLimit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "payload_", "type": "bytes" }, - { "internalType": "bool", "name": "useZro_", "type": "bool" }, - { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" } - ], - "name": "estimateFees", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "payload_", "type": "bytes" }, - { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, - { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" } - ], - "name": "execute", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to_", "type": "address" }, - { "internalType": "uint256", "name": "pId_", "type": "uint256" }, - { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "payload_", "type": "bytes" }, - { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, - { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } - ], - "name": "fallbackWithdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "version_", "type": "uint16" }, - { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, - { "internalType": "uint256", "name": "configType_", "type": "uint256" } - ], - "name": "getConfig", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proposalCount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }], - "name": "removeTrustedRemote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "pId_", "type": "uint256" }, - { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "payload_", "type": "bytes" }, - { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, - { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" }, - { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } - ], - "name": "retryExecute", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], - "name": "setAccessControlManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "version_", "type": "uint16" }, - { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, - { "internalType": "uint256", "name": "configType_", "type": "uint256" }, - { "internalType": "bytes", "name": "config_", "type": "bytes" } - ], - "name": "setConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, - { "internalType": "uint256", "name": "limit_", "type": "uint256" } - ], - "name": "setMaxDailyLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "version_", "type": "uint16" }], - "name": "setSendVersion", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, - { "internalType": "bytes", "name": "newRemoteAddress_", "type": "bytes" } - ], - "name": "setTrustedRemoteAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "storedExecutionHashes", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], - "name": "trustedRemoteLookup", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } -] diff --git a/simulations/vip-366/bsctestnet.ts b/simulations/vip-366/bsctestnet.ts deleted file mode 100644 index a1f11cde2..000000000 --- a/simulations/vip-366/bsctestnet.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { expectEvents } from "src/utils"; -import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; - -import vip365 from "../../vips/vip-365/bsctestnet"; -import vip366 from "../../vips/vip-366/bsctestnet"; -import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; - -const { bsctestnet } = NETWORK_ADDRESSES; - -forking(43839242, async () => { - before(async () => { - await pretendExecutingVip(await vip365(), bsctestnet.NORMAL_TIMELOCK); - }); - - testVip("vip329 give permissions to critical & fasttrack timelock", await vip366(), { - callbackAfterExecution: async txResponse => { - await expectEvents( - txResponse, - [OMNICHAIN_PROPOSAL_SENDER_ABI], - ["ExecuteRemoteProposal", "StorePayload"], - [1, 0], - ); - }, - }); -}); diff --git a/simulations/vip-366/zksyncsepolia.ts b/simulations/vip-366/zksyncsepolia.ts deleted file mode 100644 index 9237d82e8..000000000 --- a/simulations/vip-366/zksyncsepolia.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { expect } from "chai"; -import { BigNumber, Contract } from "ethers"; -import { ethers } from "hardhat"; -import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { expectEvents } from "src/utils"; -import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; - -import vip010 from "../../multisig/proposals/zksyncsepolia/vip-010"; -import vip366 from "../../vips/vip-366/bsctestnet"; -import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; -import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; - -const { zksyncsepolia } = NETWORK_ADDRESSES; - -forking(3771669, async () => { - const provider = ethers.provider; - let lastProposalReceived: BigNumber; - let executor: Contract; - - before(async () => { - executor = new ethers.Contract( - zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, - OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, - provider, - ); - lastProposalReceived = await executor.lastProposalReceived(); - await pretendExecutingVip(await vip010()); - }); - - testForkedNetworkVipCommands("vip366 configures bridge", await vip366(), { - callbackAfterExecution: async txResponse => { - await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [12]); - }, - }); - - describe("Post-VIP behaviour", async () => { - it("Proposal id should be incremented", async () => { - expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); - }); - it("proposal should be executed", async () => { - const pId = await executor.lastProposalReceived(); - expect(await executor.state(pId)).to.be.equals(2); - }); - }); -}); diff --git a/vips/vip-365/bsctestnet.ts b/vips/vip-365/bsctestnet.ts index 09ec70cad..fc1beb6e5 100644 --- a/vips/vip-365/bsctestnet.ts +++ b/vips/vip-365/bsctestnet.ts @@ -7,7 +7,8 @@ export const OMNICHAIN_PROPOSAL_SENDER = "0xCfD34AEB46b1CB4779c945854d405E91D27A export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; - +export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; +export const ZKSYNCSEPOLIA_ACM_AGGREGATOR = "0x920Bb18c4bd4D7bc41Bf39933BCAa3D078641502"; export const MAX_DAILY_LIMIT = 100; const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; @@ -15,10 +16,8 @@ const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; const vip365 = () => { const meta = { version: "v2", - title: "VIP-365 Enable Multichain Governance on zksync sepolia (1/2)", - description: `### Summary - -`, + title: "VIP-365 Enable Multichain Governance on zksync sepolia", + description: `### Summary`, forDescription: "I agree that Venus Protocol should proceed with this proposal", againstDescription: "I do not think that Venus Protocol should proceed with this proposal", abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", @@ -35,7 +34,6 @@ const vip365 = () => { signature: "setTrustedRemoteAddress(uint16,bytes)", params: [ZKSYNCSEPOLIA_CHAIN_ID, zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], }, - { target: ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, signature: "acceptOwnership()", @@ -44,126 +42,21 @@ const vip365 = () => { }, { target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSrcChainId(uint16)", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "transferBridgeOwnership(address)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSendVersion(uint16)", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setMaxDailyReceiveLimit(uint256)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setPrecrime(address)", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setMinDstGas(uint16,uint16,uint256)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setPayloadSizeLimit(uint16,uint256)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setConfig(uint16,uint16,uint256,bytes)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setTrustedRemoteAddress(uint16,bytes)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.zksyncsepolia, }, { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setTimelockPendingAdmin(address,uint8)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + target: ZKSYNCSEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [0], + dstChainId: LzChainId.zksyncsepolia, }, { target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "retryMessage(uint16,bytes,uint64,bytes)", - zksyncsepolia.NORMAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setGuardian(address)", zksyncsepolia.NORMAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.zksyncsepolia, }, ], meta, diff --git a/vips/vip-366/bsctestnet.ts b/vips/vip-366/bsctestnet.ts deleted file mode 100644 index cc3c9b205..000000000 --- a/vips/vip-366/bsctestnet.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { LzChainId, ProposalType } from "src/types"; -import { makeProposal } from "src/utils"; - -const ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; -const ZKSYNCSEPOLIA_CRITICAL_TIMELOCK = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; -export const ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER = "0xa34607D58146FA02aF5f920f29C3D916acAb0bC5"; -export const ZKSYNCSEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; - -const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; - -const vip366 = () => { - const meta = { - version: "v2", - title: "VIP-366 Enable Multichain Governance on Zksync sepolia (2/2)", - description: `### Description - -Related with the VIP-366, if passed, this VIP will grant permission to Fast-track and Critical timelocks to execute privilege commands on the OmnichainProposalExecutor on Zksync sepolia. Review VIP-365 for more details. - -### References -`, - forDescription: "I agree that Venus Protocol should proceed with this proposal", - againstDescription: "I do not think that Venus Protocol should proceed with this proposal", - abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", - }; - return makeProposal( - [ - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setReceiveVersion(uint16)", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setMaxDailyReceiveLimit(uint256)", - ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setMaxDailyReceiveLimit(uint256)", - ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "pause()", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setConfig(uint16,uint16,uint256,bytes)", - ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "setConfig(uint16,uint16,uint256,bytes)", - ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "addTimelocks(address[])", ZKSYNCSEPOLIA_CRITICAL_TIMELOCK], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "retryMessage(uint16,bytes,uint64,bytes)", - ZKSYNCSEPOLIA_FASTTRACK_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - - { - target: ZKSYNCSEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ - ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, - "retryMessage(uint16,bytes,uint64,bytes)", - ZKSYNCSEPOLIA_CRITICAL_TIMELOCK, - ], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, - }, - ], - meta, - ProposalType.REGULAR, - ); -}; -export default vip366; From 736933fb79db6ad8143ac181c88a9873286eadb2 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:47:26 +0530 Subject: [PATCH 4/4] feat: add more test in simulation --- simulations/vip-365/abi/ACMAggregator.json | 242 +++++++++++++++++++++ simulations/vip-365/zksyncsepolia.ts | 53 ++++- vips/vip-365/bsctestnet.ts | 8 +- 3 files changed, 294 insertions(+), 9 deletions(-) create mode 100644 simulations/vip-365/abi/ACMAggregator.json diff --git a/simulations/vip-365/abi/ACMAggregator.json b/simulations/vip-365/abi/ACMAggregator.json new file mode 100644 index 000000000..6650a3f3c --- /dev/null +++ b/simulations/vip-365/abi/ACMAggregator.json @@ -0,0 +1,242 @@ +[ + { + "inputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "_acm", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyPermissions", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "GrantPermissionsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "GrantPermissionsExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "RevokePermissionsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "RevokePermissionsExecuted", + "type": "event" + }, + { + "inputs": [], + "name": "ACM", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "functionSig", + "type": "string" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "internalType": "struct ACMCommandsAggregator.Permission[]", + "name": "_permissions", + "type": "tuple[]" + } + ], + "name": "addGrantPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "functionSig", + "type": "string" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "internalType": "struct ACMCommandsAggregator.Permission[]", + "name": "_permissions", + "type": "tuple[]" + } + ], + "name": "addRevokePermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "executeGrantPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "executeRevokePermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "grantPermissions", + "outputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "functionSig", + "type": "string" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "revokePermissions", + "outputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "string", + "name": "functionSig", + "type": "string" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-365/zksyncsepolia.ts b/simulations/vip-365/zksyncsepolia.ts index df54c3d7b..48b354c40 100644 --- a/simulations/vip-365/zksyncsepolia.ts +++ b/simulations/vip-365/zksyncsepolia.ts @@ -13,6 +13,7 @@ import vip365, { ZKSYNCSEPOLIA_ACM_AGGREGATOR, ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, } from "../../vips/vip-365/bsctestnet"; +import ACMAggregator_ABI from "./abi/ACMAggregator.json"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager_ABI.json"; import OMNICHAIN_EXECUTOR_OWNER_ABI from "./abi/OmnichainExecutorOwner_ABI.json"; import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor_ABI.json"; @@ -21,7 +22,7 @@ const { zksyncsepolia } = NETWORK_ADDRESSES; const FAST_TRACK_TIMELOCK = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; const CRITICAL_TIMELOCK = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; -forking(3880136, async () => { +forking(3884819, async () => { const provider = ethers.provider; let lastProposalReceived: BigNumber; let executor: Contract; @@ -38,13 +39,24 @@ forking(3880136, async () => { await pretendExecutingVip(await vip010()); }); + describe("Pre-VIP behaviour", async () => { + it("Normal Timelock has default admin role on ZKsync sepolia", async () => { + const acm = await ethers.getContractAt(ACCESS_CONTROL_MANAGER_ABI, ZKSYNCSEPOLIA_ACM); + const hasRole = await acm.hasRole(DEFAULT_ADMIN_ROLE, zksyncsepolia.NORMAL_TIMELOCK); + expect(hasRole).equals(true); + }); + }); + testForkedNetworkVipCommands("vip365 configures bridge", await vip365(), { callbackAfterExecution: async txResponse => { - await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [15]); + await expectEvents(txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], [39]); + await expectEvents(txResponse, [ACMAggregator_ABI], ["GrantPermissionsExecuted"], [1]); }, }); describe("Post-VIP behaviour", async () => { + const acm = new ethers.Contract(ZKSYNCSEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + it("Proposal id should be incremented", async () => { expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); }); @@ -68,7 +80,7 @@ forking(3880136, async () => { // Check receiving limit expect(await executor.maxDailyReceiveLimit()).equals(100); - expect(await executor.last24HourCommandsReceived()).equals(16); + expect(await executor.last24HourCommandsReceived()).equals(4); // Check function registry const functionSignatures: string[] = [ @@ -99,8 +111,41 @@ forking(3880136, async () => { } }); it("Default admin role must be revoked from ACMAggregator contract on ZKsync sepolia", async () => { - const acm = new ethers.Contract(ZKSYNCSEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); expect(await acm.hasRole(DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR)).to.be.false; }); + it("Guardian and all timelocks are allowed to call retryMessage ", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "retryMessage(uint16,bytes,uint64,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; + expect(await acm.hasRole(roleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(roleHash, FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(roleHash, CRITICAL_TIMELOCK)).to.be.true; + }); + + it("Guardian is allowed to call forceResumeReceive but not timelocks", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "forceResumeReceive(uint16,bytes)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.true; + expect(await acm.hasRole(roleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.false; + expect(await acm.hasRole(roleHash, FAST_TRACK_TIMELOCK)).to.be.false; + expect(await acm.hasRole(roleHash, CRITICAL_TIMELOCK)).to.be.false; + }); + it("Normal Timelock is allowed to call setSendVersion but not other timelocks and guardian", async () => { + const role = ethers.utils.solidityPack( + ["address", "string"], + [ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, "setSendVersion(uint16)"], + ); + const roleHash = ethers.utils.keccak256(role); + expect(await acm.hasRole(roleHash, zksyncsepolia.GUARDIAN)).to.be.false; + expect(await acm.hasRole(roleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(roleHash, FAST_TRACK_TIMELOCK)).to.be.false; + expect(await acm.hasRole(roleHash, CRITICAL_TIMELOCK)).to.be.false; + }); }); }); diff --git a/vips/vip-365/bsctestnet.ts b/vips/vip-365/bsctestnet.ts index fc1beb6e5..f13e10157 100644 --- a/vips/vip-365/bsctestnet.ts +++ b/vips/vip-365/bsctestnet.ts @@ -11,8 +11,6 @@ export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000 export const ZKSYNCSEPOLIA_ACM_AGGREGATOR = "0x920Bb18c4bd4D7bc41Bf39933BCAa3D078641502"; export const MAX_DAILY_LIMIT = 100; -const ZKSYNCSEPOLIA_CHAIN_ID = LzChainId.zksyncsepolia; - const vip365 = () => { const meta = { version: "v2", @@ -27,18 +25,18 @@ const vip365 = () => { { target: OMNICHAIN_PROPOSAL_SENDER, signature: "setMaxDailyLimit(uint16,uint256)", - params: [ZKSYNCSEPOLIA_CHAIN_ID, MAX_DAILY_LIMIT], + params: [LzChainId.zksyncsepolia, MAX_DAILY_LIMIT], }, { target: OMNICHAIN_PROPOSAL_SENDER, signature: "setTrustedRemoteAddress(uint16,bytes)", - params: [ZKSYNCSEPOLIA_CHAIN_ID, zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], + params: [LzChainId.zksyncsepolia, zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR], }, { target: ZKSYNCSEPOLIA_OMNICHAIN_EXECUTOR_OWNER, signature: "acceptOwnership()", params: [], - dstChainId: ZKSYNCSEPOLIA_CHAIN_ID, + dstChainId: LzChainId.zksyncsepolia, }, { target: ZKSYNCSEPOLIA_ACM,