From 014a08d951118c956c8504c6899534d417a31751 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 2 Sep 2024 17:20:37 +0530 Subject: [PATCH 01/24] feat: add VIP for XVS bridge on opsepolia --- multisig/proposals/opsepolia/vip-002/index.ts | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 multisig/proposals/opsepolia/vip-002/index.ts diff --git a/multisig/proposals/opsepolia/vip-002/index.ts b/multisig/proposals/opsepolia/vip-002/index.ts new file mode 100644 index 000000000..e28950ec0 --- /dev/null +++ b/multisig/proposals/opsepolia/vip-002/index.ts @@ -0,0 +1,271 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +const { opsepolia } = NETWORK_ADDRESSES; + +const ACM = "0x1652E12C8ABE2f0D84466F0fc1fA4286491B3BC1"; + +export const XVS_BRIDGE_ADMIN_PROXY = "0x6bBcB95eCF9BEc9AE91d5Ad227783e3913145321"; +export const XVS = "0x789482e37218f9b26d8D9115E356462fA9A37116"; +export const XVS_BRIDGE_DEST = "0x79a36dc9a43D05Db4747c59c02F48ed500e47dF1"; + +export const BNB_TESTNET_ENDPOINT_ID = 10102; +export const SEPOLIA_ENDPOINT_ID = 10161; +export const OPBNB_TESTNET_ENDPOINT_ID = 10202; +export const ARBITRUM_SEPOLIA_ENDPOINT_ID = 10231; + +export const OPBNB_TESTNET_TRUSTED_REMOTE = "0xa03205bc635a772e533e7be36b5701e331a70ea3"; +export const SEPOLIA_TRUSTED_REMOTE = "0xc340b7d3406502f43dc11a988e4ec5bbe536e642"; +export const BNB_TESTNET_TRUSTED_REMOTE = "0x0e132cd94fd70298b747d2b4d977db8d086e5fd0"; +export const ARBITRUM_SEPOLIA_TRUSTED_REMOTE = "0xfdc5cec63fd167da46cf006585b30d03b104efd4"; + +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); + +export const XVS_MINT_LIMIT = parseUnits("500000", 18); + +const vip002 = () => { + return makeProposal([ + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setSendVersion(uint16)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setReceiveVersion(uint16)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "forceResumeReceive(uint16,bytes)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setOracle(address)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleTransactionLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ + XVS_BRIDGE_ADMIN_PROXY, + "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + opsepolia.NORMAL_TIMELOCK, + ], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyReceiveLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "pause()", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "unpause()", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "removeTrustedRemote(uint16)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "dropFailedMessage(uint16,bytes,uint64)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setPrecrime(address)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMinDstGas(uint16,uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setPayloadSizeLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setWhitelist(address,bool)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setConfig(uint16,uint16,uint256,bytes)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "sweepToken(address,address,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "updateSendAndCallEnabled(bool)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "mint(address,uint256)", XVS_BRIDGE_DEST], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "burn(address,uint256)", XVS_BRIDGE_DEST], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setTrustedRemoteAddress(uint16,bytes)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "transferBridgeOwnership(address)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "migrateMinterTokens(address,address)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "setMintCap(address,uint256)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "updateBlacklist(address,bool)", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "pause()", opsepolia.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "unpause()", opsepolia.NORMAL_TIMELOCK], + }, + { target: XVS_BRIDGE_ADMIN_PROXY, signature: "acceptOwnership()", params: [] }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [BNB_TESTNET_ENDPOINT_ID, BNB_TESTNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [BNB_TESTNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [BNB_TESTNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [OPBNB_TESTNET_ENDPOINT_ID, OPBNB_TESTNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [OPBNB_TESTNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [OPBNB_TESTNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [SEPOLIA_ENDPOINT_ID, SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [SEPOLIA_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, ARBITRUM_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setWhitelist(address,bool)", + params: [opsepolia.VTREASURY, true], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setWhitelist(address,bool)", + params: [opsepolia.NORMAL_TIMELOCK, true], + }, + { + target: XVS, + signature: "setMintCap(address,uint256)", + params: [XVS_BRIDGE_DEST, XVS_MINT_LIMIT], + }, + ]); +}; + +export default vip002; From 8b1fd6d062d614baf2a75bd8c56e42a5e58a0708 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 2 Sep 2024 17:20:56 +0530 Subject: [PATCH 02/24] feat: simulations for XVS bridge on opsepolia --- .../opsepolia/vip-002/abi/xvs.json | 716 +++++++ .../opsepolia/vip-002/abi/xvsBridgeAdmin.json | 329 ++++ .../vip-002/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/opsepolia/vip-002/index.ts | 200 ++ src/networkAddresses.ts | 5 + 5 files changed, 2979 insertions(+) create mode 100644 multisig/simulations/opsepolia/vip-002/abi/xvs.json create mode 100644 multisig/simulations/opsepolia/vip-002/abi/xvsBridgeAdmin.json create mode 100644 multisig/simulations/opsepolia/vip-002/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/opsepolia/vip-002/index.ts diff --git a/multisig/simulations/opsepolia/vip-002/abi/xvs.json b/multisig/simulations/opsepolia/vip-002/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/opsepolia/vip-002/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opsepolia/vip-002/abi/xvsBridgeAdmin.json b/multisig/simulations/opsepolia/vip-002/abi/xvsBridgeAdmin.json new file mode 100644 index 000000000..024450a40 --- /dev/null +++ b/multisig/simulations/opsepolia/vip-002/abi/xvsBridgeAdmin.json @@ -0,0 +1,329 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "XVSBridge_", + "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": false, + "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": "XVSBridge", + "outputs": [ + { + "internalType": "contract IXVSProxyOFT", + "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": [ + { + "internalType": "uint16", + "name": "remoteChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "remoteAddress_", + "type": "bytes" + } + ], + "name": "isTrustedRemote", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "remoteChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "remoteAddress_", + "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/multisig/simulations/opsepolia/vip-002/abi/xvsProxyOFTDest.json b/multisig/simulations/opsepolia/vip-002/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/opsepolia/vip-002/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/opsepolia/vip-002/index.ts b/multisig/simulations/opsepolia/vip-002/index.ts new file mode 100644 index 000000000..58a953dfb --- /dev/null +++ b/multisig/simulations/opsepolia/vip-002/index.ts @@ -0,0 +1,200 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseEther } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip002, { + ARBITRUM_SEPOLIA_ENDPOINT_ID, + ARBITRUM_SEPOLIA_TRUSTED_REMOTE, + BNB_TESTNET_ENDPOINT_ID, + BNB_TESTNET_TRUSTED_REMOTE, + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + MIN_DST_GAS, + OPBNB_TESTNET_ENDPOINT_ID, + OPBNB_TESTNET_TRUSTED_REMOTE, + SEPOLIA_ENDPOINT_ID, + SEPOLIA_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, + XVS, + XVS_BRIDGE_ADMIN_PROXY, + XVS_BRIDGE_DEST, + XVS_MINT_LIMIT, +} from "../../../proposals/opsepolia/vip-002"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ADMIN_ABI from "./abi/xvsBridgeAdmin.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const { opsepolia } = NETWORK_ADDRESSES; +const REGULAR_USER = "0xd7b572EeE55B6C4725469ef6Df5ceaa77374E641"; + +forking(16643257, async () => { + let xvs: Contract; + let xvsBridgeAdmin: Contract; + let xvsBridge: Contract; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridgeAdmin = await ethers.getContractAt(XVS_BRIDGE_ADMIN_ABI, XVS_BRIDGE_ADMIN_PROXY); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE_DEST); + }); + + describe("Pre-Execution state", () => { + it("Bridge Owner != opsepolia multisig", async () => { + const owner = await xvsBridgeAdmin.owner(); + expect(owner).not.equal(opsepolia.NORMAL_TIMELOCK); + }); + + it("Trusted remote should not exist for any network(bsctestnet, opbnbtestnet, sepolia)", async () => { + await expect(xvsBridge.getTrustedRemoteAddress(BNB_TESTNET_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(OPBNB_TESTNET_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(SEPOLIA_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + + await expect(xvsBridge.getTrustedRemoteAddress(ARBITRUM_SEPOLIA_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + }); + + it("Mint limit = 0", async () => { + const cap = await xvs.minterToCap(XVS_BRIDGE_DEST); + expect(cap).equals(0); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip002()); + }); + + it("Should set bridge owner to multisig", async () => { + const owner = await xvsBridgeAdmin.owner(); + expect(owner).equals(opsepolia.NORMAL_TIMELOCK); + }); + + it("Should whitelist MULTISIG and TREASURY", async () => { + let res = await xvsBridge.whitelist(opsepolia.NORMAL_TIMELOCK); + expect(res).equals(true); + + res = await xvsBridge.whitelist(opsepolia.VTREASURY); + expect(res).equals(true); + }); + + it("Should set trusted remote address in bridge for all three networks", async () => { + let trustedRemote = await xvsBridge.getTrustedRemoteAddress(BNB_TESTNET_ENDPOINT_ID); + expect(trustedRemote).equals(BNB_TESTNET_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(OPBNB_TESTNET_ENDPOINT_ID); + expect(trustedRemote).equals(OPBNB_TESTNET_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(SEPOLIA_ENDPOINT_ID); + expect(trustedRemote).equals(SEPOLIA_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(ARBITRUM_SEPOLIA_ENDPOINT_ID); + expect(trustedRemote).equals(ARBITRUM_SEPOLIA_TRUSTED_REMOTE); + }); + + it("Should set minting limit in XVS token", async () => { + const cap = await xvs.minterToCap(XVS_BRIDGE_DEST); + expect(cap).equals(XVS_MINT_LIMIT); + }); + + it("Should set correct token address in bridge", async () => { + const token = await xvsBridge.token(); + expect(token).equals(XVS); + }); + + it("Should set correct max daily limit for all three networks", async () => { + let limit = await xvsBridge.chainIdToMaxDailyLimit(BNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(OPBNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + }); + + it("Should set correct max single limit for all three networks", async () => { + let limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(BNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(OPBNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + }); + + it("Should set correct max daily receive limit for all three networks", async () => { + let limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(BNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(OPBNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should set correct max single receive limit for all three networks", async () => { + let limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(BNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(OPBNB_TESTNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + }); + + it("Should set correct min destination gas", async () => { + let limit = await xvsBridge.minDstGasLookup(BNB_TESTNET_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DST_GAS); + + limit = await xvsBridge.minDstGasLookup(OPBNB_TESTNET_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DST_GAS); + + limit = await xvsBridge.minDstGasLookup(SEPOLIA_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DST_GAS); + + limit = await xvsBridge.minDstGasLookup(ARBITRUM_SEPOLIA_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DST_GAS); + }); + }); + + describe("Post-Execution extra checks", () => { + it(`should fail if someone else tries to mint XVS`, async () => { + const regularUser = await initMainnetUser(REGULAR_USER, parseEther("1")); + + await expect(xvs.connect(regularUser).mint(REGULAR_USER, 1)).to.be.revertedWithCustomError(xvs, "Unauthorized"); + }); + + it(`should fail if someone else tries to burn XVS`, async () => { + const regularUser = await initMainnetUser(REGULAR_USER, parseEther("1")); + + await expect(xvs.connect(regularUser).burn(REGULAR_USER, 1)).to.be.revertedWithCustomError(xvs, "Unauthorized"); + }); + }); +}); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index aefcb4742..3a360c956 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -178,4 +178,9 @@ export const NETWORK_ADDRESSES = { RESILIENT_ORACLE: "0xDe564a4C887d5ad315a19a96DC81991c98b12182", CHAINLINK_ORACLE: "0x4FC29E1d3fFFbDfbf822F09d20A5BE97e59F66E5", }, + opsepolia: { + VTREASURY: "0x5A1a12F47FA7007C9e23cf5e025F3f5d3aC7d755", + NORMAL_TIMELOCK: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", // opsepolia Multisig + GUARDIAN: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", + }, }; From 92affb118187668ca32d39c1ff7afd0e1229a6f3 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 4 Sep 2024 18:33:11 +0530 Subject: [PATCH 03/24] refactor: add xvs bridge support for zysync on opsepoilia --- multisig/proposals/opsepolia/vip-002/index.ts | 32 +++++++++++++++++ .../simulations/opsepolia/vip-002/index.ts | 34 ++++++++++++++++--- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/multisig/proposals/opsepolia/vip-002/index.ts b/multisig/proposals/opsepolia/vip-002/index.ts index e28950ec0..ffca3caf3 100644 --- a/multisig/proposals/opsepolia/vip-002/index.ts +++ b/multisig/proposals/opsepolia/vip-002/index.ts @@ -14,11 +14,13 @@ export const BNB_TESTNET_ENDPOINT_ID = 10102; export const SEPOLIA_ENDPOINT_ID = 10161; export const OPBNB_TESTNET_ENDPOINT_ID = 10202; export const ARBITRUM_SEPOLIA_ENDPOINT_ID = 10231; +export const ZKSYNC_SEPOLIA_ENDPOINT_ID = 10248; export const OPBNB_TESTNET_TRUSTED_REMOTE = "0xa03205bc635a772e533e7be36b5701e331a70ea3"; export const SEPOLIA_TRUSTED_REMOTE = "0xc340b7d3406502f43dc11a988e4ec5bbe536e642"; export const BNB_TESTNET_TRUSTED_REMOTE = "0x0e132cd94fd70298b747d2b4d977db8d086e5fd0"; export const ARBITRUM_SEPOLIA_TRUSTED_REMOTE = "0xfdc5cec63fd167da46cf006585b30d03b104efd4"; +export const ZKSYNC_SEPOLIA_TRUSTED_REMOTE = "0x760461ccb2508caaa2ece0c28af3a4707b853043"; export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); @@ -250,6 +252,36 @@ const vip002 = () => { signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, ZKSYNC_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [ZKSYNC_SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setWhitelist(address,bool)", diff --git a/multisig/simulations/opsepolia/vip-002/index.ts b/multisig/simulations/opsepolia/vip-002/index.ts index 58a953dfb..5eb0d28e2 100644 --- a/multisig/simulations/opsepolia/vip-002/index.ts +++ b/multisig/simulations/opsepolia/vip-002/index.ts @@ -24,6 +24,8 @@ import vip002, { XVS_BRIDGE_ADMIN_PROXY, XVS_BRIDGE_DEST, XVS_MINT_LIMIT, + ZKSYNC_SEPOLIA_ENDPOINT_ID, + ZKSYNC_SEPOLIA_TRUSTED_REMOTE, } from "../../../proposals/opsepolia/vip-002"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ADMIN_ABI from "./abi/xvsBridgeAdmin.json"; @@ -63,6 +65,10 @@ forking(16643257, async () => { await expect(xvsBridge.getTrustedRemoteAddress(ARBITRUM_SEPOLIA_ENDPOINT_ID)).to.be.revertedWith( "LzApp: no trusted path record", ); + + await expect(xvsBridge.getTrustedRemoteAddress(ZKSYNC_SEPOLIA_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); }); it("Mint limit = 0", async () => { @@ -89,7 +95,7 @@ forking(16643257, async () => { expect(res).equals(true); }); - it("Should set trusted remote address in bridge for all three networks", async () => { + it("Should set trusted remote address in bridge for all five networks", async () => { let trustedRemote = await xvsBridge.getTrustedRemoteAddress(BNB_TESTNET_ENDPOINT_ID); expect(trustedRemote).equals(BNB_TESTNET_TRUSTED_REMOTE); @@ -101,6 +107,9 @@ forking(16643257, async () => { trustedRemote = await xvsBridge.getTrustedRemoteAddress(ARBITRUM_SEPOLIA_ENDPOINT_ID); expect(trustedRemote).equals(ARBITRUM_SEPOLIA_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(ZKSYNC_SEPOLIA_ENDPOINT_ID); + expect(trustedRemote).equals(ZKSYNC_SEPOLIA_TRUSTED_REMOTE); }); it("Should set minting limit in XVS token", async () => { @@ -113,7 +122,7 @@ forking(16643257, async () => { expect(token).equals(XVS); }); - it("Should set correct max daily limit for all three networks", async () => { + it("Should set correct max daily limit for all five networks", async () => { let limit = await xvsBridge.chainIdToMaxDailyLimit(BNB_TESTNET_ENDPOINT_ID); expect(limit).equals(MAX_DAILY_SEND_LIMIT); @@ -125,9 +134,12 @@ forking(16643257, async () => { limit = await xvsBridge.chainIdToMaxDailyLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(ZKSYNC_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); }); - it("Should set correct max single limit for all three networks", async () => { + it("Should set correct max single limit for all five networks", async () => { let limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(BNB_TESTNET_ENDPOINT_ID); expect(limit).equals(SINGLE_SEND_LIMIT); @@ -139,9 +151,12 @@ forking(16643257, async () => { limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ZKSYNC_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); }); - it("Should set correct max daily receive limit for all three networks", async () => { + it("Should set correct max daily receive limit for all five networks", async () => { let limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(BNB_TESTNET_ENDPOINT_ID); expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); @@ -153,9 +168,12 @@ forking(16643257, async () => { limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ZKSYNC_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); }); - it("Should set correct max single receive limit for all three networks", async () => { + it("Should set correct max single receive limit for all five networks", async () => { let limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(BNB_TESTNET_ENDPOINT_ID); expect(limit).equals(SINGLE_RECEIVE_LIMIT); @@ -167,6 +185,9 @@ forking(16643257, async () => { limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ARBITRUM_SEPOLIA_ENDPOINT_ID); expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ZKSYNC_SEPOLIA_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); }); it("Should set correct min destination gas", async () => { @@ -181,6 +202,9 @@ forking(16643257, async () => { limit = await xvsBridge.minDstGasLookup(ARBITRUM_SEPOLIA_ENDPOINT_ID, 0); expect(limit).equals(MIN_DST_GAS); + + limit = await xvsBridge.minDstGasLookup(ZKSYNC_SEPOLIA_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DST_GAS); }); }); From 8a144ff308eb2a83393043ca965a180418f91bda Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 11 Sep 2024 19:31:38 +0530 Subject: [PATCH 04/24] fix: pr comments --- multisig/proposals/opsepolia/vip-002/index.ts | 113 +++++------------- .../simulations/opsepolia/vip-002/index.ts | 6 +- src/networkAddresses.ts | 2 +- 3 files changed, 31 insertions(+), 90 deletions(-) diff --git a/multisig/proposals/opsepolia/vip-002/index.ts b/multisig/proposals/opsepolia/vip-002/index.ts index ffca3caf3..52e30f1a7 100644 --- a/multisig/proposals/opsepolia/vip-002/index.ts +++ b/multisig/proposals/opsepolia/vip-002/index.ts @@ -35,101 +35,97 @@ const vip002 = () => { { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setSendVersion(uint16)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setSendVersion(uint16)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setReceiveVersion(uint16)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setReceiveVersion(uint16)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "forceResumeReceive(uint16,bytes)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "forceResumeReceive(uint16,bytes)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setOracle(address)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setOracle(address)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleTransactionLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleTransactionLimit(uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyLimit(uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [ - XVS_BRIDGE_ADMIN_PROXY, - "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - opsepolia.NORMAL_TIMELOCK, - ], + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleReceiveTransactionLimit(uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyReceiveLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyReceiveLimit(uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "pause()", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "pause()", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "unpause()", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "unpause()", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "removeTrustedRemote(uint16)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "removeTrustedRemote(uint16)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "dropFailedMessage(uint16,bytes,uint64)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "dropFailedMessage(uint16,bytes,uint64)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setPrecrime(address)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setPrecrime(address)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setMinDstGas(uint16,uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setMinDstGas(uint16,uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setPayloadSizeLimit(uint16,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setPayloadSizeLimit(uint16,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setWhitelist(address,bool)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setWhitelist(address,bool)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setConfig(uint16,uint16,uint256,bytes)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setConfig(uint16,uint16,uint256,bytes)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "sweepToken(address,address,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "sweepToken(address,address,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "updateSendAndCallEnabled(bool)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "updateSendAndCallEnabled(bool)", opsepolia.GUARDIAN], }, { target: ACM, @@ -144,37 +140,37 @@ const vip002 = () => { { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "setTrustedRemoteAddress(uint16,bytes)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "setTrustedRemoteAddress(uint16,bytes)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS_BRIDGE_ADMIN_PROXY, "transferBridgeOwnership(address)", opsepolia.NORMAL_TIMELOCK], + params: [XVS_BRIDGE_ADMIN_PROXY, "transferBridgeOwnership(address)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS, "migrateMinterTokens(address,address)", opsepolia.NORMAL_TIMELOCK], + params: [XVS, "migrateMinterTokens(address,address)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS, "setMintCap(address,uint256)", opsepolia.NORMAL_TIMELOCK], + params: [XVS, "setMintCap(address,uint256)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS, "updateBlacklist(address,bool)", opsepolia.NORMAL_TIMELOCK], + params: [XVS, "updateBlacklist(address,bool)", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS, "pause()", opsepolia.NORMAL_TIMELOCK], + params: [XVS, "pause()", opsepolia.GUARDIAN], }, { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [XVS, "unpause()", opsepolia.NORMAL_TIMELOCK], + params: [XVS, "unpause()", opsepolia.GUARDIAN], }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "acceptOwnership()", params: [] }, { @@ -182,76 +178,21 @@ const vip002 = () => { signature: "setTrustedRemoteAddress(uint16,bytes)", params: [BNB_TESTNET_ENDPOINT_ID, BNB_TESTNET_TRUSTED_REMOTE], }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [BNB_TESTNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [BNB_TESTNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], - }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [OPBNB_TESTNET_ENDPOINT_ID, OPBNB_TESTNET_TRUSTED_REMOTE], }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [OPBNB_TESTNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [OPBNB_TESTNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], - }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [SEPOLIA_ENDPOINT_ID, SEPOLIA_TRUSTED_REMOTE], }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [SEPOLIA_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], - }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, ARBITRUM_SEPOLIA_TRUSTED_REMOTE], }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMinDstGas(uint16,uint16,uint256)", - params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, 0, MIN_DST_GAS], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxDailyLimit(uint16,uint256)", - params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxSingleTransactionLimit(uint16,uint256)", - params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, SINGLE_SEND_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN_PROXY, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [ARBITRUM_SEPOLIA_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], - }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", @@ -290,7 +231,7 @@ const vip002 = () => { { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setWhitelist(address,bool)", - params: [opsepolia.NORMAL_TIMELOCK, true], + params: [opsepolia.GUARDIAN, true], }, { target: XVS, diff --git a/multisig/simulations/opsepolia/vip-002/index.ts b/multisig/simulations/opsepolia/vip-002/index.ts index 5eb0d28e2..a9442508d 100644 --- a/multisig/simulations/opsepolia/vip-002/index.ts +++ b/multisig/simulations/opsepolia/vip-002/index.ts @@ -48,7 +48,7 @@ forking(16643257, async () => { describe("Pre-Execution state", () => { it("Bridge Owner != opsepolia multisig", async () => { const owner = await xvsBridgeAdmin.owner(); - expect(owner).not.equal(opsepolia.NORMAL_TIMELOCK); + expect(owner).not.equal(opsepolia.GUARDIAN); }); it("Trusted remote should not exist for any network(bsctestnet, opbnbtestnet, sepolia)", async () => { @@ -84,11 +84,11 @@ forking(16643257, async () => { it("Should set bridge owner to multisig", async () => { const owner = await xvsBridgeAdmin.owner(); - expect(owner).equals(opsepolia.NORMAL_TIMELOCK); + expect(owner).equals(opsepolia.GUARDIAN); }); it("Should whitelist MULTISIG and TREASURY", async () => { - let res = await xvsBridge.whitelist(opsepolia.NORMAL_TIMELOCK); + let res = await xvsBridge.whitelist(opsepolia.GUARDIAN); expect(res).equals(true); res = await xvsBridge.whitelist(opsepolia.VTREASURY); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index 4a79c7047..479e7dbd3 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -180,8 +180,8 @@ export const NETWORK_ADDRESSES = { CHAINLINK_ORACLE: "0x4FC29E1d3fFFbDfbf822F09d20A5BE97e59F66E5", }, opsepolia: { + NORMAL_TIMELOCK: "", // To be deployed VTREASURY: "0x5A1a12F47FA7007C9e23cf5e025F3f5d3aC7d755", - NORMAL_TIMELOCK: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", // opsepolia Multisig GUARDIAN: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", }, }; From df99dc24efd6ff8861e7e433e6c64bc8898c51aa Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 12 Sep 2024 23:41:46 +0530 Subject: [PATCH 05/24] feat: add opsepolia trusted remote to arbitrum sepolia xvs bridge --- .../arbitrumsepolia/vip-014/index.ts | 49 + .../arbitrumsepolia/vip-014/abi/xvs.json | 683 +++++++ .../vip-014/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../arbitrumsepolia/vip-014/index.ts | 109 ++ src/types.ts | 1 + 5 files changed, 2571 insertions(+) create mode 100644 multisig/proposals/arbitrumsepolia/vip-014/index.ts create mode 100644 multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json create mode 100644 multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/arbitrumsepolia/vip-014/index.ts diff --git a/multisig/proposals/arbitrumsepolia/vip-014/index.ts b/multisig/proposals/arbitrumsepolia/vip-014/index.ts new file mode 100644 index 000000000..43560a24f --- /dev/null +++ b/multisig/proposals/arbitrumsepolia/vip-014/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0xc94578caCC89a29B044a0a1D54d20d48A645E5C8"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip014 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opsepolia, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opsepolia, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip014; diff --git a/multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json b/multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json new file mode 100644 index 000000000..8a2713887 --- /dev/null +++ b/multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json @@ -0,0 +1,683 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "MintNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "_blacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json b/multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/arbitrumsepolia/vip-014/index.ts b/multisig/simulations/arbitrumsepolia/vip-014/index.ts new file mode 100644 index 000000000..3dd9c55c3 --- /dev/null +++ b/multisig/simulations/arbitrumsepolia/vip-014/index.ts @@ -0,0 +1,109 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip014, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_SEPOLIA_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/arbitrumsepolia/vip-014"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0x877Dc896e7b13096D3827872e396927BbE704407"; +const XVS_BRIDGE = "0xFdC5cEC63FD167DA46cF006585b30D03B104eFD4"; +const XVS_HOLDER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(79930177, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip014()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opsepolia); + expect(trustedRemote).equals(OP_SEPOLIA_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opsepolia)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opsepolia)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Arbitrum sepolia -> Op Sepolia)", async () => { + const amount = parseUnits("1", 18); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opsepolia, XVS_HOLDER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); diff --git a/src/types.ts b/src/types.ts index 2d5ce03c7..7643e07ab 100644 --- a/src/types.ts +++ b/src/types.ts @@ -69,4 +69,5 @@ export enum LzChainId { arbitrumone = 110, zksyncsepolia = 10248, zksyncmainnet = 165, + opsepolia = 10232, } From 2f60c48e0e066b8308c32f91053cfcdc655a6a54 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 12 Sep 2024 23:49:04 +0530 Subject: [PATCH 06/24] feat: add opsepolia trusted remote to opbnb testnet xvs bridge --- .../proposals/opbnbtestnet/vip-021/index.ts | 49 + .../opbnbtestnet/vip-021/abi/xvs.json | 683 +++++++ .../vip-021/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/opbnbtestnet/vip-021/index.ts | 109 ++ 4 files changed, 2570 insertions(+) create mode 100644 multisig/proposals/opbnbtestnet/vip-021/index.ts create mode 100644 multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json create mode 100644 multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/opbnbtestnet/vip-021/index.ts diff --git a/multisig/proposals/opbnbtestnet/vip-021/index.ts b/multisig/proposals/opbnbtestnet/vip-021/index.ts new file mode 100644 index 000000000..fd2cb7c22 --- /dev/null +++ b/multisig/proposals/opbnbtestnet/vip-021/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x19252AFD0B2F539C400aEab7d460CBFbf74c17ff"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip021 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opsepolia, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opsepolia, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip021; diff --git a/multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json b/multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json new file mode 100644 index 000000000..8a2713887 --- /dev/null +++ b/multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json @@ -0,0 +1,683 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "MintNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "_blacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json b/multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/opbnbtestnet/vip-021/index.ts b/multisig/simulations/opbnbtestnet/vip-021/index.ts new file mode 100644 index 000000000..723fa0a40 --- /dev/null +++ b/multisig/simulations/opbnbtestnet/vip-021/index.ts @@ -0,0 +1,109 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip021, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_SEPOLIA_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/opbnbtestnet/vip-021"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0xc2931B1fEa69b6D6dA65a50363A8D75d285e4da9"; +const XVS_BRIDGE = "0xA03205bC635A772E533E7BE36b5701E331a70ea3"; +const XVS_HOLDER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(39286132, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip021()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opsepolia); + expect(trustedRemote).equals(OP_SEPOLIA_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opsepolia)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opsepolia)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Opbnb testnet -> Op Sepolia)", async () => { + const amount = parseUnits("1", 18); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opsepolia, XVS_HOLDER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From 0b3f8cb01770c5a830ada378e8582bd18f6be1e2 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 13 Sep 2024 00:40:39 +0530 Subject: [PATCH 07/24] feat: add opsepolia trusted remote to sepolia xvs bridge --- multisig/proposals/sepolia/vip-060/index.ts | 49 + .../simulations/sepolia/vip-060/abi/xvs.json | 683 +++++++ .../sepolia/vip-060/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ multisig/simulations/sepolia/vip-060/index.ts | 109 ++ 4 files changed, 2570 insertions(+) create mode 100644 multisig/proposals/sepolia/vip-060/index.ts create mode 100644 multisig/simulations/sepolia/vip-060/abi/xvs.json create mode 100644 multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/sepolia/vip-060/index.ts diff --git a/multisig/proposals/sepolia/vip-060/index.ts b/multisig/proposals/sepolia/vip-060/index.ts new file mode 100644 index 000000000..ae4ed4cce --- /dev/null +++ b/multisig/proposals/sepolia/vip-060/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0xd3c6bdeeadB2359F726aD4cF42EAa8B7102DAd9B"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip060 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opsepolia, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opsepolia, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip060; diff --git a/multisig/simulations/sepolia/vip-060/abi/xvs.json b/multisig/simulations/sepolia/vip-060/abi/xvs.json new file mode 100644 index 000000000..8a2713887 --- /dev/null +++ b/multisig/simulations/sepolia/vip-060/abi/xvs.json @@ -0,0 +1,683 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "MintNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "_blacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json b/multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/sepolia/vip-060/index.ts b/multisig/simulations/sepolia/vip-060/index.ts new file mode 100644 index 000000000..66ecc3eb4 --- /dev/null +++ b/multisig/simulations/sepolia/vip-060/index.ts @@ -0,0 +1,109 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip060, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_SEPOLIA_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/sepolia/vip-060"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0x66ebd019E86e0af5f228a0439EBB33f045CBe63E"; +const XVS_BRIDGE = "0xc340b7d3406502F43dC11a988E4EC5bbE536E642"; +const XVS_HOLDER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(6679071, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip060()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opsepolia); + expect(trustedRemote).equals(OP_SEPOLIA_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opsepolia)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opsepolia)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (sepolia -> Op Sepolia)", async () => { + const amount = parseUnits("1", 18); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opsepolia, XVS_HOLDER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From 4b7ddef86511e31850d05b260630f027f27e6070 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 13 Sep 2024 00:41:12 +0530 Subject: [PATCH 08/24] feat: add opsepolia trusted remote to zksyncsepolia xvs bridge --- .../proposals/zksyncsepolia/vip-010/index.ts | 49 + .../zksyncsepolia/vip-010/abi/xvs.json | 683 +++++++ .../vip-010/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../zksyncsepolia/vip-010/index.ts | 109 ++ 4 files changed, 2570 insertions(+) create mode 100644 multisig/proposals/zksyncsepolia/vip-010/index.ts create mode 100644 multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json create mode 100644 multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/zksyncsepolia/vip-010/index.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..b12398b0b --- /dev/null +++ b/multisig/proposals/zksyncsepolia/vip-010/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x28cfE3f2D7D8944FAd162a058260ec922C19065E"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip010 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opsepolia, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opsepolia, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip010; diff --git a/multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json b/multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json new file mode 100644 index 000000000..8a2713887 --- /dev/null +++ b/multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json @@ -0,0 +1,683 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "MintNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "_blacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json b/multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "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..3c1a65b3f --- /dev/null +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -0,0 +1,109 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip010, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_SEPOLIA_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/zksyncsepolia/vip-010"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0x3AeCac43A2ebe5D8184e650403bf9F656F9D1cfA"; +const XVS_BRIDGE = "0x760461ccB2508CAAa2ECe0c28af3a4707b853043"; +const XVS_HOLDER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(3768148, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip010()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opsepolia); + expect(trustedRemote).equals(OP_SEPOLIA_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opsepolia)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opsepolia)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (sepolia -> Op Sepolia)", async () => { + const amount = parseUnits("1", 18); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opsepolia, XVS_HOLDER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From 6f96e92c5f8b9f38f35f5d259bc913f215b88f91 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 16 Sep 2024 12:58:46 +0530 Subject: [PATCH 09/24] feat: add vip for bsctestnet to support xvs bridge for opsepolia --- simulations/vip-364/abi/XVS.json | 295 ++++ simulations/vip-364/abi/XVSBridgeAdmin.json | 287 ++++ simulations/vip-364/abi/XVSProxyOFTSrc.json | 1616 +++++++++++++++++++ simulations/vip-364/bsctestnet.ts | 170 ++ vips/vip-364/bsctestnet.ts | 63 + 5 files changed, 2431 insertions(+) create mode 100644 simulations/vip-364/abi/XVS.json create mode 100644 simulations/vip-364/abi/XVSBridgeAdmin.json create mode 100644 simulations/vip-364/abi/XVSProxyOFTSrc.json create mode 100644 simulations/vip-364/bsctestnet.ts create mode 100644 vips/vip-364/bsctestnet.ts diff --git a/simulations/vip-364/abi/XVS.json b/simulations/vip-364/abi/XVS.json new file mode 100644 index 000000000..b0ef0e012 --- /dev/null +++ b/simulations/vip-364/abi/XVS.json @@ -0,0 +1,295 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "delegator", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "fromDelegate", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "toDelegate", "type": "address" } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "previousBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newBalance", "type": "uint256" } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "Freezed", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "_from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "_to", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "UnFreezed", "type": "event" }, + { + "constant": true, + "inputs": [], + "name": "DELEGATION_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "rawAmount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint32", "name": "", "type": "uint32" } + ], + "name": "checkpoints", + "outputs": [ + { "internalType": "uint32", "name": "fromBlock", "type": "uint32" }, + { "internalType": "uint96", "name": "votes", "type": "uint96" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "delegatee", "type": "address" }], + "name": "delegate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "nonce", "type": "uint256" }, + { "internalType": "uint256", "name": "expiry", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "delegateBySig", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "delegates", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "freeze", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getCurrentVotes", + "outputs": [{ "internalType": "uint96", "name": "", "type": "uint96" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "uint256", "name": "blockNumber", "type": "uint256" } + ], + "name": "getPriorVotes", + "outputs": [{ "internalType": "uint96", "name": "", "type": "uint96" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "numCheckpoints", + "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "rawAmount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "rawAmount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "unfreeze", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-364/abi/XVSBridgeAdmin.json b/simulations/vip-364/abi/XVSBridgeAdmin.json new file mode 100644 index 000000000..36158eeba --- /dev/null +++ b/simulations/vip-364/abi/XVSBridgeAdmin.json @@ -0,0 +1,287 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "XVSBridge_", + "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": false, + "internalType": "string", + "name": "signature", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isRemoved", + "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": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "XVSBridge", + "outputs": [ + { + "internalType": "contract IXVSProxyOFT", + "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": "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": "remove_", + "type": "bool[]" + } + ], + "name": "upsertSignature", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-364/abi/XVSProxyOFTSrc.json b/simulations/vip-364/abi/XVSProxyOFTSrc.json new file mode 100644 index 000000000..e88302d59 --- /dev/null +++ b/simulations/vip-364/abi/XVSProxyOFTSrc.json @@ -0,0 +1,1616 @@ +[ + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "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": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": [], + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-364/bsctestnet.ts b/simulations/vip-364/bsctestnet.ts new file mode 100644 index 000000000..b38220c46 --- /dev/null +++ b/simulations/vip-364/bsctestnet.ts @@ -0,0 +1,170 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId } from "src/types"; +import { expectEvents, initMainnetUser } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip364, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + MIN_DST_GAS, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../vips/vip-364/bsctestnet"; +import XVS_ABI from "./abi/XVS.json"; +import XVS_BRIDGE_ADMIN_ABI from "./abi/XVSBridgeAdmin.json"; +import XVS_BRIDGE_SRC_ABI from "./abi/XVSProxyOFTSrc.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +const XVSProxyOFTSrc = "0x0E132cd94fd70298b747d2b4D977db8d086e5fD0"; +const XVS_HOLDER = "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706"; + +forking(43916700, async () => { + const provider = ethers.provider; + let bridge: Contract; + let xvs: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + beforeEach(async () => { + bridge = new ethers.Contract(XVSProxyOFTSrc, XVS_BRIDGE_SRC_ABI, provider); + xvs = new ethers.Contract(bsctestnet.XVS, XVS_ABI, provider); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + testVip("vip-364 testnet", await vip364(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents( + txResponse, + [XVS_BRIDGE_ADMIN_ABI, XVS_BRIDGE_SRC_ABI], + [ + "SetMinDstGas", + "SetMaxSingleTransactionLimit", + "SetMaxDailyLimit", + "SetMaxSingleReceiveTransactionLimit", + "SetMaxDailyReceiveLimit", + "SetTrustedRemoteAddress", + "Failure", + ], + [1, 1, 1, 1, 1, 1, 0], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Should match minDestGas value", async () => { + expect(await bridge.minDstGasLookup(LzChainId.opsepolia, 0)).to.equal(MIN_DST_GAS); + }); + + it("Should match single send transaction limit", async () => { + expect(await bridge.chainIdToMaxSingleTransactionLimit(LzChainId.opsepolia)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await bridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opsepolia)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await bridge.chainIdToMaxDailyLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await bridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successfull bridging of XVS", async () => { + const amount = parseUnits("0.5", 18); + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opsepolia, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + + await xvs.connect(xvsHolderSigner).approve(bridge.address, amount); + const bridgeBalPrev = await xvs.balanceOf(XVSProxyOFTSrc); + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(bridge, "SendToChain") + .withArgs(LzChainId.opsepolia, XVS_HOLDER, receiverAddressBytes32, amount); + const bridgeBalAfter = await xvs.balanceOf(XVSProxyOFTSrc); + + expect(bridgeBalAfter.sub(bridgeBalPrev)).to.equal(amount); + }); + + it("Reverts if single transaction limit exceed", async function () { + const amount = ethers.utils.parseUnits("10000", 18); + await xvs.connect(xvsHolderSigner).approve(bridge.address, amount); + + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opsepolia, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ).to.be.revertedWith("Single Transaction Limit Exceed"); + }); + + it("Reverts if max daily transaction limit exceed", async function () { + const maxPlusAmount = ethers.utils.parseUnits("50000", 18); + const amount = parseUnits("1700", 18); + await xvs.connect(xvsHolderSigner).approve(bridge.address, maxPlusAmount); + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opsepolia, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + + for (let i = 0; i < 5; i++) { + await bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ); + } + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opsepolia, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ).to.be.revertedWith("Daily Transaction Limit Exceed"); + }); + }); +}); diff --git a/vips/vip-364/bsctestnet.ts b/vips/vip-364/bsctestnet.ts new file mode 100644 index 000000000..bb1ad2625 --- /dev/null +++ b/vips/vip-364/bsctestnet.ts @@ -0,0 +1,63 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { LzChainId, ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const XVS_BRIDGE_ADMIN = "0xB164Cb262328Ca44a806bA9e3d4094931E658513"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("10000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("50000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip364 = () => { + const meta = { + version: "v2", + title: "VIP-364 Enable BSC -> OP sepolia bridge", + description: `#### Summary Enable BSC -> ZKSYNC bridge`, + 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: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opsepolia, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opsepolia, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opsepolia, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opsepolia, SINGLE_RECEIVE_LIMIT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip364; From 538fc0d6c57e2a3503bb0db57e7716b7ea7921b3 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 16 Sep 2024 13:55:10 +0530 Subject: [PATCH 10/24] fix: amount of XVS for daily tx limit exceed --- simulations/vip-364/bsctestnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulations/vip-364/bsctestnet.ts b/simulations/vip-364/bsctestnet.ts index b38220c46..e3c22437f 100644 --- a/simulations/vip-364/bsctestnet.ts +++ b/simulations/vip-364/bsctestnet.ts @@ -135,7 +135,7 @@ forking(43916700, async () => { it("Reverts if max daily transaction limit exceed", async function () { const maxPlusAmount = ethers.utils.parseUnits("50000", 18); - const amount = parseUnits("1700", 18); + const amount = parseUnits("1420", 18); await xvs.connect(xvsHolderSigner).approve(bridge.address, maxPlusAmount); const nativeFee = ( await bridge.estimateSendFee(LzChainId.opsepolia, receiverAddressBytes32, amount, false, defaultAdapterParams) From 135d19b2552bdb47549e211b850175e972109193 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 07:56:55 +0530 Subject: [PATCH 11/24] feat: vip for xvs-bridge on op mainnet --- multisig/proposals/opmainnet/vip-001/index.ts | 218 +++ .../opmainnet/vip-001/abi/xvs.json | 716 +++++++ .../opmainnet/vip-001/abi/xvsBridgeAdmin.json | 329 ++++ .../vip-001/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/opmainnet/vip-001/index.ts | 224 +++ src/multisig/utils.ts | 12 + src/networkAddresses.ts | 9 + 7 files changed, 3237 insertions(+) create mode 100644 multisig/proposals/opmainnet/vip-001/index.ts create mode 100644 multisig/simulations/opmainnet/vip-001/abi/xvs.json create mode 100644 multisig/simulations/opmainnet/vip-001/abi/xvsBridgeAdmin.json create mode 100644 multisig/simulations/opmainnet/vip-001/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/opmainnet/vip-001/index.ts diff --git a/multisig/proposals/opmainnet/vip-001/index.ts b/multisig/proposals/opmainnet/vip-001/index.ts new file mode 100644 index 000000000..2cd9814cf --- /dev/null +++ b/multisig/proposals/opmainnet/vip-001/index.ts @@ -0,0 +1,218 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +const { opmainnet } = NETWORK_ADDRESSES; + +const ACM = "0xD71b1F33f6B0259683f11174EE4Ddc2bb9cE4eD6"; + +export const XVS_BRIDGE_ADMIN_PROXY = "0x3c307DF1Bf3198a2417d9CA86806B307D147Ddf7"; +export const XVS = "0x4a971e87ad1F61f7f3081645f52a99277AE917cF"; +export const XVS_BRIDGE_DEST = "0xbBe46bAec851355c3FC4856914c47eB6Cea0B8B4"; + +export const BNB_MAINNET_ENDPOINT_ID = 102; +export const ETHEREUM_ENDPOINT_ID = 101; +export const OPBNB_MAINNET_ENDPOINT_ID = 202; +export const ARBITRUM_ONE_ENDPOINT_ID = 110; +export const ZKSYNC_MAINNET_ENDPOINT_ID = 165; + +export const OPBNB_MAINNET_TRUSTED_REMOTE = "0x100d331c1b5dcd41eacb1eced0e83dcebf3498b2"; +export const ETHEREUM_TRUSTED_REMOTE = "0x888e317606b4c590bbad88653863e8b345702633"; +export const BNB_MAINNET_TRUSTED_REMOTE = "0xf8f46791e3db29a029ec6c9d946226f3c613e854"; +export const ARBITRUM_ONE_TRUSTED_REMOTE = "0x20cea49b5f7a6dbd78cae772ca5973ef360aa1e6"; +export const ZKSYNC_MAINNET_TRUSTED_REMOTE = "0x16a62B534e09A7534CD5847CFE5Bf6a4b0c1B116"; + +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); + +export const XVS_MINT_LIMIT = parseUnits("500000", 18); + +const vip001 = () => { + return makeProposal([ + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setSendVersion(uint16)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setReceiveVersion(uint16)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "forceResumeReceive(uint16,bytes)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setOracle(address)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleTransactionLimit(uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyLimit(uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxSingleReceiveTransactionLimit(uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMaxDailyReceiveLimit(uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "pause()", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "unpause()", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "removeTrustedRemote(uint16)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "dropFailedMessage(uint16,bytes,uint64)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setPrecrime(address)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setMinDstGas(uint16,uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setPayloadSizeLimit(uint16,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setWhitelist(address,bool)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setConfig(uint16,uint16,uint256,bytes)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "sweepToken(address,address,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "updateSendAndCallEnabled(bool)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "mint(address,uint256)", XVS_BRIDGE_DEST], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "burn(address,uint256)", XVS_BRIDGE_DEST], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "setTrustedRemoteAddress(uint16,bytes)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS_BRIDGE_ADMIN_PROXY, "transferBridgeOwnership(address)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "migrateMinterTokens(address,address)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "setMintCap(address,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "updateBlacklist(address,bool)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "pause()", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [XVS, "unpause()", opmainnet.GUARDIAN], + }, + { target: XVS_BRIDGE_ADMIN_PROXY, signature: "acceptOwnership()", params: [] }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [BNB_MAINNET_ENDPOINT_ID, BNB_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [OPBNB_MAINNET_ENDPOINT_ID, OPBNB_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ETHEREUM_ENDPOINT_ID, ETHEREUM_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ARBITRUM_ONE_ENDPOINT_ID, ARBITRUM_ONE_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [ZKSYNC_MAINNET_ENDPOINT_ID, ZKSYNC_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setWhitelist(address,bool)", + params: [opmainnet.VTREASURY, true], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setWhitelist(address,bool)", + params: [opmainnet.GUARDIAN, true], + }, + { + target: XVS, + signature: "setMintCap(address,uint256)", + params: [XVS_BRIDGE_DEST, XVS_MINT_LIMIT], + }, + ]); +}; + +export default vip001; diff --git a/multisig/simulations/opmainnet/vip-001/abi/xvs.json b/multisig/simulations/opmainnet/vip-001/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/opmainnet/vip-001/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opmainnet/vip-001/abi/xvsBridgeAdmin.json b/multisig/simulations/opmainnet/vip-001/abi/xvsBridgeAdmin.json new file mode 100644 index 000000000..024450a40 --- /dev/null +++ b/multisig/simulations/opmainnet/vip-001/abi/xvsBridgeAdmin.json @@ -0,0 +1,329 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "XVSBridge_", + "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": false, + "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": "XVSBridge", + "outputs": [ + { + "internalType": "contract IXVSProxyOFT", + "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": [ + { + "internalType": "uint16", + "name": "remoteChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "remoteAddress_", + "type": "bytes" + } + ], + "name": "isTrustedRemote", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "remoteChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "remoteAddress_", + "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/multisig/simulations/opmainnet/vip-001/abi/xvsProxyOFTDest.json b/multisig/simulations/opmainnet/vip-001/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/opmainnet/vip-001/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/opmainnet/vip-001/index.ts b/multisig/simulations/opmainnet/vip-001/index.ts new file mode 100644 index 000000000..8c4d64e9d --- /dev/null +++ b/multisig/simulations/opmainnet/vip-001/index.ts @@ -0,0 +1,224 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseEther } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip001, { + ARBITRUM_ONE_ENDPOINT_ID, + ARBITRUM_ONE_TRUSTED_REMOTE, + BNB_MAINNET_ENDPOINT_ID, + BNB_MAINNET_TRUSTED_REMOTE, + ETHEREUM_ENDPOINT_ID, + ETHEREUM_TRUSTED_REMOTE, + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OPBNB_MAINNET_ENDPOINT_ID, + OPBNB_MAINNET_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, + XVS, + XVS_BRIDGE_ADMIN_PROXY, + XVS_BRIDGE_DEST, + XVS_MINT_LIMIT, + ZKSYNC_MAINNET_ENDPOINT_ID, + ZKSYNC_MAINNET_TRUSTED_REMOTE, +} from "../../../proposals/opmainnet/vip-001"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ADMIN_ABI from "./abi/xvsBridgeAdmin.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const { opmainnet } = NETWORK_ADDRESSES; +const REGULAR_USER = "0xd7b572EeE55B6C4725469ef6Df5ceaa77374E641"; + +const MIN_DEST_GAS = "300000"; + +forking(125555900, async () => { + let xvs: Contract; + let xvsBridgeAdmin: Contract; + let xvsBridge: Contract; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridgeAdmin = await ethers.getContractAt(XVS_BRIDGE_ADMIN_ABI, XVS_BRIDGE_ADMIN_PROXY); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE_DEST); + }); + + describe("Pre-Execution state", () => { + it("Bridge Owner != arbitrum sepolia multisig", async () => { + const owner = await xvsBridgeAdmin.owner(); + expect(owner).not.equal(opmainnet.NORMAL_TIMELOCK); + }); + + it("Trusted remote should not exist for any network(bscmainnet, opbnbmainnet, ethereum)", async () => { + await expect(xvsBridge.getTrustedRemoteAddress(BNB_MAINNET_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(OPBNB_MAINNET_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(ETHEREUM_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(ARBITRUM_ONE_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + await expect(xvsBridge.getTrustedRemoteAddress(ZKSYNC_MAINNET_ENDPOINT_ID)).to.be.revertedWith( + "LzApp: no trusted path record", + ); + }); + + it("Mint limit = 0", async () => { + const cap = await xvs.minterToCap(XVS_BRIDGE_DEST); + expect(cap).equals(0); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + // await pretendExecutingVip(await vip000()); + await pretendExecutingVip(await vip001()); + }); + + it("Should set bridge owner to multisig", async () => { + const owner = await xvsBridgeAdmin.owner(); + expect(owner).equals(opmainnet.NORMAL_TIMELOCK); + }); + + it("Should whitelist MULTISIG and TREASURY", async () => { + let res = await xvsBridge.whitelist(opmainnet.NORMAL_TIMELOCK); + expect(res).equals(true); + + res = await xvsBridge.whitelist(opmainnet.VTREASURY); + expect(res).equals(true); + }); + + it("Should set trusted remote address in bridge for all five networks", async () => { + let trustedRemote = await xvsBridge.getTrustedRemoteAddress(BNB_MAINNET_ENDPOINT_ID); + expect(trustedRemote).equals(BNB_MAINNET_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(OPBNB_MAINNET_ENDPOINT_ID); + expect(trustedRemote).equals(OPBNB_MAINNET_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(ETHEREUM_ENDPOINT_ID); + expect(trustedRemote).equals(ETHEREUM_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(ARBITRUM_ONE_ENDPOINT_ID); + expect(trustedRemote).equals(ARBITRUM_ONE_TRUSTED_REMOTE); + + trustedRemote = await xvsBridge.getTrustedRemoteAddress(ZKSYNC_MAINNET_ENDPOINT_ID); + expect(trustedRemote).equals(ZKSYNC_MAINNET_TRUSTED_REMOTE); + }); + + it("Should set minting limit in XVS token", async () => { + const cap = await xvs.minterToCap(XVS_BRIDGE_DEST); + expect(cap).equals(XVS_MINT_LIMIT); + }); + + it("Should set correct token address in bridge", async () => { + const token = await xvsBridge.token(); + expect(token).equals(XVS); + }); + + it.only("Should set correct max daily limit for all five networks", async () => { + let limit = await xvsBridge.chainIdToMaxDailyLimit(BNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(OPBNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(ETHEREUM_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(ARBITRUM_ONE_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyLimit(ZKSYNC_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_SEND_LIMIT); + }); + + it("Should set correct max single limit for all five networks", async () => { + let limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(BNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(OPBNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ETHEREUM_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ARBITRUM_ONE_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleTransactionLimit(ZKSYNC_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_SEND_LIMIT); + }); + + it("Should set correct max daily receive limit for all five networks", async () => { + let limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(BNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(OPBNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ETHEREUM_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ARBITRUM_ONE_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxDailyReceiveLimit(ZKSYNC_MAINNET_ENDPOINT_ID); + expect(limit).equals(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should set correct max single receive limit for all five networks", async () => { + let limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(BNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(OPBNB_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ETHEREUM_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ARBITRUM_ONE_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + + limit = await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(ZKSYNC_MAINNET_ENDPOINT_ID); + expect(limit).equals(SINGLE_RECEIVE_LIMIT); + }); + + it("Should set correct min destination gas", async () => { + let limit = await xvsBridge.minDstGasLookup(BNB_MAINNET_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DEST_GAS); + + limit = await xvsBridge.minDstGasLookup(OPBNB_MAINNET_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DEST_GAS); + + limit = await xvsBridge.minDstGasLookup(ETHEREUM_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DEST_GAS); + + limit = await xvsBridge.minDstGasLookup(ARBITRUM_ONE_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DEST_GAS); + + limit = await xvsBridge.minDstGasLookup(ZKSYNC_MAINNET_ENDPOINT_ID, 0); + expect(limit).equals(MIN_DEST_GAS); + }); + }); + + describe("Post-Execution extra checks", () => { + it(`should fail if someone else tries to mint XVS`, async () => { + const regularUser = await initMainnetUser(REGULAR_USER, parseEther("1")); + + await expect(xvs.connect(regularUser).mint(REGULAR_USER, 1)).to.be.revertedWithCustomError(xvs, "Unauthorized"); + }); + + it(`should fail if someone else tries to burn XVS`, async () => { + const regularUser = await initMainnetUser(REGULAR_USER, parseEther("1")); + + await expect(xvs.connect(regularUser).burn(REGULAR_USER, 1)).to.be.revertedWithCustomError(xvs, "Unauthorized"); + }); + }); +}); diff --git a/src/multisig/utils.ts b/src/multisig/utils.ts index 8e86c864b..401b9d8ab 100644 --- a/src/multisig/utils.ts +++ b/src/multisig/utils.ts @@ -122,6 +122,18 @@ export const getContractNetworks = (chainId: number): ContractNetworksConfig => simulateTxAccessorAddress: "0xe7A7552B0Cff45E837e1422b479d2dEDE748f571", }, }, + opmainnet: { + [chainId]: { + safeMasterCopyAddress: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762", + safeProxyFactoryAddress: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67", + multiSendAddress: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526", + multiSendCallOnlyAddress: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2", + fallbackHandlerAddress: "0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99", + signMessageLibAddress: "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9", + createCallAddress: "0x9b35Af71d77eaf8d7e40252370304687390A1A52", + simulateTxAccessorAddress: "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199", + }, + }, // Add more networks as needed }; diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index cd1f44abe..10babc5c8 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -195,4 +195,13 @@ export const NETWORK_ADDRESSES = { CHAINLINK_ORACLE: "0x493C3f543AEa37EefF17D823f27Cb1feAB9f3143", XVS: "0x789482e37218f9b26d8D9115E356462fA9A37116", }, + opmainnet: { + NORMAL_TIMELOCK: "", // To be deployed + VTREASURY: "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da", + GUARDIAN: "0x2e94dd14E81999CdBF5deDE31938beD7308354b3", + RESILIENT_ORACLE: "0x21FC48569bd3a6623281f55FC1F8B48B9386907b", + CHAINLINK_ORACLE: "0x1076e5A60F1aC98e6f361813138275F1179BEb52", + REDSTONE_ORACLE: "0x7478e4656F6CCDCa147B6A7314fF68d0C144751a", + XVS: "0x4a971e87ad1F61f7f3081645f52a99277AE917cF", + }, }; From 9d1067dcfa45c46732f141deb42b0b3365e4bfab Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 08:35:32 +0530 Subject: [PATCH 12/24] feat: mesh architecture support for arbitrum one for op mainnet --- .../proposals/arbitrumone/vip-014/index.ts | 49 + .../arbitrumone/vip-014/abi/xvs.json | 716 +++++++ .../vip-014/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/arbitrumone/vip-014/index.ts | 112 ++ 4 files changed, 2606 insertions(+) create mode 100644 multisig/proposals/arbitrumone/vip-014/index.ts create mode 100644 multisig/simulations/arbitrumone/vip-014/abi/xvs.json create mode 100644 multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/arbitrumone/vip-014/index.ts diff --git a/multisig/proposals/arbitrumone/vip-014/index.ts b/multisig/proposals/arbitrumone/vip-014/index.ts new file mode 100644 index 000000000..05bcc3a21 --- /dev/null +++ b/multisig/proposals/arbitrumone/vip-014/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0xf5d81C6F7DAA3F97A6265C8441f92eFda22Ad784"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; + +const vip021 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip021; diff --git a/multisig/simulations/arbitrumone/vip-014/abi/xvs.json b/multisig/simulations/arbitrumone/vip-014/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/arbitrumone/vip-014/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json b/multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/arbitrumone/vip-014/index.ts b/multisig/simulations/arbitrumone/vip-014/index.ts new file mode 100644 index 000000000..d18784225 --- /dev/null +++ b/multisig/simulations/arbitrumone/vip-014/index.ts @@ -0,0 +1,112 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip014, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_MAINNET_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/arbitrumone/vip-014"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0xc1Eb7689147C81aC840d4FF0D298489fc7986d52"; +const XVS_BRIDGE = "0x20cEa49B5F7a6DBD78cAE772CA5973eF360AA1e6"; +const USER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(255002300, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + let bridgeSigner: SignerWithAddress; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(USER, ethers.utils.parseEther("5")); + bridgeSigner = await initMainnetUser(XVS_BRIDGE, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip014()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opmainnet); + expect(trustedRemote).equals(OP_MAINNET_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Opbnb mainnet -> OP mainnet)", async () => { + const amount = parseUnits("1", 18); + await xvs.connect(bridgeSigner).mint(USER, amount); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opmainnet, USER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From 44f741b3a2a62be35b63d6d50bdbf6359c1f36eb Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 08:36:14 +0530 Subject: [PATCH 13/24] feat: mesh architecture support for ethereum to op mainnet --- multisig/proposals/ethereum/vip-060/index.ts | 49 + .../simulations/ethereum/vip-060/abi/xvs.json | 716 +++++++ .../ethereum/vip-060/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/ethereum/vip-060/index.ts | 112 ++ 4 files changed, 2606 insertions(+) create mode 100644 multisig/proposals/ethereum/vip-060/index.ts create mode 100644 multisig/simulations/ethereum/vip-060/abi/xvs.json create mode 100644 multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/ethereum/vip-060/index.ts diff --git a/multisig/proposals/ethereum/vip-060/index.ts b/multisig/proposals/ethereum/vip-060/index.ts new file mode 100644 index 000000000..6daa66d50 --- /dev/null +++ b/multisig/proposals/ethereum/vip-060/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x9C6C95632A8FB3A74f2fB4B7FfC50B003c992b96"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; + +const vip060 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip060; diff --git a/multisig/simulations/ethereum/vip-060/abi/xvs.json b/multisig/simulations/ethereum/vip-060/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/ethereum/vip-060/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json b/multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/ethereum/vip-060/index.ts b/multisig/simulations/ethereum/vip-060/index.ts new file mode 100644 index 000000000..c071de5b3 --- /dev/null +++ b/multisig/simulations/ethereum/vip-060/index.ts @@ -0,0 +1,112 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip060, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_MAINNET_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/ethereum/vip-060"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0xd3CC9d8f3689B83c91b7B59cAB4946B063EB894A"; +const XVS_BRIDGE = "0x888E317606b4c590BBAD88653863e8B345702633"; +const USER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(20781600, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + let bridgeSigner: SignerWithAddress; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(USER, ethers.utils.parseEther("5")); + bridgeSigner = await initMainnetUser(XVS_BRIDGE, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip060()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opmainnet); + expect(trustedRemote).equals(OP_MAINNET_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Ethereum -> Zksync mainnet)", async () => { + const amount = parseUnits("1", 18); + await xvs.connect(bridgeSigner).mint(USER, amount); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opmainnet, USER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From cd3b7dee8817c5da70b0113d863a963860d62d43 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 08:36:36 +0530 Subject: [PATCH 14/24] feat: mesh architecture support for opbnbmainnet to op mainnet --- .../proposals/opbnbmainnet/vip-021/index.ts | 49 + .../opbnbmainnet/vip-021/abi/xvs.json | 716 +++++++ .../vip-021/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/opbnbmainnet/vip-021/index.ts | 112 ++ 4 files changed, 2606 insertions(+) create mode 100644 multisig/proposals/opbnbmainnet/vip-021/index.ts create mode 100644 multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json create mode 100644 multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/opbnbmainnet/vip-021/index.ts diff --git a/multisig/proposals/opbnbmainnet/vip-021/index.ts b/multisig/proposals/opbnbmainnet/vip-021/index.ts new file mode 100644 index 000000000..ccee757ab --- /dev/null +++ b/multisig/proposals/opbnbmainnet/vip-021/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x52fcE05aDbf6103d71ed2BA8Be7A317282731831"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; + +const vip021 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip021; diff --git a/multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json b/multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json b/multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/opbnbmainnet/vip-021/index.ts b/multisig/simulations/opbnbmainnet/vip-021/index.ts new file mode 100644 index 000000000..65daefd11 --- /dev/null +++ b/multisig/simulations/opbnbmainnet/vip-021/index.ts @@ -0,0 +1,112 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip021, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_MAINNET_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/opbnbmainnet/vip-021"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0x3E2e61F1c075881F3fB8dd568043d8c221fd5c61"; +const XVS_BRIDGE = "0x100D331C1B5Dcd41eACB1eCeD0e83DCEbf3498B2"; +const USER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(34960200, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + let bridgeSigner: SignerWithAddress; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(USER, ethers.utils.parseEther("5")); + bridgeSigner = await initMainnetUser(XVS_BRIDGE, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip021()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opmainnet); + expect(trustedRemote).equals(OP_MAINNET_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Opbnb mainnet -> OP mainnet)", async () => { + const amount = parseUnits("1", 18); + await xvs.connect(bridgeSigner).mint(USER, amount); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opmainnet, USER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From 87154779b9b43f6a551cc076632cf5fc7124d1f3 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 08:37:03 +0530 Subject: [PATCH 15/24] feat: mesh architecture support for bscmainnet to op mainnet --- simulations/vip-364/bscmainnet.ts | 170 ++++++++++++++++++++++++++++++ src/types.ts | 1 + vips/vip-364/bscmainnet.ts | 63 +++++++++++ 3 files changed, 234 insertions(+) create mode 100644 simulations/vip-364/bscmainnet.ts create mode 100644 vips/vip-364/bscmainnet.ts diff --git a/simulations/vip-364/bscmainnet.ts b/simulations/vip-364/bscmainnet.ts new file mode 100644 index 000000000..c909e10f7 --- /dev/null +++ b/simulations/vip-364/bscmainnet.ts @@ -0,0 +1,170 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId } from "src/types"; +import { expectEvents, initMainnetUser } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip364, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + MIN_DST_GAS, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../vips/vip-364/bscmainnet"; +import XVS_ABI from "./abi/XVS.json"; +import XVS_BRIDGE_ADMIN_ABI from "./abi/XVSBridgeAdmin.json"; +import XVS_BRIDGE_SRC_ABI from "./abi/XVSProxyOFTSrc.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +const XVSProxyOFTSrc = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; +const XVS_HOLDER = "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706"; + +forking(42378700, async () => { + const provider = ethers.provider; + let bridge: Contract; + let xvs: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + + beforeEach(async () => { + bridge = new ethers.Contract(XVSProxyOFTSrc, XVS_BRIDGE_SRC_ABI, provider); + xvs = new ethers.Contract(bsctestnet.XVS, XVS_ABI, provider); + xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + testVip("vip-364 testnet", await vip364(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents( + txResponse, + [XVS_BRIDGE_ADMIN_ABI, XVS_BRIDGE_SRC_ABI], + [ + "SetMinDstGas", + "SetMaxSingleTransactionLimit", + "SetMaxDailyLimit", + "SetMaxSingleReceiveTransactionLimit", + "SetMaxDailyReceiveLimit", + "SetTrustedRemoteAddress", + "Failure", + ], + [1, 1, 1, 1, 1, 1, 0], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Should match minDestGas value", async () => { + expect(await bridge.minDstGasLookup(LzChainId.opmainnet, 0)).to.equal(MIN_DST_GAS); + }); + + it("Should match single send transaction limit", async () => { + expect(await bridge.chainIdToMaxSingleTransactionLimit(LzChainId.opmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await bridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await bridge.chainIdToMaxDailyLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await bridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successfull bridging of XVS", async () => { + const amount = parseUnits("0.5", 18); + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opmainnet, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + + await xvs.connect(xvsHolderSigner).approve(bridge.address, amount); + const bridgeBalPrev = await xvs.balanceOf(XVSProxyOFTSrc); + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(bridge, "SendToChain") + .withArgs(LzChainId.opmainnet, XVS_HOLDER, receiverAddressBytes32, amount); + const bridgeBalAfter = await xvs.balanceOf(XVSProxyOFTSrc); + + expect(bridgeBalAfter.sub(bridgeBalPrev)).to.equal(amount); + }); + + it("Reverts if single transaction limit exceed", async function () { + const amount = ethers.utils.parseUnits("10000", 18); + await xvs.connect(xvsHolderSigner).approve(bridge.address, amount); + + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opmainnet, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ).to.be.revertedWith("Single Transaction Limit Exceed"); + }); + + it("Reverts if max daily transaction limit exceed", async function () { + const maxPlusAmount = ethers.utils.parseUnits("50000", 18); + const amount = parseUnits("1420", 18); + await xvs.connect(xvsHolderSigner).approve(bridge.address, maxPlusAmount); + const nativeFee = ( + await bridge.estimateSendFee(LzChainId.opmainnet, receiverAddressBytes32, amount, false, defaultAdapterParams) + ).nativeFee; + + for (let i = 0; i < 5; i++) { + await bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ); + } + await expect( + bridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ).to.be.revertedWith("Daily Transaction Limit Exceed"); + }); + }); +}); diff --git a/src/types.ts b/src/types.ts index 7643e07ab..17d17f0b2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -70,4 +70,5 @@ export enum LzChainId { zksyncsepolia = 10248, zksyncmainnet = 165, opsepolia = 10232, + opmainnet = 111, } diff --git a/vips/vip-364/bscmainnet.ts b/vips/vip-364/bscmainnet.ts new file mode 100644 index 000000000..70beda17e --- /dev/null +++ b/vips/vip-364/bscmainnet.ts @@ -0,0 +1,63 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { LzChainId, ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; + +const vip364 = () => { + const meta = { + version: "v2", + title: "VIP-364 Enable BSC -> OP mainnet bridge", + description: `#### Summary Enable BSC -> mainnet bridge`, + 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: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_SEPOLIA_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip364; From 3e1e6f6369a8124d626e691d1f077562a8a6a10d Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 18:52:33 +0530 Subject: [PATCH 16/24] feat: vip for xvs vault and store on opmainnet --- multisig/proposals/opmainnet/vip-002/index.ts | 64 + .../opmainnet/vip-002/abi/acm.json | 126 ++ .../opmainnet/vip-002/abi/xvs.json | 683 +++++++ .../opmainnet/vip-002/abi/xvsstore.json | 235 +++ .../opmainnet/vip-002/abi/xvsvault.json | 1651 +++++++++++++++++ .../simulations/opmainnet/vip-002/index.ts | 76 + src/networkAddresses.ts | 2 + 7 files changed, 2837 insertions(+) create mode 100644 multisig/proposals/opmainnet/vip-002/index.ts create mode 100644 multisig/simulations/opmainnet/vip-002/abi/acm.json create mode 100644 multisig/simulations/opmainnet/vip-002/abi/xvs.json create mode 100644 multisig/simulations/opmainnet/vip-002/abi/xvsstore.json create mode 100644 multisig/simulations/opmainnet/vip-002/abi/xvsvault.json create mode 100644 multisig/simulations/opmainnet/vip-002/index.ts diff --git a/multisig/proposals/opmainnet/vip-002/index.ts b/multisig/proposals/opmainnet/vip-002/index.ts new file mode 100644 index 000000000..c208426d0 --- /dev/null +++ b/multisig/proposals/opmainnet/vip-002/index.ts @@ -0,0 +1,64 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +const { opmainnet } = NETWORK_ADDRESSES; + +export const XVS_STORE = "0xFE548630954129923f63113923eF5373E10589d3"; +export const ACM = "0xD71b1F33f6B0259683f11174EE4Ddc2bb9cE4eD6"; + +const vip002 = () => { + return makeProposal([ + { + target: opmainnet.XVS_VAULT_PROXY, + signature: "_acceptAdmin()", + params: [], + }, + { + target: XVS_STORE, + signature: "acceptAdmin()", + params: [], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "pause()", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "resume()", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "add(address,uint256,address,uint256,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "set(address,uint256,uint256)", opmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "setRewardAmountPerBlockOrSecond(address,uint256)", opmainnet.GUARDIAN], // func name changed from setRewardAmountPerBlock to setRewardAmountPerBlockOrSecond + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [opmainnet.XVS_VAULT_PROXY, "setWithdrawalLockingPeriod(address,uint256,uint256)", opmainnet.GUARDIAN], + }, + { + target: opmainnet.XVS_VAULT_PROXY, + signature: "add(address,uint256,address,uint256,uint256)", + params: [opmainnet.XVS, 100, opmainnet.XVS, "0", 604800], + }, + { + target: opmainnet.XVS_VAULT_PROXY, + signature: "pause()", + params: [], + }, + ]); +}; + +export default vip002; diff --git a/multisig/simulations/opmainnet/vip-002/abi/acm.json b/multisig/simulations/opmainnet/vip-002/abi/acm.json new file mode 100644 index 000000000..687d32137 --- /dev/null +++ b/multisig/simulations/opmainnet/vip-002/abi/acm.json @@ -0,0 +1,126 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "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": "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/opmainnet/vip-002/abi/xvs.json b/multisig/simulations/opmainnet/vip-002/abi/xvs.json new file mode 100644 index 000000000..8a2713887 --- /dev/null +++ b/multisig/simulations/opmainnet/vip-002/abi/xvs.json @@ -0,0 +1,683 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "MintNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "_blacklist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opmainnet/vip-002/abi/xvsstore.json b/multisig/simulations/opmainnet/vip-002/abi/xvsstore.json new file mode 100644 index 000000000..56b26cc2d --- /dev/null +++ b/multisig/simulations/opmainnet/vip-002/abi/xvsstore.json @@ -0,0 +1,235 @@ +[ + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerTransferred", + "type": "event" + }, + { + "constant": false, + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "emergencyRewardWithdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "safeRewardTransfer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "setNewOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "setPendingAdmin", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "name": "setRewardToken", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/opmainnet/vip-002/abi/xvsvault.json b/multisig/simulations/opmainnet/vip-002/abi/xvsvault.json new file mode 100644 index 000000000..e32e0b3d1 --- /dev/null +++ b/multisig/simulations/opmainnet/vip-002/abi/xvsvault.json @@ -0,0 +1,1651 @@ +[ + { + "inputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Claim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChangedV2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "DelegateVotesChangedV2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ExecutedWithdrawal", + "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": "contract IPrime", + "name": "oldPrimeToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IPrime", + "name": "newPrimeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldPrimeRewardToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPrimeRewardToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldPrimePoolId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPrimePoolId", + "type": "uint256" + } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "allocPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardPerBlockOrSecond", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "lockPeriod", + "type": "uint256" + } + ], + "name": "PoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldAllocPoints", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newAllocPoints", + "type": "uint256" + } + ], + "name": "PoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RequestedWithdrawal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldReward", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReward", + "type": "uint256" + } + ], + "name": "RewardAmountUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldXvs", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newXvs", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newStore", + "type": "address" + } + ], + "name": "StoreUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldOwedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newOwedAmount", + "type": "uint256" + } + ], + "name": "VaultDebtUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "VaultPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "VaultResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPeriod", + "type": "uint256" + } + ], + "name": "WithdrawalLockingPeriodUpdated", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "DELEGATION_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_LOCK_PERIOD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "SECONDS_PER_YEAR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract XVSVaultProxy", + "name": "xvsVaultProxy", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV5", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "contract IBEP20", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rewardPerBlockOrSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_lockPeriod", + "type": "uint256" + } + ], + "name": "add", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "blocksOrSecondsPerYear", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "checkpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "fromBlockOrSecond", + "type": "uint32" + }, + { + "internalType": "uint96", + "name": "votes", + "type": "uint96" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + } + ], + "name": "claim", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + } + ], + "name": "executeWithdrawal", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBlockNumberOrTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getCurrentVotes", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "getEligibleWithdrawalAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "withdrawalAmount", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockNumberOrSecond", + "type": "uint256" + } + ], + "name": "getPriorVotes", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "getRequestedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "getUserInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardDebt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pendingWithdrawals", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "getWithdrawalRequests", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint128", + "name": "lockedUntil", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "afterUpgrade", + "type": "uint128" + } + ], + "internalType": "struct XVSVaultStorageV1.WithdrawalRequest[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bool", + "name": "timeBased_", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "blocksPerYear_", + "type": "uint256" + } + ], + "name": "initializeTimeManager", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isStakedToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isTimeBased", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "numCheckpoints", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "pause", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "pendingReward", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "pendingRewardTransfers", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "pendingWithdrawalsBeforeUpgrade", + "outputs": [ + { + "internalType": "uint256", + "name": "beforeUpgradeWithdrawalAmount", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingXVSVaultImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "poolInfos", + "outputs": [ + { + "internalType": "contract IBEP20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allocPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastRewardBlockOrSecond", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardPerShare", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lockPeriod", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "rewardToken", + "type": "address" + } + ], + "name": "poolLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "primePoolId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "primeRewardToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "primeToken", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "requestWithdrawal", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "resume", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + } + ], + "name": "rewardTokenAmountsPerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenAmountsPerBlockOrSecond", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + } + ], + "name": "set", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "setAccessControl", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_primeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_primeRewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_primePoolId", + "type": "uint256" + } + ], + "name": "setPrimeToken", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_rewardAmount", + "type": "uint256" + } + ], + "name": "setRewardAmountPerBlockOrSecond", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_newPeriod", + "type": "uint256" + } + ], + "name": "setWithdrawalLockingPeriod", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_xvs", + "type": "address" + }, + { + "internalType": "address", + "name": "_xvsStore", + "type": "address" + } + ], + "name": "setXvsStore", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAllocPoints", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + } + ], + "name": "updatePool", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaultPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "xvsAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "xvsStore", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/opmainnet/vip-002/index.ts b/multisig/simulations/opmainnet/vip-002/index.ts new file mode 100644 index 000000000..5a5c25a50 --- /dev/null +++ b/multisig/simulations/opmainnet/vip-002/index.ts @@ -0,0 +1,76 @@ +import { mine } from "@nomicfoundation/hardhat-network-helpers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseEther, parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { initMainnetUser } from "src/utils"; +import { checkXVSVault } from "src/vip-framework/checks/checkXVSVault"; +import { forking, pretendExecutingVip } from "src/vip-framework/index"; + +import vip002, { ACM, XVS_STORE } from "../../../proposals/opmainnet/vip-002"; +import ACM_ABI from "./abi/acm.json"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_STORE_ABI from "./abi/xvsstore.json"; +import XVS_VAULT_ABI from "./abi/xvsvault.json"; + +const { opmainnet } = NETWORK_ADDRESSES; + +const XVS_BRIDGE = "0x20cEa49B5F7a6DBD78cAE772CA5973eF360AA1e6"; + +forking(125560175, async () => { + let xvsVault: Contract; + let xvsStore: Contract; + let xvsMinter: SignerWithAddress; + + before(async () => { + xvsVault = await ethers.getContractAt(XVS_VAULT_ABI, opmainnet.XVS_VAULT_PROXY); + xvsStore = await ethers.getContractAt(XVS_STORE_ABI, XVS_STORE); + + await pretendExecutingVip(await vip002()); + }); + + describe("Post tx checks", () => { + describe("Generic checks", async () => { + before(async () => { + const acm: Contract = await ethers.getContractAt(ACM_ABI, ACM); + const xvs: Contract = await ethers.getContractAt(XVS_ABI, opmainnet.XVS); + xvsMinter = await initMainnetUser(XVS_BRIDGE, ethers.utils.parseEther("1")); + const admin = await initMainnetUser(opmainnet.GUARDIAN, ethers.utils.parseEther("1")); + const xvsHolder = await initMainnetUser(opmainnet.GENERIC_TEST_USER_ACCOUNT, ethers.utils.parseEther("1")); + await xvsVault.connect(admin).setRewardAmountPerBlockOrSecond(opmainnet.XVS, "61805555555555555"); + await xvsVault.connect(admin).resume(); + // Giving call permissions to call the functions as xvs bridge vip is not executed now. + await acm.connect(admin).giveCallPermission(opmainnet.XVS, "mint(address,uint256)", XVS_BRIDGE); + await acm.connect(admin).giveCallPermission(opmainnet.XVS, "setMintCap(address,uint256)", admin.address); + await xvs.connect(admin).setMintCap(XVS_BRIDGE, parseUnits("100", 18)); + await xvs.connect(xvsMinter).mint(xvsHolder.address, parseEther("10")); + + await xvs.connect(xvsHolder).transfer(XVS_STORE, ethers.utils.parseEther("1")); + await mine(604800); + }); + checkXVSVault(); + }); + + it("Should set xvs vault owner to multisig", async () => { + const owner = await xvsVault.admin(); + expect(owner).equals(opmainnet.GUARDIAN); + }); + + it("Should set xvs store owner to multisig", async () => { + const owner = await xvsStore.admin(); + expect(owner).equals(opmainnet.GUARDIAN); + }); + + it("Should set correct xvs store address", async () => { + const xvsStore = await xvsVault.xvsStore(); + expect(xvsStore).equals(XVS_STORE); + }); + + it("Should set correct reward token address", async () => { + const isActive = await xvsStore.rewardTokens(opmainnet.XVS); + expect(isActive).equals(true); + }); + }); +}); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index 10babc5c8..2c2e95dcd 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -203,5 +203,7 @@ export const NETWORK_ADDRESSES = { CHAINLINK_ORACLE: "0x1076e5A60F1aC98e6f361813138275F1179BEb52", REDSTONE_ORACLE: "0x7478e4656F6CCDCa147B6A7314fF68d0C144751a", XVS: "0x4a971e87ad1F61f7f3081645f52a99277AE917cF", + XVS_VAULT_PROXY: "0x133120607C018c949E91AE333785519F6d947e01", + GENERIC_TEST_USER_ACCOUNT: "0x6f057A858171e187124ddEDF034dAc63De5dE5dB", }, }; From a7a30871ffafeececfa834f9a62bee4c785770f6 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 18:58:25 +0530 Subject: [PATCH 17/24] feat: xvs bridge support for zksync to op mainnet --- .../proposals/zksyncmainnet/vip-010/index.ts | 49 + .../zksyncmainnet/vip-010/abi/xvs.json | 716 +++++++ .../vip-010/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../zksyncmainnet/vip-010/index.ts | 112 ++ 4 files changed, 2606 insertions(+) create mode 100644 multisig/proposals/zksyncmainnet/vip-010/index.ts create mode 100644 multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json create mode 100644 multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/zksyncmainnet/vip-010/index.ts diff --git a/multisig/proposals/zksyncmainnet/vip-010/index.ts b/multisig/proposals/zksyncmainnet/vip-010/index.ts new file mode 100644 index 000000000..fdcacd721 --- /dev/null +++ b/multisig/proposals/zksyncmainnet/vip-010/index.ts @@ -0,0 +1,49 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x2471043F05Cc41A6051dd6714DC967C7BfC8F902"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; + +const vip010 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; + +export default vip010; diff --git a/multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json b/multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json new file mode 100644 index 000000000..69092bb4a --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json @@ -0,0 +1,716 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "AccountBlacklisted", + "type": "error" + }, + { + "inputs": [], + "name": "AddressesMustDiffer", + "type": "error" + }, + { + "inputs": [], + "name": "MintLimitExceed", + "type": "error" + }, + { + "inputs": [], + "name": "MintedAmountExceed", + "type": "error" + }, + { + "inputs": [], + "name": "NewCapNotGreaterThanMintedTokens", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "BlacklistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "MintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitDecreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLimit", + "type": "uint256" + } + ], + "name": "MintLimitIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "MintedTokensMigrated", + "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": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + } + ], + "name": "isBlackListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "source_", + "type": "address" + }, + { + "internalType": "address", + "name": "destination_", + "type": "address" + } + ], + "name": "migrateMinterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToCap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minterToMintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "setMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "value_", + "type": "bool" + } + ], + "name": "updateBlacklist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json b/multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json @@ -0,0 +1,1729 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress_", + "type": "address" + }, + { + "internalType": "uint8", + "name": "sharedDecimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "lzEndpoint_", + "type": "address" + }, + { + "internalType": "address", + "name": "oracle_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "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": "_hash", + "type": "bytes32" + } + ], + "name": "CallOFTReceivedSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "bytes", + "name": "srcAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "DropFailedMessage", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "innerToken", + "type": "address" + } + ], + "name": "InnerTokenAdded", + "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": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "NonContractAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOracle", + "type": "address" + } + ], + "name": "OracleChanged", + "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": "_srcChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "ReceiveFromChain", + "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": true, + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "indexed": true, + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "SendToChain", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "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": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleReceiveTransactionLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxLimit", + "type": "uint256" + } + ], + "name": "SetMaxSingleTransactionLimit", + "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": 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": true, + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isWhitelist", + "type": "bool" + } + ], + "name": "SetWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "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": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NO_EXTRA_GAS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_srcChainId", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_srcAddress", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_from", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "_gasForCall", + "type": "uint256" + } + ], + "name": "callOnOFTReceived", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceiveWindowStart", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourReceived", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToLast24HourTransferred", + "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": "chainIdToMaxDailyLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxDailyReceiveLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleReceiveTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "chainIdToMaxSingleTransactionLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "circulatingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "creditedPackets", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "srcChainId_", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "srcAddress_", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "nonce_", + "type": "uint64" + } + ], + "name": "dropFailedMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendAndCallFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_useZro", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "_adapterParams", + "type": "bytes" + } + ], + "name": "estimateSendFee", + "outputs": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "zroFee", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": [ + { + "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": "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": [ + { + "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": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "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": [ + { + "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": "uint16", + "name": "remoteChainId_", + "type": "uint16" + } + ], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "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": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_payload", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "_dstGasForCall", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_dstChainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "_toAddress", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address payable", + "name": "refundAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "zroPaymentAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "adapterParams", + "type": "bytes" + } + ], + "internalType": "struct ICommonOFT.LzCallParams", + "name": "_callParams", + "type": "tuple" + } + ], + "name": "sendFrom", + "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": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleReceiveTransactionLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId_", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "limit_", + "type": "uint256" + } + ], + "name": "setMaxSingleTransactionLimit", + "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": "address", + "name": "oracleAddress_", + "type": "address" + } + ], + "name": "setOracle", + "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": "_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": [ + { + "internalType": "address", + "name": "user_", + "type": "address" + }, + { + "internalType": "bool", + "name": "val_", + "type": "bool" + } + ], + "name": "setWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-010/index.ts b/multisig/simulations/zksyncmainnet/vip-010/index.ts new file mode 100644 index 000000000..1b83cdfcf --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-010/index.ts @@ -0,0 +1,112 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { initMainnetUser } from "src/utils"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip010, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + OP_MAINNET_TRUSTED_REMOTE, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/zksyncmainnet/vip-010"; +import XVS_ABI from "./abi/xvs.json"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS = "0xD78ABD81a3D57712a3af080dc4185b698Fe9ac5A"; +const XVS_BRIDGE = "0x16a62B534e09A7534CD5847CFE5Bf6a4b0c1B116"; +const USER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; + +forking(44548900, async () => { + let xvs: Contract; + let xvsBridge: Contract; + let xvsHolderSigner: SignerWithAddress; + let receiver: SignerWithAddress; + let receiverAddressBytes32: string; + let defaultAdapterParams: string; + let bridgeSigner: SignerWithAddress; + + before(async () => { + xvs = await ethers.getContractAt(XVS_ABI, XVS); + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + xvsHolderSigner = await initMainnetUser(USER, ethers.utils.parseEther("5")); + bridgeSigner = await initMainnetUser(XVS_BRIDGE, ethers.utils.parseEther("2")); + [receiver] = await ethers.getSigners(); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip010()); + }); + + it("Should match trusted remote address", async () => { + const trustedRemote = await xvsBridge.getTrustedRemoteAddress(LzChainId.opmainnet); + expect(trustedRemote).equals(OP_MAINNET_TRUSTED_REMOTE); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should emit an event on successful bridging of XVS (Opbnb mainnet -> OP mainnet)", async () => { + const amount = parseUnits("1", 18); + await xvs.connect(bridgeSigner).mint(USER, amount); + const nativeFee = ( + await xvsBridge.estimateSendFee( + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + false, + defaultAdapterParams, + ) + ).nativeFee; + + const circulatingSupplyBefore = await xvsBridge.circulatingSupply(); + const totalSupplyBefore = await xvs.totalSupply(); + const minterToMintedAmountBefore = await xvs.minterToMintedAmount(XVS_BRIDGE); + + await expect( + xvsBridge + .connect(xvsHolderSigner) + .sendFrom( + xvsHolderSigner.address, + LzChainId.opmainnet, + receiverAddressBytes32, + amount, + [xvsHolderSigner.address, ethers.constants.AddressZero, defaultAdapterParams], + { value: nativeFee }, + ), + ) + .to.be.emit(xvsBridge, "SendToChain") + .withArgs(LzChainId.opmainnet, USER, receiverAddressBytes32, amount); + + const circulatingSupplyAfter = await xvsBridge.circulatingSupply(); + const totalSupplyAfter = await xvs.totalSupply(); + const minterToMintedAmountAfter = await xvs.minterToMintedAmount(XVS_BRIDGE); + + expect(circulatingSupplyBefore).equals(circulatingSupplyAfter.add(amount)); + expect(totalSupplyBefore).equals(totalSupplyAfter.add(amount)); + expect(minterToMintedAmountBefore).equals(minterToMintedAmountAfter.add(amount)); + }); + }); +}); From e07920a99a5fad2b49e4769c7df05d15dcb32db3 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 19 Sep 2024 19:21:20 +0530 Subject: [PATCH 18/24] refactor: set xvs bridge config for all networks to op mainnet --- multisig/proposals/opmainnet/vip-001/index.ts | 102 +++++++++++++++++- .../simulations/opmainnet/vip-001/index.ts | 8 +- 2 files changed, 105 insertions(+), 5 deletions(-) diff --git a/multisig/proposals/opmainnet/vip-001/index.ts b/multisig/proposals/opmainnet/vip-001/index.ts index 2cd9814cf..d1d3e9c95 100644 --- a/multisig/proposals/opmainnet/vip-001/index.ts +++ b/multisig/proposals/opmainnet/vip-001/index.ts @@ -20,7 +20,7 @@ export const OPBNB_MAINNET_TRUSTED_REMOTE = "0x100d331c1b5dcd41eacb1eced0e83dceb export const ETHEREUM_TRUSTED_REMOTE = "0x888e317606b4c590bbad88653863e8b345702633"; export const BNB_MAINNET_TRUSTED_REMOTE = "0xf8f46791e3db29a029ec6c9d946226f3c613e854"; export const ARBITRUM_ONE_TRUSTED_REMOTE = "0x20cea49b5f7a6dbd78cae772ca5973ef360aa1e6"; -export const ZKSYNC_MAINNET_TRUSTED_REMOTE = "0x16a62B534e09A7534CD5847CFE5Bf6a4b0c1B116"; +export const ZKSYNC_MAINNET_TRUSTED_REMOTE = "0x16a62b534e09a7534cd5847cfe5bf6a4b0c1b116"; export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); @@ -177,26 +177,126 @@ const vip001 = () => { signature: "setTrustedRemoteAddress(uint16,bytes)", params: [BNB_MAINNET_ENDPOINT_ID, BNB_MAINNET_TRUSTED_REMOTE], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [BNB_MAINNET_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [BNB_MAINNET_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [BNB_MAINNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [BNB_MAINNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [OPBNB_MAINNET_ENDPOINT_ID, OPBNB_MAINNET_TRUSTED_REMOTE], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [OPBNB_MAINNET_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [OPBNB_MAINNET_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [OPBNB_MAINNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [OPBNB_MAINNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [ETHEREUM_ENDPOINT_ID, ETHEREUM_TRUSTED_REMOTE], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ETHEREUM_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [ETHEREUM_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [ETHEREUM_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [ETHEREUM_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [ARBITRUM_ONE_ENDPOINT_ID, ARBITRUM_ONE_TRUSTED_REMOTE], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ARBITRUM_ONE_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [ARBITRUM_ONE_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [ARBITRUM_ONE_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [ARBITRUM_ONE_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setTrustedRemoteAddress(uint16,bytes)", params: [ZKSYNC_MAINNET_ENDPOINT_ID, ZKSYNC_MAINNET_TRUSTED_REMOTE], }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [ZKSYNC_MAINNET_ENDPOINT_ID, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [ZKSYNC_MAINNET_ENDPOINT_ID, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [ZKSYNC_MAINNET_ENDPOINT_ID, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN_PROXY, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [ZKSYNC_MAINNET_ENDPOINT_ID, SINGLE_RECEIVE_LIMIT], + }, { target: XVS_BRIDGE_ADMIN_PROXY, signature: "setWhitelist(address,bool)", diff --git a/multisig/simulations/opmainnet/vip-001/index.ts b/multisig/simulations/opmainnet/vip-001/index.ts index 8c4d64e9d..76e58bdeb 100644 --- a/multisig/simulations/opmainnet/vip-001/index.ts +++ b/multisig/simulations/opmainnet/vip-001/index.ts @@ -49,7 +49,7 @@ forking(125555900, async () => { describe("Pre-Execution state", () => { it("Bridge Owner != arbitrum sepolia multisig", async () => { const owner = await xvsBridgeAdmin.owner(); - expect(owner).not.equal(opmainnet.NORMAL_TIMELOCK); + expect(owner).not.equal(opmainnet.GUARDIAN); }); it("Trusted remote should not exist for any network(bscmainnet, opbnbmainnet, ethereum)", async () => { @@ -84,11 +84,11 @@ forking(125555900, async () => { it("Should set bridge owner to multisig", async () => { const owner = await xvsBridgeAdmin.owner(); - expect(owner).equals(opmainnet.NORMAL_TIMELOCK); + expect(owner).equals(opmainnet.GUARDIAN); }); it("Should whitelist MULTISIG and TREASURY", async () => { - let res = await xvsBridge.whitelist(opmainnet.NORMAL_TIMELOCK); + let res = await xvsBridge.whitelist(opmainnet.GUARDIAN); expect(res).equals(true); res = await xvsBridge.whitelist(opmainnet.VTREASURY); @@ -122,7 +122,7 @@ forking(125555900, async () => { expect(token).equals(XVS); }); - it.only("Should set correct max daily limit for all five networks", async () => { + it("Should set correct max daily limit for all five networks", async () => { let limit = await xvsBridge.chainIdToMaxDailyLimit(BNB_MAINNET_ENDPOINT_ID); expect(limit).equals(MAX_DAILY_SEND_LIMIT); From fa1ce0b5814cf1068e8c8ecad49d5a6238b6ec3c Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:51:29 +0530 Subject: [PATCH 19/24] fix: addresses in simulations --- multisig/simulations/zksyncsepolia/vip-010/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-010/index.ts index 3c1a65b3f..7a0992254 100644 --- a/multisig/simulations/zksyncsepolia/vip-010/index.ts +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -19,13 +19,12 @@ import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; const XVS = "0x3AeCac43A2ebe5D8184e650403bf9F656F9D1cfA"; const XVS_BRIDGE = "0x760461ccB2508CAAa2ECe0c28af3a4707b853043"; -const XVS_HOLDER = "0xFd7dA20ea0bE63ACb0852f97E950376E7E4a817D"; +const XVS_HOLDER = "0xE8C6Cf867CF962d289305ECE9b139a4116674541"; forking(3768148, async () => { let xvs: Contract; let xvsBridge: Contract; let xvsHolderSigner: SignerWithAddress; - let receiver: SignerWithAddress; let receiverAddressBytes32: string; let defaultAdapterParams: string; @@ -33,8 +32,7 @@ forking(3768148, async () => { xvs = await ethers.getContractAt(XVS_ABI, XVS); xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("5")); - [receiver] = await ethers.getSigners(); - receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); + receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [XVS_HOLDER]); defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); }); @@ -67,7 +65,7 @@ forking(3768148, async () => { }); it("Should emit an event on successful bridging of XVS (sepolia -> Op Sepolia)", async () => { - const amount = parseUnits("1", 18); + const amount = parseUnits("0.1", 18); const nativeFee = ( await xvsBridge.estimateSendFee( LzChainId.opsepolia, From 105462dc7f83e388d1d627cbf37d158e8a83c097 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Wed, 25 Sep 2024 19:12:44 +0530 Subject: [PATCH 20/24] fix: typos and BSC simulation --- .../simulations/arbitrumone/vip-014/index.ts | 2 +- .../simulations/opmainnet/vip-001/index.ts | 1 - .../zksyncmainnet/vip-010/index.ts | 2 +- .../zksyncsepolia/vip-010/index.ts | 2 +- simulations/vip-364/bscmainnet.ts | 20 ++++++++++++------- src/multisig/utils.ts | 12 ----------- vips/vip-364/bscmainnet.ts | 4 ++-- 7 files changed, 18 insertions(+), 25 deletions(-) diff --git a/multisig/simulations/arbitrumone/vip-014/index.ts b/multisig/simulations/arbitrumone/vip-014/index.ts index d18784225..3ca625420 100644 --- a/multisig/simulations/arbitrumone/vip-014/index.ts +++ b/multisig/simulations/arbitrumone/vip-014/index.ts @@ -68,7 +68,7 @@ forking(255002300, async () => { expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); }); - it("Should emit an event on successful bridging of XVS (Opbnb mainnet -> OP mainnet)", async () => { + it("Should emit an event on successful bridging of XVS (Arbitrum one -> OP mainnet)", async () => { const amount = parseUnits("1", 18); await xvs.connect(bridgeSigner).mint(USER, amount); const nativeFee = ( diff --git a/multisig/simulations/opmainnet/vip-001/index.ts b/multisig/simulations/opmainnet/vip-001/index.ts index 76e58bdeb..8808a7081 100644 --- a/multisig/simulations/opmainnet/vip-001/index.ts +++ b/multisig/simulations/opmainnet/vip-001/index.ts @@ -78,7 +78,6 @@ forking(125555900, async () => { describe("Post-Execution state", () => { before(async () => { - // await pretendExecutingVip(await vip000()); await pretendExecutingVip(await vip001()); }); diff --git a/multisig/simulations/zksyncmainnet/vip-010/index.ts b/multisig/simulations/zksyncmainnet/vip-010/index.ts index 1b83cdfcf..7e8c759a1 100644 --- a/multisig/simulations/zksyncmainnet/vip-010/index.ts +++ b/multisig/simulations/zksyncmainnet/vip-010/index.ts @@ -68,7 +68,7 @@ forking(44548900, async () => { expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); }); - it("Should emit an event on successful bridging of XVS (Opbnb mainnet -> OP mainnet)", async () => { + it("Should emit an event on successful bridging of XVS (Zksync mainnet -> OP mainnet)", async () => { const amount = parseUnits("1", 18); await xvs.connect(bridgeSigner).mint(USER, amount); const nativeFee = ( diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-010/index.ts index 7a0992254..aec3161de 100644 --- a/multisig/simulations/zksyncsepolia/vip-010/index.ts +++ b/multisig/simulations/zksyncsepolia/vip-010/index.ts @@ -64,7 +64,7 @@ forking(3768148, async () => { expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opsepolia)).to.equal(MAX_DAILY_RECEIVE_LIMIT); }); - it("Should emit an event on successful bridging of XVS (sepolia -> Op Sepolia)", async () => { + it("Should emit an event on successful bridging of XVS (ZKsync sepolia -> Op Sepolia)", async () => { const amount = parseUnits("0.1", 18); const nativeFee = ( await xvsBridge.estimateSendFee( diff --git a/simulations/vip-364/bscmainnet.ts b/simulations/vip-364/bscmainnet.ts index c909e10f7..749e6dccf 100644 --- a/simulations/vip-364/bscmainnet.ts +++ b/simulations/vip-364/bscmainnet.ts @@ -6,7 +6,7 @@ import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { LzChainId } from "src/types"; -import { expectEvents, initMainnetUser } from "src/utils"; +import { expectEvents, initMainnetUser, setMaxStalePeriodInChainlinkOracle } from "src/utils"; import { forking, testVip } from "src/vip-framework"; import vip364, { @@ -20,12 +20,12 @@ import XVS_ABI from "./abi/XVS.json"; import XVS_BRIDGE_ADMIN_ABI from "./abi/XVSBridgeAdmin.json"; import XVS_BRIDGE_SRC_ABI from "./abi/XVSProxyOFTSrc.json"; -const { bsctestnet } = NETWORK_ADDRESSES; +const { bscmainnet } = NETWORK_ADDRESSES; const XVSProxyOFTSrc = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; -const XVS_HOLDER = "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706"; +const XVS_HOLDER = "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe"; -forking(42378700, async () => { +forking(42563100, async () => { const provider = ethers.provider; let bridge: Contract; let xvs: Contract; @@ -36,11 +36,17 @@ forking(42378700, async () => { beforeEach(async () => { bridge = new ethers.Contract(XVSProxyOFTSrc, XVS_BRIDGE_SRC_ABI, provider); - xvs = new ethers.Contract(bsctestnet.XVS, XVS_ABI, provider); + xvs = new ethers.Contract(bscmainnet.XVS, XVS_ABI, provider); xvsHolderSigner = await initMainnetUser(XVS_HOLDER, ethers.utils.parseEther("2")); [receiver] = await ethers.getSigners(); receiverAddressBytes32 = ethers.utils.defaultAbiCoder.encode(["address"], [receiver.address]); defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); + await setMaxStalePeriodInChainlinkOracle( + bscmainnet.CHAINLINK_ORACLE, + bscmainnet.XVS, + "0xbf63f430a79d4036a5900c19818aff1fa710f206", + bscmainnet.NORMAL_TIMELOCK, + ); }); testVip("vip-364 testnet", await vip364(), { @@ -135,13 +141,13 @@ forking(42378700, async () => { it("Reverts if max daily transaction limit exceed", async function () { const maxPlusAmount = ethers.utils.parseUnits("50000", 18); - const amount = parseUnits("1420", 18); + const amount = parseUnits("1500", 18); await xvs.connect(xvsHolderSigner).approve(bridge.address, maxPlusAmount); const nativeFee = ( await bridge.estimateSendFee(LzChainId.opmainnet, receiverAddressBytes32, amount, false, defaultAdapterParams) ).nativeFee; - for (let i = 0; i < 5; i++) { + for (let i = 0; i < 8; i++) { await bridge .connect(xvsHolderSigner) .sendFrom( diff --git a/src/multisig/utils.ts b/src/multisig/utils.ts index 401b9d8ab..8e86c864b 100644 --- a/src/multisig/utils.ts +++ b/src/multisig/utils.ts @@ -122,18 +122,6 @@ export const getContractNetworks = (chainId: number): ContractNetworksConfig => simulateTxAccessorAddress: "0xe7A7552B0Cff45E837e1422b479d2dEDE748f571", }, }, - opmainnet: { - [chainId]: { - safeMasterCopyAddress: "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762", - safeProxyFactoryAddress: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67", - multiSendAddress: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526", - multiSendCallOnlyAddress: "0x9641d764fc13c8B624c04430C7356C1C7C8102e2", - fallbackHandlerAddress: "0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99", - signMessageLibAddress: "0xd53cd0aB83D845Ac265BE939c57F53AD838012c9", - createCallAddress: "0x9b35Af71d77eaf8d7e40252370304687390A1A52", - simulateTxAccessorAddress: "0x3d4BA2E0884aa488718476ca2FB8Efc291A46199", - }, - }, // Add more networks as needed }; diff --git a/vips/vip-364/bscmainnet.ts b/vips/vip-364/bscmainnet.ts index 70beda17e..d56a705d9 100644 --- a/vips/vip-364/bscmainnet.ts +++ b/vips/vip-364/bscmainnet.ts @@ -10,7 +10,7 @@ export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); -export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; const vip364 = () => { const meta = { @@ -27,7 +27,7 @@ const vip364 = () => { { target: XVS_BRIDGE_ADMIN, signature: "setTrustedRemoteAddress(uint16,bytes)", - params: [LzChainId.opmainnet, OP_SEPOLIA_TRUSTED_REMOTE], + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], }, { target: XVS_BRIDGE_ADMIN, From f12ab02e44fa3b2d4385a6cf3409466dd2e1632e Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:54:45 +0530 Subject: [PATCH 21/24] fix: PR typo Co-authored-by: Jesus Lanchas --- simulations/vip-364/bscmainnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulations/vip-364/bscmainnet.ts b/simulations/vip-364/bscmainnet.ts index 749e6dccf..03ec64d4d 100644 --- a/simulations/vip-364/bscmainnet.ts +++ b/simulations/vip-364/bscmainnet.ts @@ -49,7 +49,7 @@ forking(42563100, async () => { ); }); - testVip("vip-364 testnet", await vip364(), { + testVip("vip-364 mainnet", await vip364(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { await expectEvents( txResponse, From f9b9ca46210f9203fa09b57c6a05507a7a994710 Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Thu, 26 Sep 2024 18:21:26 +0300 Subject: [PATCH 22/24] feat: add description for VIP-374 --- simulations/{vip-364 => vip-374}/abi/XVS.json | 0 .../abi/XVSBridgeAdmin.json | 0 .../abi/XVSProxyOFTSrc.json | 0 .../{vip-364 => vip-374}/bscmainnet.ts | 6 +- .../{vip-364 => vip-374}/bsctestnet.ts | 6 +- vips/vip-364/bscmainnet.ts | 63 -------- vips/vip-374/bscmainnet.ts | 146 ++++++++++++++++++ vips/{vip-364 => vip-374}/bsctestnet.ts | 6 +- 8 files changed, 155 insertions(+), 72 deletions(-) rename simulations/{vip-364 => vip-374}/abi/XVS.json (100%) rename simulations/{vip-364 => vip-374}/abi/XVSBridgeAdmin.json (100%) rename simulations/{vip-364 => vip-374}/abi/XVSProxyOFTSrc.json (100%) rename simulations/{vip-364 => vip-374}/bscmainnet.ts (98%) rename simulations/{vip-364 => vip-374}/bsctestnet.ts (98%) delete mode 100644 vips/vip-364/bscmainnet.ts create mode 100644 vips/vip-374/bscmainnet.ts rename vips/{vip-364 => vip-374}/bsctestnet.ts (95%) diff --git a/simulations/vip-364/abi/XVS.json b/simulations/vip-374/abi/XVS.json similarity index 100% rename from simulations/vip-364/abi/XVS.json rename to simulations/vip-374/abi/XVS.json diff --git a/simulations/vip-364/abi/XVSBridgeAdmin.json b/simulations/vip-374/abi/XVSBridgeAdmin.json similarity index 100% rename from simulations/vip-364/abi/XVSBridgeAdmin.json rename to simulations/vip-374/abi/XVSBridgeAdmin.json diff --git a/simulations/vip-364/abi/XVSProxyOFTSrc.json b/simulations/vip-374/abi/XVSProxyOFTSrc.json similarity index 100% rename from simulations/vip-364/abi/XVSProxyOFTSrc.json rename to simulations/vip-374/abi/XVSProxyOFTSrc.json diff --git a/simulations/vip-364/bscmainnet.ts b/simulations/vip-374/bscmainnet.ts similarity index 98% rename from simulations/vip-364/bscmainnet.ts rename to simulations/vip-374/bscmainnet.ts index 03ec64d4d..d1a51c435 100644 --- a/simulations/vip-364/bscmainnet.ts +++ b/simulations/vip-374/bscmainnet.ts @@ -9,13 +9,13 @@ import { LzChainId } from "src/types"; import { expectEvents, initMainnetUser, setMaxStalePeriodInChainlinkOracle } from "src/utils"; import { forking, testVip } from "src/vip-framework"; -import vip364, { +import vip374, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, MIN_DST_GAS, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../vips/vip-364/bscmainnet"; +} from "../../vips/vip-374/bscmainnet"; import XVS_ABI from "./abi/XVS.json"; import XVS_BRIDGE_ADMIN_ABI from "./abi/XVSBridgeAdmin.json"; import XVS_BRIDGE_SRC_ABI from "./abi/XVSProxyOFTSrc.json"; @@ -49,7 +49,7 @@ forking(42563100, async () => { ); }); - testVip("vip-364 mainnet", await vip364(), { + testVip("vip-374 mainnet", await vip374(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { await expectEvents( txResponse, diff --git a/simulations/vip-364/bsctestnet.ts b/simulations/vip-374/bsctestnet.ts similarity index 98% rename from simulations/vip-364/bsctestnet.ts rename to simulations/vip-374/bsctestnet.ts index e3c22437f..291e2dacd 100644 --- a/simulations/vip-364/bsctestnet.ts +++ b/simulations/vip-374/bsctestnet.ts @@ -9,13 +9,13 @@ import { LzChainId } from "src/types"; import { expectEvents, initMainnetUser } from "src/utils"; import { forking, testVip } from "src/vip-framework"; -import vip364, { +import vip374, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, MIN_DST_GAS, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../vips/vip-364/bsctestnet"; +} from "../../vips/vip-374/bsctestnet"; import XVS_ABI from "./abi/XVS.json"; import XVS_BRIDGE_ADMIN_ABI from "./abi/XVSBridgeAdmin.json"; import XVS_BRIDGE_SRC_ABI from "./abi/XVSProxyOFTSrc.json"; @@ -43,7 +43,7 @@ forking(43916700, async () => { defaultAdapterParams = ethers.utils.solidityPack(["uint16", "uint256"], [1, 300000]); }); - testVip("vip-364 testnet", await vip364(), { + testVip("vip-374 testnet", await vip374(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { await expectEvents( txResponse, diff --git a/vips/vip-364/bscmainnet.ts b/vips/vip-364/bscmainnet.ts deleted file mode 100644 index d56a705d9..000000000 --- a/vips/vip-364/bscmainnet.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { parseUnits } from "ethers/lib/utils"; - -import { LzChainId, ProposalType } from "../../src/types"; -import { makeProposal } from "../../src/utils"; - -const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; - -export const MIN_DST_GAS = "300000"; -export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); -export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); -export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); -export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); -export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; - -const vip364 = () => { - const meta = { - version: "v2", - title: "VIP-364 Enable BSC -> OP mainnet bridge", - description: `#### Summary Enable BSC -> mainnet bridge`, - 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: XVS_BRIDGE_ADMIN, - signature: "setTrustedRemoteAddress(uint16,bytes)", - params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMinDstGas(uint16,uint16,uint256)", - params: [LzChainId.opmainnet, 0, MIN_DST_GAS], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxDailyLimit(uint16,uint256)", - params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxSingleTransactionLimit(uint16,uint256)", - params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], - }, - ], - meta, - ProposalType.REGULAR, - ); -}; - -export default vip364; diff --git a/vips/vip-374/bscmainnet.ts b/vips/vip-374/bscmainnet.ts new file mode 100644 index 000000000..2aff0703e --- /dev/null +++ b/vips/vip-374/bscmainnet.ts @@ -0,0 +1,146 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { LzChainId, ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; + +export const MIN_DST_GAS = "300000"; +export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); +export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); +export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); +export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); +export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; + +const vip374 = () => { + const meta = { + version: "v2", + title: "VIP-374 [Optimism] XVS bridge among Optimism and every supported network, and XVS vault configuration", + description: `#### Summary + +Following the community proposal [Deploy Venus Protocol on OP Mainnet](https://community.venus.io/t/deploy-venus-protocol-on-op-mainnet/4512), and the [associated snapshot](https://snapshot.org/#/venus-xvs.eth/proposal/0xe2e59410d7c010600ec869132980f10a8694d78e9ece4b3702f973d1e0ecc93f), if passed, this VIP configures the bridge contract among Optimism and the supported networks (BNB Chain, Ethereum, opBNB, Arbitrum one, zkSync Era) using [LayerZero](https://layerzero.network/) ([snapshot](https://snapshot.org/#/venus-xvs.eth/proposal/0x62440d98cb7513d4873662203b7a27f9441880afa73105c55a733005de7ac9a1)). After the execution, it will be possible to send XVS from Optimism to any supported network and vice versa. + +Moreover, if passed, this VIP will perform the following actions: + +- Transfer the ownership of the [XVSVault on Optimism](https://optimistic.etherscan.io/address/0x133120607C018c949E91AE333785519F6d947e01) to the [Guardian wallet](https://optimistic.etherscan.io/address/0x2e94dd14E81999CdBF5deDE31938beD7308354b3) +- Configure (and pause) the vault accepting [XVS tokens on Optimism](https://optimistic.etherscan.io/address/0x4a971e87ad1F61f7f3081645f52a99277AE917cF), so no deposits will be accepted yet + +#### Description + +If passed, this VIP will perform the following actions, following the [Chaos labs recommendations](https://community.venus.io/t/deploy-venus-protocol-on-op-mainnet/4512/9): + +- Link the [bridge contract on Optimism](https://optimistic.etherscan.io/address/0xbBe46bAec851355c3FC4856914c47eB6Cea0B8B4) with the bridges on the different supported networks, setting the trustworthiness relationships +- Configuration of limits (they could be updated in the future with a new VIP): + - Maximum bridged XVS in a single transaction: 20,000 USD + - Maximum bridged XVS in 24 hours: 100,000 USD + - Mintable XVS on Arbitrum: 500,000 XVS +- Governance is whitelisted, so it could bridge any amount of XVS to/from Optimism + +The bridge contracts use LayerZero, specifically the [Omnichain Fungible Token V2 standard](https://layerzero.gitbook.io/docs/evm-guides/layerzero-omnichain-contracts/oft/oftv2): + +- BNB chain → Optimism: XVS tokens are locked in BNB Chain bridge contract, and minted on Optimism +- Optimism → BNB chain: XVS tokens are burnt on Optimism, and released on BNB Chain +- Optimism ↔ rest of the networks: XVS tokens are burnt on the source network, and minted on the destination network + +The Venus UI includes a section to allow the bridge of XVS tokens from a web user interface. A detailed technical guide is provided in the [Venus official documentation site](https://docs-v4.venus.io/technical-reference/reference-technical-articles/xvs-bridge), to bridge XVS tokens directly interacting with the contracts. + +#### Security and additional considerations + +We applied the following security procedures for this upgrade: + +- **Audits:** [Certik](https://www.certik.com/), [Peckshield](https://peckshield.com/) and [Quantstamp](https://quantstamp.com/) have audited the deployed code related to the bridge. Moreover, the [LayerZero](https://layerzero.network/) team reviewed the design and the code directly related to the bridge. Certik, Quantstamp and [Fairyproof](https://www.fairyproof.com/) have audited the code of the XVSVault on Optimism. +- **VIP execution simulation**: in a simulation environment, validating the bridge is properly configured after the execution +- **Deployment on testnet**: the same bridge has been deployed to testnet, and used in the Venus Protocol testnet environment + +#### Audit reports + +- Bridge + - [Certik audit report](https://github.com/VenusProtocol/token-bridge/blob/323e95fa3c0167cca2fc1d2807e911e0bae54de9/audits/083_multichain_token_bridge_certik_20231226.pdf) (2023/December/26) + - [Quantstamp audit report](https://github.com/VenusProtocol/token-bridge/blob/323e95fa3c0167cca2fc1d2807e911e0bae54de9/audits/064_multichain_token_bridge_quantstamp_20231219.pdf) (2023/December/19) + - [Peckshield audit report](https://github.com/VenusProtocol/token-bridge/blob/04b0a8526bb2fa916785c41eefd94b4f84c12819/audits/079_multichain_token_bridge_peckshield_20231020.pdf) (2023/October/20) +- XVS Vault + - [Certik audit audit report](https://github.com/VenusProtocol/isolated-pools/blob/aa1f7ae61b07839231ec16e9c4143905785d7aae/audits/088_timeBased_certik_20240117.pdf) (2024/01/17) + - [Quantstamp audit audit report](https://github.com/VenusProtocol/isolated-pools/blob/470416836922656783eab52ded54744489e8c345/audits/089_timeBased_quantstamp_20240319.pdf) (2024/03/19) + - [Fairyproof audit report](https://github.com/VenusProtocol/isolated-pools/blob/aa1f7ae61b07839231ec16e9c4143905785d7aae/audits/094_timeBased_fairyproof_20240304.pdf) (2024/03/04) + +#### Deployed contracts on Optimism + +- XVSBridgeAdmin: [0x3c307DF1Bf3198a2417d9CA86806B307D147Ddf7](https://optimistic.etherscan.io/address/0x3c307DF1Bf3198a2417d9CA86806B307D147Ddf7) +- XVSProxyOFTDest: [0xbBe46bAec851355c3FC4856914c47eB6Cea0B8B4](https://optimistic.etherscan.io/address/0xbBe46bAec851355c3FC4856914c47eB6Cea0B8B4) +- XVS: [0x4a971e87ad1F61f7f3081645f52a99277AE917cF](https://optimistic.etherscan.io/address/0x4a971e87ad1F61f7f3081645f52a99277AE917cF) +- XVSVaultProxy: [0x133120607C018c949E91AE333785519F6d947e01](https://optimistic.etherscan.io/address/0x133120607C018c949E91AE333785519F6d947e01) +- XVSVault (implementation): [0x8B8651EEB002a7991F2287500B17a395E8cfe7d9](https://optimistic.etherscan.io/address/0x8B8651EEB002a7991F2287500B17a395E8cfe7d9) +- Guardian: [0x2e94dd14E81999CdBF5deDE31938beD7308354b3](https://optimistic.etherscan.io/address/0x2e94dd14E81999CdBF5deDE31938beD7308354b3) + +#### Bridge contract on the rest of supported networks + +- [Ethereum](https://etherscan.io/address/0x888E317606b4c590BBAD88653863e8B345702633) +- [BNB Chain](https://bscscan.com/address/0xf8F46791E3dB29a029Ec6c9d946226f3c613e854) +- [opBNB](https://opbnbscan.com/address/0x100D331C1B5Dcd41eACB1eCeD0e83DCEbf3498B2) +- [Arbitrum one](https://arbiscan.io/address/0x20cEa49B5F7a6DBD78cAE772CA5973eF360AA1e6) +- [zkSync Era](https://explorer.zksync.io/address/0x16a62B534e09A7534CD5847CFE5Bf6a4b0c1B116) + +#### References + +- [Repository](https://github.com/VenusProtocol/token-bridge) +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/371) +- [Chaos labs recommendations about the deployment on Optimism](https://community.venus.io/t/deploy-venus-protocol-on-op-mainnet/4512/9) +- [Documentation](https://docs-v4.venus.io/technical-reference/reference-technical-articles/xvs-bridge) + +#### Disclaimer for Ethereum, opBNB, Arbitrum one, zkSync Era and Optimism commands + +Privilege commands on Ethereum, opBNB, Arbitrum one, zkSync Era and Optimism will be executed by the Guardian wallets ([Ethereum](https://etherscan.io/address/0x285960C5B22fD66A736C7136967A3eB15e93CC67), [opBNB](https://opbnbscan.com/address/0xC46796a21a3A9FAB6546aF3434F2eBfFd0604207), [Arbitrum one](https://arbiscan.io/address/0x14e0e151b33f9802b3e75b621c1457afc44dcaa0), [zkSync Era](https://explorer.zksync.io/address/0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa), [Optimism](https://optimistic.etherscan.io/address/0x2e94dd14E81999CdBF5deDE31938beD7308354b3)), until the [Multichain Governance](https://docs-v4.venus.io/technical-reference/reference-technical-articles/multichain-governance) contracts are fully enabled. If this VIP passes, the following multisig transactions will be executed. Otherwise, they will be rejected. + +- Bridge configuration: + - [Ethereum](https://app.safe.global/transactions/tx?safe=eth:0x285960C5B22fD66A736C7136967A3eB15e93CC67&id=multisig_0x285960C5B22fD66A736C7136967A3eB15e93CC67_0xe03db7e074ae8e6b80816cbbdfc722cb479e0014e576283876b7f5b6d02647a4) + - [opBNB](https://multisig.bnbchain.org/transactions/tx?safe=opbnb:0xC46796a21a3A9FAB6546aF3434F2eBfFd0604207&id=multisig_0xC46796a21a3A9FAB6546aF3434F2eBfFd0604207_0xe17a2249f96048b552d39f216a0994505f3b5fea2474de995d66157ba407a491) + - [Arbitrum one](https://app.safe.global/transactions/tx?safe=arb1:0x14e0E151b33f9802b3e75b621c1457afc44DcAA0&id=multisig_0x14e0E151b33f9802b3e75b621c1457afc44DcAA0_0x2427af46e5783b574534eac23c3555098eb9278e80bfe634202e1c8937ca82fc) + - [zkSync Era](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x66dd8db8094edf6e913d52577719126324c6c42abc4d25adae4716ee418eecfa) + - [Optimism](https://app.safe.global/transactions/tx?safe=oeth:0x2e94dd14E81999CdBF5deDE31938beD7308354b3&id=multisig_0x2e94dd14E81999CdBF5deDE31938beD7308354b3_0x4633de15140a675b794b6620d93915364d025971a081f04e1a079d5764fa97f3) +- XVS Vault configuration + - [Optimism](https://app.safe.global/transactions/tx?safe=oeth:0x2e94dd14E81999CdBF5deDE31938beD7308354b3&id=multisig_0x2e94dd14E81999CdBF5deDE31938beD7308354b3_0x2f416e75707a46e8c831d8ecd92236c47e2ff3584be203059c696cca469a7bcb) +`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: XVS_BRIDGE_ADMIN, + signature: "setTrustedRemoteAddress(uint16,bytes)", + params: [LzChainId.opmainnet, OP_MAINNET_TRUSTED_REMOTE], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMinDstGas(uint16,uint16,uint256)", + params: [LzChainId.opmainnet, 0, MIN_DST_GAS], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opmainnet, SINGLE_RECEIVE_LIMIT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip374; diff --git a/vips/vip-364/bsctestnet.ts b/vips/vip-374/bsctestnet.ts similarity index 95% rename from vips/vip-364/bsctestnet.ts rename to vips/vip-374/bsctestnet.ts index bb1ad2625..6c0c2d711 100644 --- a/vips/vip-364/bsctestnet.ts +++ b/vips/vip-374/bsctestnet.ts @@ -12,10 +12,10 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; -const vip364 = () => { +const vip374 = () => { const meta = { version: "v2", - title: "VIP-364 Enable BSC -> OP sepolia bridge", + title: "VIP-374 Enable BSC -> OP sepolia bridge", description: `#### Summary Enable BSC -> ZKSYNC bridge`, forDescription: "I agree that Venus Protocol should proceed with this proposal", againstDescription: "I do not think that Venus Protocol should proceed with this proposal", @@ -60,4 +60,4 @@ const vip364 = () => { ); }; -export default vip364; +export default vip374; From 680053c2802454b3bf4b4ecf602b8d7c4e2f61b3 Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Thu, 26 Sep 2024 18:22:01 +0300 Subject: [PATCH 23/24] feat: update tx nonces --- .../proposals/arbitrumone/{vip-014 => vip-016}/index.ts | 4 ++-- .../proposals/arbitrumsepolia/{vip-014 => vip-016}/index.ts | 4 ++-- multisig/proposals/ethereum/{vip-060 => vip-062}/index.ts | 4 ++-- .../proposals/opbnbmainnet/{vip-021 => vip-022}/index.ts | 4 ++-- .../proposals/opbnbtestnet/{vip-021 => vip-022}/index.ts | 4 ++-- multisig/proposals/sepolia/{vip-060 => vip-062}/index.ts | 4 ++-- .../proposals/zksyncmainnet/{vip-010 => vip-011}/index.ts | 4 ++-- .../proposals/zksyncsepolia/{vip-010 => vip-011}/index.ts | 4 ++-- .../arbitrumone/{vip-014 => vip-016}/abi/xvs.json | 0 .../{vip-014 => vip-016}/abi/xvsProxyOFTDest.json | 0 .../simulations/arbitrumone/{vip-014 => vip-016}/index.ts | 6 +++--- .../arbitrumsepolia/{vip-014 => vip-016}/abi/xvs.json | 0 .../{vip-014 => vip-016}/abi/xvsProxyOFTDest.json | 0 .../arbitrumsepolia/{vip-014 => vip-016}/index.ts | 6 +++--- .../simulations/ethereum/{vip-060 => vip-062}/abi/xvs.json | 0 .../ethereum/{vip-060 => vip-062}/abi/xvsProxyOFTDest.json | 0 multisig/simulations/ethereum/{vip-060 => vip-062}/index.ts | 6 +++--- .../opbnbmainnet/{vip-021 => vip-022}/abi/xvs.json | 0 .../{vip-021 => vip-022}/abi/xvsProxyOFTDest.json | 0 .../simulations/opbnbmainnet/{vip-021 => vip-022}/index.ts | 6 +++--- .../opbnbtestnet/{vip-021 => vip-022}/abi/xvs.json | 0 .../{vip-021 => vip-022}/abi/xvsProxyOFTDest.json | 0 .../simulations/opbnbtestnet/{vip-021 => vip-022}/index.ts | 6 +++--- .../simulations/sepolia/{vip-060 => vip-062}/abi/xvs.json | 0 .../sepolia/{vip-060 => vip-062}/abi/xvsProxyOFTDest.json | 0 multisig/simulations/sepolia/{vip-060 => vip-062}/index.ts | 6 +++--- .../zksyncmainnet/{vip-010 => vip-011}/abi/xvs.json | 0 .../{vip-010 => vip-011}/abi/xvsProxyOFTDest.json | 0 .../simulations/zksyncmainnet/{vip-010 => vip-011}/index.ts | 6 +++--- .../zksyncsepolia/{vip-010 => vip-011}/abi/xvs.json | 0 .../{vip-010 => vip-011}/abi/xvsProxyOFTDest.json | 0 .../simulations/zksyncsepolia/{vip-010 => vip-011}/index.ts | 6 +++--- 32 files changed, 40 insertions(+), 40 deletions(-) rename multisig/proposals/arbitrumone/{vip-014 => vip-016}/index.ts (97%) rename multisig/proposals/arbitrumsepolia/{vip-014 => vip-016}/index.ts (97%) rename multisig/proposals/ethereum/{vip-060 => vip-062}/index.ts (97%) rename multisig/proposals/opbnbmainnet/{vip-021 => vip-022}/index.ts (97%) rename multisig/proposals/opbnbtestnet/{vip-021 => vip-022}/index.ts (97%) rename multisig/proposals/sepolia/{vip-060 => vip-062}/index.ts (97%) rename multisig/proposals/zksyncmainnet/{vip-010 => vip-011}/index.ts (97%) rename multisig/proposals/zksyncsepolia/{vip-010 => vip-011}/index.ts (97%) rename multisig/simulations/arbitrumone/{vip-014 => vip-016}/abi/xvs.json (100%) rename multisig/simulations/arbitrumone/{vip-014 => vip-016}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/arbitrumone/{vip-014 => vip-016}/index.ts (97%) rename multisig/simulations/arbitrumsepolia/{vip-014 => vip-016}/abi/xvs.json (100%) rename multisig/simulations/arbitrumsepolia/{vip-014 => vip-016}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/arbitrumsepolia/{vip-014 => vip-016}/index.ts (97%) rename multisig/simulations/ethereum/{vip-060 => vip-062}/abi/xvs.json (100%) rename multisig/simulations/ethereum/{vip-060 => vip-062}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/ethereum/{vip-060 => vip-062}/index.ts (97%) rename multisig/simulations/opbnbmainnet/{vip-021 => vip-022}/abi/xvs.json (100%) rename multisig/simulations/opbnbmainnet/{vip-021 => vip-022}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/opbnbmainnet/{vip-021 => vip-022}/index.ts (97%) rename multisig/simulations/opbnbtestnet/{vip-021 => vip-022}/abi/xvs.json (100%) rename multisig/simulations/opbnbtestnet/{vip-021 => vip-022}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/opbnbtestnet/{vip-021 => vip-022}/index.ts (97%) rename multisig/simulations/sepolia/{vip-060 => vip-062}/abi/xvs.json (100%) rename multisig/simulations/sepolia/{vip-060 => vip-062}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/sepolia/{vip-060 => vip-062}/index.ts (97%) rename multisig/simulations/zksyncmainnet/{vip-010 => vip-011}/abi/xvs.json (100%) rename multisig/simulations/zksyncmainnet/{vip-010 => vip-011}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/zksyncmainnet/{vip-010 => vip-011}/index.ts (97%) rename multisig/simulations/zksyncsepolia/{vip-010 => vip-011}/abi/xvs.json (100%) rename multisig/simulations/zksyncsepolia/{vip-010 => vip-011}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/zksyncsepolia/{vip-010 => vip-011}/index.ts (97%) diff --git a/multisig/proposals/arbitrumone/vip-014/index.ts b/multisig/proposals/arbitrumone/vip-016/index.ts similarity index 97% rename from multisig/proposals/arbitrumone/vip-014/index.ts rename to multisig/proposals/arbitrumone/vip-016/index.ts index 05bcc3a21..9f7ee906a 100644 --- a/multisig/proposals/arbitrumone/vip-014/index.ts +++ b/multisig/proposals/arbitrumone/vip-016/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; -const vip021 = () => { +const vip016 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip021 = () => { ]); }; -export default vip021; +export default vip016; diff --git a/multisig/proposals/arbitrumsepolia/vip-014/index.ts b/multisig/proposals/arbitrumsepolia/vip-016/index.ts similarity index 97% rename from multisig/proposals/arbitrumsepolia/vip-014/index.ts rename to multisig/proposals/arbitrumsepolia/vip-016/index.ts index 43560a24f..638d9e7b9 100644 --- a/multisig/proposals/arbitrumsepolia/vip-014/index.ts +++ b/multisig/proposals/arbitrumsepolia/vip-016/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; -const vip014 = () => { +const vip016 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip014 = () => { ]); }; -export default vip014; +export default vip016; diff --git a/multisig/proposals/ethereum/vip-060/index.ts b/multisig/proposals/ethereum/vip-062/index.ts similarity index 97% rename from multisig/proposals/ethereum/vip-060/index.ts rename to multisig/proposals/ethereum/vip-062/index.ts index 6daa66d50..633fc227a 100644 --- a/multisig/proposals/ethereum/vip-060/index.ts +++ b/multisig/proposals/ethereum/vip-062/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; -const vip060 = () => { +const vip062 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip060 = () => { ]); }; -export default vip060; +export default vip062; diff --git a/multisig/proposals/opbnbmainnet/vip-021/index.ts b/multisig/proposals/opbnbmainnet/vip-022/index.ts similarity index 97% rename from multisig/proposals/opbnbmainnet/vip-021/index.ts rename to multisig/proposals/opbnbmainnet/vip-022/index.ts index ccee757ab..daf5f6752 100644 --- a/multisig/proposals/opbnbmainnet/vip-021/index.ts +++ b/multisig/proposals/opbnbmainnet/vip-022/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; -const vip021 = () => { +const vip022 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip021 = () => { ]); }; -export default vip021; +export default vip022; diff --git a/multisig/proposals/opbnbtestnet/vip-021/index.ts b/multisig/proposals/opbnbtestnet/vip-022/index.ts similarity index 97% rename from multisig/proposals/opbnbtestnet/vip-021/index.ts rename to multisig/proposals/opbnbtestnet/vip-022/index.ts index fd2cb7c22..fa5f66a65 100644 --- a/multisig/proposals/opbnbtestnet/vip-021/index.ts +++ b/multisig/proposals/opbnbtestnet/vip-022/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; -const vip021 = () => { +const vip022 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip021 = () => { ]); }; -export default vip021; +export default vip022; diff --git a/multisig/proposals/sepolia/vip-060/index.ts b/multisig/proposals/sepolia/vip-062/index.ts similarity index 97% rename from multisig/proposals/sepolia/vip-060/index.ts rename to multisig/proposals/sepolia/vip-062/index.ts index ae4ed4cce..ed29ea1a3 100644 --- a/multisig/proposals/sepolia/vip-060/index.ts +++ b/multisig/proposals/sepolia/vip-062/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; -const vip060 = () => { +const vip062 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip060 = () => { ]); }; -export default vip060; +export default vip062; diff --git a/multisig/proposals/zksyncmainnet/vip-010/index.ts b/multisig/proposals/zksyncmainnet/vip-011/index.ts similarity index 97% rename from multisig/proposals/zksyncmainnet/vip-010/index.ts rename to multisig/proposals/zksyncmainnet/vip-011/index.ts index fdcacd721..aaa302c12 100644 --- a/multisig/proposals/zksyncmainnet/vip-010/index.ts +++ b/multisig/proposals/zksyncmainnet/vip-011/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("20400", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); export const OP_MAINNET_TRUSTED_REMOTE = "0xbbe46baec851355c3fc4856914c47eb6cea0b8b4"; -const vip010 = () => { +const vip011 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip010 = () => { ]); }; -export default vip010; +export default vip011; diff --git a/multisig/proposals/zksyncsepolia/vip-010/index.ts b/multisig/proposals/zksyncsepolia/vip-011/index.ts similarity index 97% rename from multisig/proposals/zksyncsepolia/vip-010/index.ts rename to multisig/proposals/zksyncsepolia/vip-011/index.ts index b12398b0b..f32dfd93f 100644 --- a/multisig/proposals/zksyncsepolia/vip-010/index.ts +++ b/multisig/proposals/zksyncsepolia/vip-011/index.ts @@ -11,7 +11,7 @@ export const SINGLE_RECEIVE_LIMIT = parseUnits("10200", 18); export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("51000", 18); export const OP_SEPOLIA_TRUSTED_REMOTE = "0x79a36dc9a43d05db4747c59c02f48ed500e47df1"; -const vip010 = () => { +const vip011 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -46,4 +46,4 @@ const vip010 = () => { ]); }; -export default vip010; +export default vip011; diff --git a/multisig/simulations/arbitrumone/vip-014/abi/xvs.json b/multisig/simulations/arbitrumone/vip-016/abi/xvs.json similarity index 100% rename from multisig/simulations/arbitrumone/vip-014/abi/xvs.json rename to multisig/simulations/arbitrumone/vip-016/abi/xvs.json diff --git a/multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json b/multisig/simulations/arbitrumone/vip-016/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json rename to multisig/simulations/arbitrumone/vip-016/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/arbitrumone/vip-014/index.ts b/multisig/simulations/arbitrumone/vip-016/index.ts similarity index 97% rename from multisig/simulations/arbitrumone/vip-014/index.ts rename to multisig/simulations/arbitrumone/vip-016/index.ts index 3ca625420..6a7ade686 100644 --- a/multisig/simulations/arbitrumone/vip-014/index.ts +++ b/multisig/simulations/arbitrumone/vip-016/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip014, { +import vip016, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_MAINNET_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/arbitrumone/vip-014"; +} from "../../../proposals/arbitrumone/vip-016"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -42,7 +42,7 @@ forking(255002300, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip014()); + await pretendExecutingVip(await vip016()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json b/multisig/simulations/arbitrumsepolia/vip-016/abi/xvs.json similarity index 100% rename from multisig/simulations/arbitrumsepolia/vip-014/abi/xvs.json rename to multisig/simulations/arbitrumsepolia/vip-016/abi/xvs.json diff --git a/multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json b/multisig/simulations/arbitrumsepolia/vip-016/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/arbitrumsepolia/vip-014/abi/xvsProxyOFTDest.json rename to multisig/simulations/arbitrumsepolia/vip-016/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/arbitrumsepolia/vip-014/index.ts b/multisig/simulations/arbitrumsepolia/vip-016/index.ts similarity index 97% rename from multisig/simulations/arbitrumsepolia/vip-014/index.ts rename to multisig/simulations/arbitrumsepolia/vip-016/index.ts index 3dd9c55c3..f735cd0da 100644 --- a/multisig/simulations/arbitrumsepolia/vip-014/index.ts +++ b/multisig/simulations/arbitrumsepolia/vip-016/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip014, { +import vip016, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_SEPOLIA_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/arbitrumsepolia/vip-014"; +} from "../../../proposals/arbitrumsepolia/vip-016"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -40,7 +40,7 @@ forking(79930177, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip014()); + await pretendExecutingVip(await vip016()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/ethereum/vip-060/abi/xvs.json b/multisig/simulations/ethereum/vip-062/abi/xvs.json similarity index 100% rename from multisig/simulations/ethereum/vip-060/abi/xvs.json rename to multisig/simulations/ethereum/vip-062/abi/xvs.json diff --git a/multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json b/multisig/simulations/ethereum/vip-062/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/ethereum/vip-060/abi/xvsProxyOFTDest.json rename to multisig/simulations/ethereum/vip-062/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/ethereum/vip-060/index.ts b/multisig/simulations/ethereum/vip-062/index.ts similarity index 97% rename from multisig/simulations/ethereum/vip-060/index.ts rename to multisig/simulations/ethereum/vip-062/index.ts index c071de5b3..21bc716f3 100644 --- a/multisig/simulations/ethereum/vip-060/index.ts +++ b/multisig/simulations/ethereum/vip-062/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip060, { +import vip062, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_MAINNET_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/ethereum/vip-060"; +} from "../../../proposals/ethereum/vip-062"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -42,7 +42,7 @@ forking(20781600, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip060()); + await pretendExecutingVip(await vip062()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json b/multisig/simulations/opbnbmainnet/vip-022/abi/xvs.json similarity index 100% rename from multisig/simulations/opbnbmainnet/vip-021/abi/xvs.json rename to multisig/simulations/opbnbmainnet/vip-022/abi/xvs.json diff --git a/multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json b/multisig/simulations/opbnbmainnet/vip-022/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json rename to multisig/simulations/opbnbmainnet/vip-022/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/opbnbmainnet/vip-021/index.ts b/multisig/simulations/opbnbmainnet/vip-022/index.ts similarity index 97% rename from multisig/simulations/opbnbmainnet/vip-021/index.ts rename to multisig/simulations/opbnbmainnet/vip-022/index.ts index 65daefd11..7cdbc749c 100644 --- a/multisig/simulations/opbnbmainnet/vip-021/index.ts +++ b/multisig/simulations/opbnbmainnet/vip-022/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip021, { +import vip022, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_MAINNET_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/opbnbmainnet/vip-021"; +} from "../../../proposals/opbnbmainnet/vip-022"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -42,7 +42,7 @@ forking(34960200, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip021()); + await pretendExecutingVip(await vip022()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json b/multisig/simulations/opbnbtestnet/vip-022/abi/xvs.json similarity index 100% rename from multisig/simulations/opbnbtestnet/vip-021/abi/xvs.json rename to multisig/simulations/opbnbtestnet/vip-022/abi/xvs.json diff --git a/multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json b/multisig/simulations/opbnbtestnet/vip-022/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/opbnbtestnet/vip-021/abi/xvsProxyOFTDest.json rename to multisig/simulations/opbnbtestnet/vip-022/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/opbnbtestnet/vip-021/index.ts b/multisig/simulations/opbnbtestnet/vip-022/index.ts similarity index 97% rename from multisig/simulations/opbnbtestnet/vip-021/index.ts rename to multisig/simulations/opbnbtestnet/vip-022/index.ts index 723fa0a40..15b0aa769 100644 --- a/multisig/simulations/opbnbtestnet/vip-021/index.ts +++ b/multisig/simulations/opbnbtestnet/vip-022/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip021, { +import vip022, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_SEPOLIA_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/opbnbtestnet/vip-021"; +} from "../../../proposals/opbnbtestnet/vip-022"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -40,7 +40,7 @@ forking(39286132, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip021()); + await pretendExecutingVip(await vip022()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/sepolia/vip-060/abi/xvs.json b/multisig/simulations/sepolia/vip-062/abi/xvs.json similarity index 100% rename from multisig/simulations/sepolia/vip-060/abi/xvs.json rename to multisig/simulations/sepolia/vip-062/abi/xvs.json diff --git a/multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json b/multisig/simulations/sepolia/vip-062/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/sepolia/vip-060/abi/xvsProxyOFTDest.json rename to multisig/simulations/sepolia/vip-062/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/sepolia/vip-060/index.ts b/multisig/simulations/sepolia/vip-062/index.ts similarity index 97% rename from multisig/simulations/sepolia/vip-060/index.ts rename to multisig/simulations/sepolia/vip-062/index.ts index 66ecc3eb4..c1f91efc2 100644 --- a/multisig/simulations/sepolia/vip-060/index.ts +++ b/multisig/simulations/sepolia/vip-062/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip060, { +import vip062, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_SEPOLIA_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/sepolia/vip-060"; +} from "../../../proposals/sepolia/vip-062"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -40,7 +40,7 @@ forking(6679071, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip060()); + await pretendExecutingVip(await vip062()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json b/multisig/simulations/zksyncmainnet/vip-011/abi/xvs.json similarity index 100% rename from multisig/simulations/zksyncmainnet/vip-010/abi/xvs.json rename to multisig/simulations/zksyncmainnet/vip-011/abi/xvs.json diff --git a/multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json b/multisig/simulations/zksyncmainnet/vip-011/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/zksyncmainnet/vip-010/abi/xvsProxyOFTDest.json rename to multisig/simulations/zksyncmainnet/vip-011/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/zksyncmainnet/vip-010/index.ts b/multisig/simulations/zksyncmainnet/vip-011/index.ts similarity index 97% rename from multisig/simulations/zksyncmainnet/vip-010/index.ts rename to multisig/simulations/zksyncmainnet/vip-011/index.ts index 7e8c759a1..9c3f47cd2 100644 --- a/multisig/simulations/zksyncmainnet/vip-010/index.ts +++ b/multisig/simulations/zksyncmainnet/vip-011/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip010, { +import vip011, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_MAINNET_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/zksyncmainnet/vip-010"; +} from "../../../proposals/zksyncmainnet/vip-011"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -42,7 +42,7 @@ forking(44548900, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip010()); + await pretendExecutingVip(await vip011()); }); it("Should match trusted remote address", async () => { diff --git a/multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json b/multisig/simulations/zksyncsepolia/vip-011/abi/xvs.json similarity index 100% rename from multisig/simulations/zksyncsepolia/vip-010/abi/xvs.json rename to multisig/simulations/zksyncsepolia/vip-011/abi/xvs.json diff --git a/multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json b/multisig/simulations/zksyncsepolia/vip-011/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/zksyncsepolia/vip-010/abi/xvsProxyOFTDest.json rename to multisig/simulations/zksyncsepolia/vip-011/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/zksyncsepolia/vip-010/index.ts b/multisig/simulations/zksyncsepolia/vip-011/index.ts similarity index 97% rename from multisig/simulations/zksyncsepolia/vip-010/index.ts rename to multisig/simulations/zksyncsepolia/vip-011/index.ts index aec3161de..26b6853ab 100644 --- a/multisig/simulations/zksyncsepolia/vip-010/index.ts +++ b/multisig/simulations/zksyncsepolia/vip-011/index.ts @@ -7,13 +7,13 @@ import { LzChainId } from "src/types"; import { initMainnetUser } from "src/utils"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip010, { +import vip011, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, OP_SEPOLIA_TRUSTED_REMOTE, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/zksyncsepolia/vip-010"; +} from "../../../proposals/zksyncsepolia/vip-011"; import XVS_ABI from "./abi/xvs.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; @@ -38,7 +38,7 @@ forking(3768148, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip010()); + await pretendExecutingVip(await vip011()); }); it("Should match trusted remote address", async () => { From 8e6165a91cdbd8c31a297b195601ac15a31f7f89 Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Fri, 27 Sep 2024 13:20:07 +0200 Subject: [PATCH 24/24] chore: remove duplicated entry --- src/networkAddresses.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index a9c6c3b42..42c5e1f31 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -195,15 +195,6 @@ export const NETWORK_ADDRESSES = { CHAINLINK_ORACLE: "0x493C3f543AEa37EefF17D823f27Cb1feAB9f3143", POOL_REGISTRY: "0x6538C861C7A6997602311342657b9143dD9E8152", }, - opmainnet: { - NORMAL_TIMELOCK: "", // To be deployed - VTREASURY: "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da", - GUARDIAN: "0x2e94dd14E81999CdBF5deDE31938beD7308354b3", - RESILIENT_ORACLE: "0x21FC48569bd3a6623281f55FC1F8B48B9386907b", - CHAINLINK_ORACLE: "0x1076e5A60F1aC98e6f361813138275F1179BEb52", - REDSTONE_ORACLE: "0x7478e4656F6CCDCa147B6A7314fF68d0C144751a", - XVS: "0x4a971e87ad1F61f7f3081645f52a99277AE917cF", - }, opmainnet: { NORMAL_TIMELOCK: "", // To be deployed VTREASURY: "0x104c01EB7b4664551BE6A9bdB26a8C5c6Be7d3da",