From a859caec8ac509e0615a63787970a4b395aca02b Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:48:23 +0530 Subject: [PATCH 1/6] feat: add vip to increases XVS bridge limit for zksyncmainnet --- .env.example | 2 - .../proposals/arbitrumone/vip-014/index.ts | 35 + multisig/proposals/ethereum/vip-061/index.ts | 35 + .../proposals/opbnbmainnet/vip-021/index.ts | 35 + .../proposals/zksyncmainnet/vip-009/index.ts | 77 + .../vip-014/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/arbitrumone/vip-014/index.ts | 71 + .../ethereum/vip-061/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/ethereum/vip-061/index.ts | 71 + .../vip-021/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../simulations/opbnbmainnet/vip-021/index.ts | 71 + .../vip-009/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ .../zksyncmainnet/vip-009/index.ts | 146 ++ simulations/vip-371/abi/xvsProxyOFTDest.json | 1729 +++++++++++++++++ simulations/vip-371/bscmainnet.ts | 84 + vips/vip-371/bscmainnet.ts | 47 + 16 files changed, 9317 insertions(+), 2 deletions(-) create mode 100644 multisig/proposals/arbitrumone/vip-014/index.ts create mode 100644 multisig/proposals/ethereum/vip-061/index.ts create mode 100644 multisig/proposals/opbnbmainnet/vip-021/index.ts create mode 100644 multisig/proposals/zksyncmainnet/vip-009/index.ts create mode 100644 multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/arbitrumone/vip-014/index.ts create mode 100644 multisig/simulations/ethereum/vip-061/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/ethereum/vip-061/index.ts create mode 100644 multisig/simulations/opbnbmainnet/vip-021/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/opbnbmainnet/vip-021/index.ts create mode 100644 multisig/simulations/zksyncmainnet/vip-009/abi/xvsProxyOFTDest.json create mode 100644 multisig/simulations/zksyncmainnet/vip-009/index.ts create mode 100644 simulations/vip-371/abi/xvsProxyOFTDest.json create mode 100644 simulations/vip-371/bscmainnet.ts create mode 100644 vips/vip-371/bscmainnet.ts diff --git a/.env.example b/.env.example index 465a1bb25..797a74806 100644 --- a/.env.example +++ b/.env.example @@ -11,8 +11,6 @@ ARCHIVE_NODE_opbnbtestnet=https://opbnb-testnet.nodereal.io/v1/ ARCHIVE_NODE_opbnbmainnet=https://opbnb-mainnet.nodereal.io/v1/ ARCHIVE_NODE_arbitrumsepolia=https://sepolia-rollup.arbitrum.io/rpc ARCHIVE_NODE_arbitrumone=https://open-platform.nodereal.io//arbitrum-nitro/ -ARCHIVE_NODE_xlayertestnet=https://rpc.ankr.com/xlayer_testnet/ -ARCHIVE_NODE_xlayermainnet=https://rpc.ankr.com/xlayer ACHIVE_NODE_zksyncsepolia=https://zksync-sepolia.g.alchemy.com/v2/ ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io//zksync ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io diff --git a/multisig/proposals/arbitrumone/vip-014/index.ts b/multisig/proposals/arbitrumone/vip-014/index.ts new file mode 100644 index 000000000..07a298204 --- /dev/null +++ b/multisig/proposals/arbitrumone/vip-014/index.ts @@ -0,0 +1,35 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0xf5d81C6F7DAA3F97A6265C8441f92eFda22Ad784"; +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); + +const vip014 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; +export default vip014; diff --git a/multisig/proposals/ethereum/vip-061/index.ts b/multisig/proposals/ethereum/vip-061/index.ts new file mode 100644 index 000000000..ef9cd5ef1 --- /dev/null +++ b/multisig/proposals/ethereum/vip-061/index.ts @@ -0,0 +1,35 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x9C6C95632A8FB3A74f2fB4B7FfC50B003c992b96"; +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); + +const vip061 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; +export default vip061; diff --git a/multisig/proposals/opbnbmainnet/vip-021/index.ts b/multisig/proposals/opbnbmainnet/vip-021/index.ts new file mode 100644 index 000000000..95552f33f --- /dev/null +++ b/multisig/proposals/opbnbmainnet/vip-021/index.ts @@ -0,0 +1,35 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x52fcE05aDbf6103d71ed2BA8Be7A317282731831"; +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); + +const vip021 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; +export default vip021; diff --git a/multisig/proposals/zksyncmainnet/vip-009/index.ts b/multisig/proposals/zksyncmainnet/vip-009/index.ts new file mode 100644 index 000000000..f3759db62 --- /dev/null +++ b/multisig/proposals/zksyncmainnet/vip-009/index.ts @@ -0,0 +1,77 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x2471043F05Cc41A6051dd6714DC967C7BfC8F902"; +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); + +const vip009 = () => { + return makeProposal([ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.arbitrumone, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.arbitrumone, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.arbitrumone, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.arbitrumone, SINGLE_RECEIVE_LIMIT], + }, + + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.ethereum, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.ethereum, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.ethereum, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.ethereum, SINGLE_RECEIVE_LIMIT], + }, + + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.opbnbmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.opbnbmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.opbnbmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.opbnbmainnet, SINGLE_RECEIVE_LIMIT], + }, + ]); +}; +export default vip009; 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..384b133f8 --- /dev/null +++ b/multisig/simulations/arbitrumone/vip-014/index.ts @@ -0,0 +1,71 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip014, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/arbitrumone/vip-014"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0x20cEa49B5F7a6DBD78cAE772CA5973eF360AA1e6"; + +forking(256537654, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip014()); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); diff --git a/multisig/simulations/ethereum/vip-061/abi/xvsProxyOFTDest.json b/multisig/simulations/ethereum/vip-061/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/ethereum/vip-061/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-061/index.ts b/multisig/simulations/ethereum/vip-061/index.ts new file mode 100644 index 000000000..3229d4394 --- /dev/null +++ b/multisig/simulations/ethereum/vip-061/index.ts @@ -0,0 +1,71 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip061, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/ethereum/vip-061"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0x888E317606b4c590BBAD88653863e8B345702633"; + +forking(20813845, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip061()); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); 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..928b1608f --- /dev/null +++ b/multisig/simulations/opbnbmainnet/vip-021/index.ts @@ -0,0 +1,71 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip021, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/opbnbmainnet/vip-021"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0x100D331C1B5Dcd41eACB1eCeD0e83DCEbf3498B2"; + +forking(35347827, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip021()); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); diff --git a/multisig/simulations/zksyncmainnet/vip-009/abi/xvsProxyOFTDest.json b/multisig/simulations/zksyncmainnet/vip-009/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-009/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-009/index.ts b/multisig/simulations/zksyncmainnet/vip-009/index.ts new file mode 100644 index 000000000..facdf1d7c --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-009/index.ts @@ -0,0 +1,146 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { forking, pretendExecutingVip } from "src/vip-framework"; + +import vip009, { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, +} from "../../../proposals/zksyncmainnet/vip-009"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0x16a62B534e09A7534CD5847CFE5Bf6a4b0c1B116"; + +forking(44922167, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.arbitrumone)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.arbitrumone)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.arbitrumone)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.arbitrumone)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.ethereum)).to.equal(SINGLE_SEND_LIMIT.div(2)); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.ethereum)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.ethereum)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.ethereum)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opbnbmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opbnbmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opbnbmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opbnbmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip009()); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.arbitrumone)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.arbitrumone)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.arbitrumone)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.arbitrumone)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.ethereum)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.ethereum)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.ethereum)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.ethereum)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.opbnbmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.opbnbmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.opbnbmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.opbnbmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); diff --git a/simulations/vip-371/abi/xvsProxyOFTDest.json b/simulations/vip-371/abi/xvsProxyOFTDest.json new file mode 100644 index 000000000..5917469fd --- /dev/null +++ b/simulations/vip-371/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/simulations/vip-371/bscmainnet.ts b/simulations/vip-371/bscmainnet.ts new file mode 100644 index 000000000..1de6fb882 --- /dev/null +++ b/simulations/vip-371/bscmainnet.ts @@ -0,0 +1,84 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, + vip371, +} from "../../vips/vip-371/bscmainnet"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; + +forking(42508132, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + testVip("vip-371", await vip371(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [XVS_BRIDGE_ABI], + [ + "SetMaxSingleTransactionLimit", + "SetMaxDailyLimit", + "SetMaxSingleReceiveTransactionLimit", + "SetMaxDailyReceiveLimit", + ], + [1, 1, 1, 1], + ); + }, + }); + describe("Post-Execution state", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); diff --git a/vips/vip-371/bscmainnet.ts b/vips/vip-371/bscmainnet.ts new file mode 100644 index 000000000..e5dc85f27 --- /dev/null +++ b/vips/vip-371/bscmainnet.ts @@ -0,0 +1,47 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; +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 vip371 = () => { + const meta = { + version: "v2", + title: "VIP-371 Increase XVS bridge limit for ZKsync", + description: `#### Summary`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; From f58ca4855df6f872e1f834278c1045a487f93662 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:23:51 +0530 Subject: [PATCH 2/6] fix: convert into fasttrack --- vips/vip-370/bscmainnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vips/vip-370/bscmainnet.ts b/vips/vip-370/bscmainnet.ts index 2ad6b3fec..24f691621 100644 --- a/vips/vip-370/bscmainnet.ts +++ b/vips/vip-370/bscmainnet.ts @@ -436,7 +436,7 @@ The ownership of every contract has been transferred to Governance. }), ], meta, - ProposalType.REGULAR, + ProposalType.FAST_TRACK, ); }; From 381639aae3768522da855f3023a31d51c2cc60cc Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Mon, 23 Sep 2024 20:23:16 +0200 Subject: [PATCH 3/6] feat: add VIP to increase caps of new Liquid Staked ETH markets on BNB --- simulations/vip-371/abi/comptroller.json | 929 ++++++++++++++++++ simulations/vip-371/bscmainnet.ts | 134 +-- .../abi/xvsProxyOFTDest.json | 0 simulations/vip-372/bscmainnet.ts | 84 ++ vips/vip-371/bscmainnet.ts | 74 +- vips/vip-372/bscmainnet.ts | 47 + 6 files changed, 1178 insertions(+), 90 deletions(-) create mode 100644 simulations/vip-371/abi/comptroller.json rename simulations/{vip-371 => vip-372}/abi/xvsProxyOFTDest.json (100%) create mode 100644 simulations/vip-372/bscmainnet.ts create mode 100644 vips/vip-372/bscmainnet.ts diff --git a/simulations/vip-371/abi/comptroller.json b/simulations/vip-371/abi/comptroller.json new file mode 100644 index 000000000..56890d9b3 --- /dev/null +++ b/simulations/vip-371/abi/comptroller.json @@ -0,0 +1,929 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "poolRegistry_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" } + ], + "name": "ActionPaused", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedLessThanOrEqualTo", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { "inputs": [], "name": "ComptrollerMismatch", "type": "error" }, + { "inputs": [], "name": "DelegationStatusUnchanged", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "collateralToSeize", "type": "uint256" }, + { "internalType": "uint256", "name": "availableCollateral", "type": "uint256" } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { "inputs": [], "name": "InsufficientLiquidity", "type": "error" }, + { "inputs": [], "name": "InsufficientShortfall", "type": "error" }, + { "inputs": [], "name": "InvalidCollateralFactor", "type": "error" }, + { "inputs": [], "name": "InvalidLiquidationThreshold", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "MarketNotCollateral", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopsLimit", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredLoops", "type": "uint256" } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedGreaterThan", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { "inputs": [], "name": "NonzeroBorrowBalance", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "PriceError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "TooMuchRepay", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "expectedSender", "type": "address" }, + { "internalType": "address", "name": "actualSender", "type": "address" } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" }, + { "indexed": false, "internalType": "bool", "name": "pauseState", "type": "bool" } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "approver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLoopsLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newmaxLoopsLimit", "type": "uint256" } + ], + "name": "MaxLoopsLimitUpdated", + "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 VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldCloseFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldCollateralFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationIncentiveMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationThresholdMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableCollateral", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IPrime", "name": "oldPrimeToken", "type": "address" }, + { "indexed": false, "internalType": "contract IPrime", "name": "newPrimeToken", "type": "address" } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "NewSupplyCap", + "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" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "accountAssets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" } + ], + "name": "actionPaused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract RewardsDistributor", "name": "_rewardsDistributor", "type": "address" }], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "allMarkets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "approvedDelegates", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "borrowCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "contract VToken", "name": "vToken", "type": "address" } + ], + "name": "checkMembership", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "vTokens", "type": "address[]" }], + "name": "enterMarkets", + "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vTokenAddress", "type": "address" }], + "name": "exitMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAssetsIn", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getBorrowingPower", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "vTokenModify", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [{ "internalType": "contract RewardsDistributor[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "supplySpeed", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowSpeed", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopLimit", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isForcedLiquidationEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "isMarketListed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { + "components": [ + { "internalType": "contract VToken", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "contract VToken", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "tokensToSeize", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "markets", + "outputs": [ + { "internalType": "bool", "name": "isListed", "type": "bool" }, + { "internalType": "uint256", "name": "collateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThresholdMantissa", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "actualMintAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "mintVerify", + "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": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "seizerContract", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [{ "internalType": "contract IPrime", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowerIndex", "type": "uint256" } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "marketsList", "type": "address[]" }, + { "internalType": "enum ComptrollerStorage.Action[]", "name": "actionsList", "type": "uint8[]" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" }], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" }], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newBorrowCaps", "type": "uint256[]" } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newSupplyCaps", "type": "uint256[]" } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" }], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ResilientOracleInterface", "name": "newOracle", "type": "address" }], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IPrime", "name": "_prime", "type": "address" }], + "name": "setPrimeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "supplyCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "updatePrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-371/bscmainnet.ts b/simulations/vip-371/bscmainnet.ts index 1de6fb882..5accbc43e 100644 --- a/simulations/vip-371/bscmainnet.ts +++ b/simulations/vip-371/bscmainnet.ts @@ -1,84 +1,90 @@ import { expect } from "chai"; import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; -import { LzChainId } from "src/types"; -import { expectEvents } from "src/utils"; -import { forking, testVip } from "src/vip-framework"; +import { expectEvents, setMaxStaleCoreAssets } from "src/utils"; +import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; -import { - MAX_DAILY_RECEIVE_LIMIT, - MAX_DAILY_SEND_LIMIT, - SINGLE_RECEIVE_LIMIT, - SINGLE_SEND_LIMIT, - vip371, -} from "../../vips/vip-371/bscmainnet"; -import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; +import vip370 from "../../vips/vip-370/bscmainnet"; +import vip371, { COMPTROLLER, vETH, vweETH, vwstETH } from "../../vips/vip-371/bscmainnet"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; -const XVS_BRIDGE = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; +const CHAINLINK = "0x1B2103441A0A108daD8848D8F5d790e4D402921F"; -forking(42508132, async () => { - let xvsBridge: Contract; +const previousCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("450", 18), + borrowCap: parseUnits("400", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("400", 18), + borrowCap: parseUnits("200", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("50", 18), + borrowCap: parseUnits("5", 18), + }, +}; - before(async () => { - xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); - }); +const newCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("3600", 18), + borrowCap: parseUnits("3250", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("120", 18), + borrowCap: parseUnits("60", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("3200", 18), + borrowCap: parseUnits("320", 18), + }, +}; + +forking(42511365, async () => { + let comptrollerContract: Contract; - describe("Pre-Executing VIP", () => { - it("Should match single send transaction limit", async () => { - expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( - SINGLE_SEND_LIMIT.div(2), - ); - }); + before(async () => { + await pretendExecutingVip(await vip370({}), NORMAL_TIMELOCK); + comptrollerContract = new ethers.Contract(COMPTROLLER, COMPTROLLER_ABI, await ethers.getSigner(NORMAL_TIMELOCK)); - it("Should match single receive transaction limit", async () => { - expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( - SINGLE_RECEIVE_LIMIT.div(2), - ); - }); + await setMaxStaleCoreAssets(CHAINLINK, NORMAL_TIMELOCK); + }); - it("Should match max daily send limit", async () => { - expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); - }); + describe("Pre-VIP behavior", async () => { + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(previousCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); - it("Should match max daily receive limit", async () => { - expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( - MAX_DAILY_RECEIVE_LIMIT.div(2), - ); - }); + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } }); - testVip("vip-371", await vip371(), { + testVip("VIP-371", await vip371(), { callbackAfterExecution: async txResponse => { - await expectEvents( - txResponse, - [XVS_BRIDGE_ABI], - [ - "SetMaxSingleTransactionLimit", - "SetMaxDailyLimit", - "SetMaxSingleReceiveTransactionLimit", - "SetMaxDailyReceiveLimit", - ], - [1, 1, 1, 1], - ); + await expectEvents(txResponse, [COMPTROLLER_ABI], ["NewSupplyCap", "NewBorrowCap"], [3, 3]); }, }); - describe("Post-Execution state", () => { - it("Should match single send transaction limit", async () => { - expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); - }); - - it("Should match single receive transaction limit", async () => { - expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( - SINGLE_RECEIVE_LIMIT, - ); - }); - it("Should match max daily send limit", async () => { - expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); - }); + describe("Post-VIP behavior", async () => { + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(newCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); - it("Should match max daily receive limit", async () => { - expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); - }); + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } }); }); diff --git a/simulations/vip-371/abi/xvsProxyOFTDest.json b/simulations/vip-372/abi/xvsProxyOFTDest.json similarity index 100% rename from simulations/vip-371/abi/xvsProxyOFTDest.json rename to simulations/vip-372/abi/xvsProxyOFTDest.json diff --git a/simulations/vip-372/bscmainnet.ts b/simulations/vip-372/bscmainnet.ts new file mode 100644 index 000000000..7d7fe2c2a --- /dev/null +++ b/simulations/vip-372/bscmainnet.ts @@ -0,0 +1,84 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { LzChainId } from "src/types"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { + MAX_DAILY_RECEIVE_LIMIT, + MAX_DAILY_SEND_LIMIT, + SINGLE_RECEIVE_LIMIT, + SINGLE_SEND_LIMIT, + vip372, +} from "../../vips/vip-372/bscmainnet"; +import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; + +const XVS_BRIDGE = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; + +forking(42508132, async () => { + let xvsBridge: Contract; + + before(async () => { + xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + }); + + describe("Pre-Executing VIP", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_SEND_LIMIT.div(2), + ); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT.div(2), + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT.div(2)); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal( + MAX_DAILY_RECEIVE_LIMIT.div(2), + ); + }); + }); + + testVip("vip-372", await vip372(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [XVS_BRIDGE_ABI], + [ + "SetMaxSingleTransactionLimit", + "SetMaxDailyLimit", + "SetMaxSingleReceiveTransactionLimit", + "SetMaxDailyReceiveLimit", + ], + [1, 1, 1, 1], + ); + }, + }); + describe("Post-Execution state", () => { + it("Should match single send transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleTransactionLimit(LzChainId.zksyncmainnet)).to.equal(SINGLE_SEND_LIMIT); + }); + + it("Should match single receive transaction limit", async () => { + expect(await xvsBridge.chainIdToMaxSingleReceiveTransactionLimit(LzChainId.zksyncmainnet)).to.equal( + SINGLE_RECEIVE_LIMIT, + ); + }); + + it("Should match max daily send limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_SEND_LIMIT); + }); + + it("Should match max daily receive limit", async () => { + expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); + }); + }); +}); diff --git a/vips/vip-371/bscmainnet.ts b/vips/vip-371/bscmainnet.ts index e5dc85f27..f028b9009 100644 --- a/vips/vip-371/bscmainnet.ts +++ b/vips/vip-371/bscmainnet.ts @@ -1,18 +1,42 @@ import { parseUnits } from "ethers/lib/utils"; -import { LzChainId, ProposalType } from "src/types"; +import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; -const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; -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 vETH = "0xeCCACF760FEA7943C5b0285BD09F601505A29c05"; +export const vweETH = "0xc5b24f347254bD8cF8988913d1fd0F795274900F"; +export const vwstETH = "0x94180a3948296530024Ef7d60f60B85cfe0422c8"; +export const COMPTROLLER = "0xBE609449Eb4D76AD8545f957bBE04b596E8fC529"; +export const ETH_SUPPLY_CAP = parseUnits("3600", 18); +export const ETH_BORROW_CAP = parseUnits("3250", 18); +export const weETH_SUPPLY_CAP = parseUnits("120", 18); +export const weETH_BORROW_CAP = parseUnits("60", 18); +export const wstETH_SUPPLY_CAP = parseUnits("3200", 18); +export const wstETH_BORROW_CAP = parseUnits("320", 18); -export const vip371 = () => { +const vip371 = () => { const meta = { version: "v2", - title: "VIP-371 Increase XVS bridge limit for ZKsync", - description: `#### Summary`, + title: "VIP-371 [BNB] Risk Parameters Adjustments (ETH, wstETH, weETH)", + description: `This VIP will perform the following Risk Parameter actions as per Chaos Labs’ latest recommendations in this Venus community forum publication: [Chaos Labs - Risk Parameter Updates - 09/23/24](https://community.venus.io/t/support-lido-wsteth-token-in-a-new-venus-protocol-bnbchain-lst-eth-pool/4526/8). + +- [ETH (Liquid Staked ETH)](https://bscscan.com/address/0xeCCACF760FEA7943C5b0285BD09F601505A29c05) + - Increase supply cap from 450 ETH to 3,600 ETH + - Increase borrow cap from 400 ETH to 3,250 ETH +- [wstETH (Liquid Staked ETH)](https://bscscan.com/address/0x94180a3948296530024Ef7d60f60B85cfe0422c8) + - Increase supply cap from 50 wstETH to 3,200 wstETH + - Increase borrow cap from 5 wstETH to 320 wstETH +- [weETH (Liquid Staked ETH)](https://bscscan.com/address/0xc5b24f347254bD8cF8988913d1fd0F795274900F) + - Decrease supply cap from 400 weETH to 120 weETH + - Decrease borrow cap from 200 weETH to 60 weETH + +This VIP should be executed after executing the [VIP-370](https://app.venus.io/#/governance/proposal/370?chainId=56), where the affected markets will be enabled. + +Complete analysis and details of these recommendations are available in the above publication. + +#### References + +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/356) +- [VIP-370: Add Liquid Staked ETH pool to BNB chain](https://app.venus.io/#/governance/proposal/370?chainId=56)`, forDescription: "Execute this proposal", againstDescription: "Do not execute this proposal", abstainDescription: "Indifferent to execution", @@ -21,27 +45,25 @@ export const vip371 = () => { return makeProposal( [ { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxDailyLimit(uint16,uint256)", - params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + target: COMPTROLLER, + signature: "setMarketSupplyCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_SUPPLY_CAP, weETH_SUPPLY_CAP, wstETH_SUPPLY_CAP], + ], }, { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxSingleTransactionLimit(uint16,uint256)", - params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxDailyReceiveLimit(uint16,uint256)", - params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], - }, - { - target: XVS_BRIDGE_ADMIN, - signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", - params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + target: COMPTROLLER, + signature: "setMarketBorrowCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_BORROW_CAP, weETH_BORROW_CAP, wstETH_BORROW_CAP], + ], }, ], meta, - ProposalType.REGULAR, + ProposalType.FAST_TRACK, ); }; + +export default vip371; diff --git a/vips/vip-372/bscmainnet.ts b/vips/vip-372/bscmainnet.ts new file mode 100644 index 000000000..c3e518f2d --- /dev/null +++ b/vips/vip-372/bscmainnet.ts @@ -0,0 +1,47 @@ +import { parseUnits } from "ethers/lib/utils"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; +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 vip372 = () => { + const meta = { + version: "v2", + title: "VIP-372 Increase XVS bridge limit for ZKsync", + description: `#### Summary`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_SEND_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxDailyReceiveLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, MAX_DAILY_RECEIVE_LIMIT], + }, + { + target: XVS_BRIDGE_ADMIN, + signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", + params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; From d2f5cdc519f3f4e9b46c2b8f42f7de618d82a654 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:44:25 +0530 Subject: [PATCH 4/6] fix: proposal type in vip --- vips/vip-370/bscmainnet.ts | 2 +- vips/vip-372/bscmainnet.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vips/vip-370/bscmainnet.ts b/vips/vip-370/bscmainnet.ts index 24f691621..2ad6b3fec 100644 --- a/vips/vip-370/bscmainnet.ts +++ b/vips/vip-370/bscmainnet.ts @@ -436,7 +436,7 @@ The ownership of every contract has been transferred to Governance. }), ], meta, - ProposalType.FAST_TRACK, + ProposalType.REGULAR, ); }; diff --git a/vips/vip-372/bscmainnet.ts b/vips/vip-372/bscmainnet.ts index c3e518f2d..93edcb5fc 100644 --- a/vips/vip-372/bscmainnet.ts +++ b/vips/vip-372/bscmainnet.ts @@ -42,6 +42,6 @@ export const vip372 = () => { }, ], meta, - ProposalType.REGULAR, + ProposalType.FAST_TRACK, ); }; From 0f2ccb260211661c361e3259298e407de90024bc Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Tue, 24 Sep 2024 19:33:00 +0200 Subject: [PATCH 5/6] feat: merge into one VIP the risk parameters commands --- simulations/vip-371/bscmainnet.ts | 90 ------------------- .../{vip-371 => vip-372}/abi/comptroller.json | 0 simulations/vip-372/bscmainnet.ts | 76 +++++++++++++++- vips/vip-371/bscmainnet.ts | 69 -------------- vips/vip-372/bscmainnet.ts | 80 ++++++++++++++++- 5 files changed, 152 insertions(+), 163 deletions(-) delete mode 100644 simulations/vip-371/bscmainnet.ts rename simulations/{vip-371 => vip-372}/abi/comptroller.json (100%) delete mode 100644 vips/vip-371/bscmainnet.ts diff --git a/simulations/vip-371/bscmainnet.ts b/simulations/vip-371/bscmainnet.ts deleted file mode 100644 index 5accbc43e..000000000 --- a/simulations/vip-371/bscmainnet.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { expect } from "chai"; -import { Contract } from "ethers"; -import { parseUnits } from "ethers/lib/utils"; -import { ethers } from "hardhat"; -import { expectEvents, setMaxStaleCoreAssets } from "src/utils"; -import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; - -import vip370 from "../../vips/vip-370/bscmainnet"; -import vip371, { COMPTROLLER, vETH, vweETH, vwstETH } from "../../vips/vip-371/bscmainnet"; -import COMPTROLLER_ABI from "./abi/comptroller.json"; - -const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; -const CHAINLINK = "0x1B2103441A0A108daD8848D8F5d790e4D402921F"; - -const previousCaps = { - ETH: { - vToken: vETH, - supplyCap: parseUnits("450", 18), - borrowCap: parseUnits("400", 18), - }, - weETH: { - vToken: vweETH, - supplyCap: parseUnits("400", 18), - borrowCap: parseUnits("200", 18), - }, - wstETH: { - vToken: vwstETH, - supplyCap: parseUnits("50", 18), - borrowCap: parseUnits("5", 18), - }, -}; - -const newCaps = { - ETH: { - vToken: vETH, - supplyCap: parseUnits("3600", 18), - borrowCap: parseUnits("3250", 18), - }, - weETH: { - vToken: vweETH, - supplyCap: parseUnits("120", 18), - borrowCap: parseUnits("60", 18), - }, - wstETH: { - vToken: vwstETH, - supplyCap: parseUnits("3200", 18), - borrowCap: parseUnits("320", 18), - }, -}; - -forking(42511365, async () => { - let comptrollerContract: Contract; - - before(async () => { - await pretendExecutingVip(await vip370({}), NORMAL_TIMELOCK); - comptrollerContract = new ethers.Contract(COMPTROLLER, COMPTROLLER_ABI, await ethers.getSigner(NORMAL_TIMELOCK)); - - await setMaxStaleCoreAssets(CHAINLINK, NORMAL_TIMELOCK); - }); - - describe("Pre-VIP behavior", async () => { - for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(previousCaps)) { - it(`check supply and borrow cap on ${market}`, async () => { - const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); - expect(currentSupplyCap).to.be.equal(supplyCap); - - const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); - expect(currentBorrowCap).to.be.equal(borrowCap); - }); - } - }); - - testVip("VIP-371", await vip371(), { - callbackAfterExecution: async txResponse => { - await expectEvents(txResponse, [COMPTROLLER_ABI], ["NewSupplyCap", "NewBorrowCap"], [3, 3]); - }, - }); - - describe("Post-VIP behavior", async () => { - for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(newCaps)) { - it(`check supply and borrow cap on ${market}`, async () => { - const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); - expect(currentSupplyCap).to.be.equal(supplyCap); - - const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); - expect(currentBorrowCap).to.be.equal(borrowCap); - }); - } - }); -}); diff --git a/simulations/vip-371/abi/comptroller.json b/simulations/vip-372/abi/comptroller.json similarity index 100% rename from simulations/vip-371/abi/comptroller.json rename to simulations/vip-372/abi/comptroller.json diff --git a/simulations/vip-372/bscmainnet.ts b/simulations/vip-372/bscmainnet.ts index 7d7fe2c2a..082966e51 100644 --- a/simulations/vip-372/bscmainnet.ts +++ b/simulations/vip-372/bscmainnet.ts @@ -1,26 +1,77 @@ import { expect } from "chai"; import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { LzChainId } from "src/types"; -import { expectEvents } from "src/utils"; -import { forking, testVip } from "src/vip-framework"; +import { expectEvents, setMaxStaleCoreAssets } from "src/utils"; +import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; +import vip370 from "../../vips/vip-370/bscmainnet"; import { + COMPTROLLER, MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, + vETH, vip372, + vweETH, + vwstETH, } from "../../vips/vip-372/bscmainnet"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; +const CHAINLINK = "0x1B2103441A0A108daD8848D8F5d790e4D402921F"; + +const previousCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("450", 18), + borrowCap: parseUnits("400", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("400", 18), + borrowCap: parseUnits("200", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("50", 18), + borrowCap: parseUnits("5", 18), + }, +}; + +const newCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("3600", 18), + borrowCap: parseUnits("3250", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("120", 18), + borrowCap: parseUnits("60", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("3200", 18), + borrowCap: parseUnits("320", 18), + }, +}; + const XVS_BRIDGE = "0xf8F46791E3dB29a029Ec6c9d946226f3c613e854"; forking(42508132, async () => { let xvsBridge: Contract; + let comptrollerContract: Contract; before(async () => { xvsBridge = await ethers.getContractAt(XVS_BRIDGE_ABI, XVS_BRIDGE); + await pretendExecutingVip(await vip370({}), NORMAL_TIMELOCK); + comptrollerContract = new ethers.Contract(COMPTROLLER, COMPTROLLER_ABI, await ethers.getSigner(NORMAL_TIMELOCK)); + + await setMaxStaleCoreAssets(CHAINLINK, NORMAL_TIMELOCK); }); describe("Pre-Executing VIP", () => { @@ -45,6 +96,16 @@ forking(42508132, async () => { MAX_DAILY_RECEIVE_LIMIT.div(2), ); }); + + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(previousCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); + + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } }); testVip("vip-372", await vip372(), { @@ -60,6 +121,7 @@ forking(42508132, async () => { ], [1, 1, 1, 1], ); + await expectEvents(txResponse, [COMPTROLLER_ABI], ["NewSupplyCap", "NewBorrowCap"], [3, 3]); }, }); describe("Post-Execution state", () => { @@ -80,5 +142,15 @@ forking(42508132, async () => { it("Should match max daily receive limit", async () => { expect(await xvsBridge.chainIdToMaxDailyReceiveLimit(LzChainId.zksyncmainnet)).to.equal(MAX_DAILY_RECEIVE_LIMIT); }); + + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(newCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); + + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } }); }); diff --git a/vips/vip-371/bscmainnet.ts b/vips/vip-371/bscmainnet.ts deleted file mode 100644 index f028b9009..000000000 --- a/vips/vip-371/bscmainnet.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { parseUnits } from "ethers/lib/utils"; -import { ProposalType } from "src/types"; -import { makeProposal } from "src/utils"; - -export const vETH = "0xeCCACF760FEA7943C5b0285BD09F601505A29c05"; -export const vweETH = "0xc5b24f347254bD8cF8988913d1fd0F795274900F"; -export const vwstETH = "0x94180a3948296530024Ef7d60f60B85cfe0422c8"; -export const COMPTROLLER = "0xBE609449Eb4D76AD8545f957bBE04b596E8fC529"; -export const ETH_SUPPLY_CAP = parseUnits("3600", 18); -export const ETH_BORROW_CAP = parseUnits("3250", 18); -export const weETH_SUPPLY_CAP = parseUnits("120", 18); -export const weETH_BORROW_CAP = parseUnits("60", 18); -export const wstETH_SUPPLY_CAP = parseUnits("3200", 18); -export const wstETH_BORROW_CAP = parseUnits("320", 18); - -const vip371 = () => { - const meta = { - version: "v2", - title: "VIP-371 [BNB] Risk Parameters Adjustments (ETH, wstETH, weETH)", - description: `This VIP will perform the following Risk Parameter actions as per Chaos Labs’ latest recommendations in this Venus community forum publication: [Chaos Labs - Risk Parameter Updates - 09/23/24](https://community.venus.io/t/support-lido-wsteth-token-in-a-new-venus-protocol-bnbchain-lst-eth-pool/4526/8). - -- [ETH (Liquid Staked ETH)](https://bscscan.com/address/0xeCCACF760FEA7943C5b0285BD09F601505A29c05) - - Increase supply cap from 450 ETH to 3,600 ETH - - Increase borrow cap from 400 ETH to 3,250 ETH -- [wstETH (Liquid Staked ETH)](https://bscscan.com/address/0x94180a3948296530024Ef7d60f60B85cfe0422c8) - - Increase supply cap from 50 wstETH to 3,200 wstETH - - Increase borrow cap from 5 wstETH to 320 wstETH -- [weETH (Liquid Staked ETH)](https://bscscan.com/address/0xc5b24f347254bD8cF8988913d1fd0F795274900F) - - Decrease supply cap from 400 weETH to 120 weETH - - Decrease borrow cap from 200 weETH to 60 weETH - -This VIP should be executed after executing the [VIP-370](https://app.venus.io/#/governance/proposal/370?chainId=56), where the affected markets will be enabled. - -Complete analysis and details of these recommendations are available in the above publication. - -#### References - -- [VIP simulation](https://github.com/VenusProtocol/vips/pull/356) -- [VIP-370: Add Liquid Staked ETH pool to BNB chain](https://app.venus.io/#/governance/proposal/370?chainId=56)`, - forDescription: "Execute this proposal", - againstDescription: "Do not execute this proposal", - abstainDescription: "Indifferent to execution", - }; - - return makeProposal( - [ - { - target: COMPTROLLER, - signature: "setMarketSupplyCaps(address[],uint256[])", - params: [ - [vETH, vweETH, vwstETH], - [ETH_SUPPLY_CAP, weETH_SUPPLY_CAP, wstETH_SUPPLY_CAP], - ], - }, - { - target: COMPTROLLER, - signature: "setMarketBorrowCaps(address[],uint256[])", - params: [ - [vETH, vweETH, vwstETH], - [ETH_BORROW_CAP, weETH_BORROW_CAP, wstETH_BORROW_CAP], - ], - }, - ], - meta, - ProposalType.FAST_TRACK, - ); -}; - -export default vip371; diff --git a/vips/vip-372/bscmainnet.ts b/vips/vip-372/bscmainnet.ts index 93edcb5fc..b369f9894 100644 --- a/vips/vip-372/bscmainnet.ts +++ b/vips/vip-372/bscmainnet.ts @@ -2,6 +2,17 @@ import { parseUnits } from "ethers/lib/utils"; import { LzChainId, ProposalType } from "src/types"; import { makeProposal } from "src/utils"; +export const vETH = "0xeCCACF760FEA7943C5b0285BD09F601505A29c05"; +export const vweETH = "0xc5b24f347254bD8cF8988913d1fd0F795274900F"; +export const vwstETH = "0x94180a3948296530024Ef7d60f60B85cfe0422c8"; +export const COMPTROLLER = "0xBE609449Eb4D76AD8545f957bBE04b596E8fC529"; +export const ETH_SUPPLY_CAP = parseUnits("3600", 18); +export const ETH_BORROW_CAP = parseUnits("3250", 18); +export const weETH_SUPPLY_CAP = parseUnits("120", 18); +export const weETH_BORROW_CAP = parseUnits("60", 18); +export const wstETH_SUPPLY_CAP = parseUnits("3200", 18); +export const wstETH_BORROW_CAP = parseUnits("320", 18); + const XVS_BRIDGE_ADMIN = "0x70d644877b7b73800E9073BCFCE981eAaB6Dbc21"; export const SINGLE_SEND_LIMIT = parseUnits("20000", 18); export const MAX_DAILY_SEND_LIMIT = parseUnits("100000", 18); @@ -11,8 +22,55 @@ export const MAX_DAILY_RECEIVE_LIMIT = parseUnits("102000", 18); export const vip372 = () => { const meta = { version: "v2", - title: "VIP-372 Increase XVS bridge limit for ZKsync", - description: `#### Summary`, + title: "VIP-372 Risk Parameters Adjustments", + description: `#### Summary + +If passed, this VIP will perform the following actions: + +- Update the supply and borrow caps of the markets for ETH, wstETH and weETH on BNB Chain (Liquid Staked ETH pool), following the [Chaos labs recommendations](https://community.venus.io/t/support-lido-wsteth-token-in-a-new-venus-protocol-bnbchain-lst-eth-pool/4526/8) +- Increase the limits in the XVS bridge among zkSync and the rest of supported networks: Ethereum, BNB Chain, Arbitrum and opBNB, following the [Chaos labs recommendations](https://community.venus.io/t/deploy-venus-protocol-on-zksync-era/4472/12) + +#### Description + +This VIP will perform the following Risk Parameter actions as per Chaos Labs’ latest recommendations in this Venus community forum publication: [Chaos Labs - Risk Parameter Updates - 09/23/24](https://community.venus.io/t/support-lido-wsteth-token-in-a-new-venus-protocol-bnbchain-lst-eth-pool/4526/8). + +- [ETH (Liquid Staked ETH)](https://bscscan.com/address/0xeCCACF760FEA7943C5b0285BD09F601505A29c05) + - Increase supply cap from 450 ETH to 3,600 ETH + - Increase borrow cap from 400 ETH to 3,250 ETH +- [wstETH (Liquid Staked ETH)](https://bscscan.com/address/0x94180a3948296530024Ef7d60f60B85cfe0422c8) + - Increase supply cap from 50 wstETH to 3,200 wstETH + - Increase borrow cap from 5 wstETH to 320 wstETH +- [weETH (Liquid Staked ETH)](https://bscscan.com/address/0xc5b24f347254bD8cF8988913d1fd0F795274900F) + - Decrease supply cap from 400 weETH to 120 weETH + - Decrease borrow cap from 200 weETH to 60 weETH + +This VIP should be executed after executing the [VIP-370](https://app.venus.io/#/governance/proposal/370?chainId=56), where the affected markets will be enabled. + +Regarding the limits of the XVS bridge among zkSync and the rest of supported networks, in the [VIP-358](https://app.venus.io/#/governance/proposal/358?chainId=56) the single transaction and daily limits were set to half of the amounts recommended by Chaos labs. In this VIP, these limits are set to the expected values: + +- Maximum bridged XVS in a single transaction: 20,000 USD +- Maximum bridged XVS in 24 hours: 100,000 USD + +Complete analysis and details of these recommendations are available in the above publications. + +#### References + +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/356) +- [VIP-358 XVS bridge between zkSync Era and BNB Chain, Ethereum, Arbitrum one and opBNB](https://app.venus.io/#/governance/proposal/358?chainId=56) +- [VIP-370: Add Liquid Staked ETH pool to BNB chain](https://app.venus.io/#/governance/proposal/370?chainId=56) +- [Technical documentation about the XVS bridge](https://docs-v4.venus.io/technical-reference/reference-technical-articles/xvs-bridge) + +#### Disclaimer for Ethereum, opBNB, Arbitrum one and zkSync Era commands + +Privilege commands on Ethereum, opBNB, Arbitrum one and zkSync Era 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)), 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. + +- [Ethereum](https://app.safe.global/transactions/tx?safe=eth:0x285960C5B22fD66A736C7136967A3eB15e93CC67&id=multisig_0x285960C5B22fD66A736C7136967A3eB15e93CC67_0x78510629ca377b93f9d5496ec249201ecc5f30745af0d8c2ea0b5c5fdd6904ae) +- [opBNB](https://multisig.bnbchain.org/transactions/tx?safe=opbnb:0xC46796a21a3A9FAB6546aF3434F2eBfFd0604207&id=multisig_0xC46796a21a3A9FAB6546aF3434F2eBfFd0604207_0x65a1c5369b8e13abda41fa6d16b09a3eaa4aac8137083690dda880b8a861b299) +- [Arbitrum one](https://app.safe.global/transactions/tx?safe=arb1:0x14e0E151b33f9802b3e75b621c1457afc44DcAA0&id=multisig_0x14e0E151b33f9802b3e75b621c1457afc44DcAA0_0xa09d784e2a6a49865571d803ca778376bd928bb7e16381c5ebd4b273e5e6f0e0) +- [zkSync Era](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x85a47f4c749c7be79ee92fe13ebfd4283481894c4745ca1ded4c8130864f82d3) +`, forDescription: "Execute this proposal", againstDescription: "Do not execute this proposal", abstainDescription: "Indifferent to execution", @@ -40,8 +98,26 @@ export const vip372 = () => { signature: "setMaxSingleReceiveTransactionLimit(uint16,uint256)", params: [LzChainId.zksyncmainnet, SINGLE_RECEIVE_LIMIT], }, + { + target: COMPTROLLER, + signature: "setMarketSupplyCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_SUPPLY_CAP, weETH_SUPPLY_CAP, wstETH_SUPPLY_CAP], + ], + }, + { + target: COMPTROLLER, + signature: "setMarketBorrowCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_BORROW_CAP, weETH_BORROW_CAP, wstETH_BORROW_CAP], + ], + }, ], meta, ProposalType.FAST_TRACK, ); }; + +export default vip372; From d37ba021c0aa82c494162f28f9eab46cd63f1977 Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Wed, 25 Sep 2024 11:54:23 +0300 Subject: [PATCH 6/6] feat: use correct nonce for arbitrum tx --- .../proposals/arbitrumone/{vip-014 => vip-015}/index.ts | 4 ++-- .../{vip-014 => vip-015}/abi/xvsProxyOFTDest.json | 0 .../simulations/arbitrumone/{vip-014 => vip-015}/index.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename multisig/proposals/arbitrumone/{vip-014 => vip-015}/index.ts (96%) rename multisig/simulations/arbitrumone/{vip-014 => vip-015}/abi/xvsProxyOFTDest.json (100%) rename multisig/simulations/arbitrumone/{vip-014 => vip-015}/index.ts (95%) diff --git a/multisig/proposals/arbitrumone/vip-014/index.ts b/multisig/proposals/arbitrumone/vip-015/index.ts similarity index 96% rename from multisig/proposals/arbitrumone/vip-014/index.ts rename to multisig/proposals/arbitrumone/vip-015/index.ts index 07a298204..d9a9fb640 100644 --- a/multisig/proposals/arbitrumone/vip-014/index.ts +++ b/multisig/proposals/arbitrumone/vip-015/index.ts @@ -8,7 +8,7 @@ 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); -const vip014 = () => { +const vip015 = () => { return makeProposal([ { target: XVS_BRIDGE_ADMIN, @@ -32,4 +32,4 @@ const vip014 = () => { }, ]); }; -export default vip014; +export default vip015; diff --git a/multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json b/multisig/simulations/arbitrumone/vip-015/abi/xvsProxyOFTDest.json similarity index 100% rename from multisig/simulations/arbitrumone/vip-014/abi/xvsProxyOFTDest.json rename to multisig/simulations/arbitrumone/vip-015/abi/xvsProxyOFTDest.json diff --git a/multisig/simulations/arbitrumone/vip-014/index.ts b/multisig/simulations/arbitrumone/vip-015/index.ts similarity index 95% rename from multisig/simulations/arbitrumone/vip-014/index.ts rename to multisig/simulations/arbitrumone/vip-015/index.ts index 384b133f8..370dc13f1 100644 --- a/multisig/simulations/arbitrumone/vip-014/index.ts +++ b/multisig/simulations/arbitrumone/vip-015/index.ts @@ -4,12 +4,12 @@ import { ethers } from "hardhat"; import { LzChainId } from "src/types"; import { forking, pretendExecutingVip } from "src/vip-framework"; -import vip014, { +import vip015, { MAX_DAILY_RECEIVE_LIMIT, MAX_DAILY_SEND_LIMIT, SINGLE_RECEIVE_LIMIT, SINGLE_SEND_LIMIT, -} from "../../../proposals/arbitrumone/vip-014"; +} from "../../../proposals/arbitrumone/vip-015"; import XVS_BRIDGE_ABI from "./abi/xvsProxyOFTDest.json"; const XVS_BRIDGE = "0x20cEa49B5F7a6DBD78cAE772CA5973eF360AA1e6"; @@ -47,7 +47,7 @@ forking(256537654, async () => { describe("Post-Execution state", () => { before(async () => { - await pretendExecutingVip(await vip014()); + await pretendExecutingVip(await vip015()); }); it("Should match single send transaction limit", async () => {