From 8bf7b3d4f55a60553ca4bbcbf79f54f4a2cbcb0b Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 9 Apr 2025 17:22:18 +0530 Subject: [PATCH 1/4] feat: bridge WETH from bsc to base and mint vWETH on base --- simulations/vip-476/abi/ERC20.json | 295 +++ .../vip-476/abi/OmnichainProposalSender.json | 314 +++ simulations/vip-476/abi/VTreasury.json | 86 + simulations/vip-476/abi/dlnSource.json | 1997 +++++++++++++++++ simulations/vip-476/abi/vToken.json | 1872 +++++++++++++++ simulations/vip-476/basemainnet.ts | 60 + simulations/vip-476/bscmainnet.ts | 43 + vips/vip-476/bscmainnet.ts | 104 + 8 files changed, 4771 insertions(+) create mode 100644 simulations/vip-476/abi/ERC20.json create mode 100644 simulations/vip-476/abi/OmnichainProposalSender.json create mode 100644 simulations/vip-476/abi/VTreasury.json create mode 100644 simulations/vip-476/abi/dlnSource.json create mode 100644 simulations/vip-476/abi/vToken.json create mode 100644 simulations/vip-476/basemainnet.ts create mode 100644 simulations/vip-476/bscmainnet.ts create mode 100644 vips/vip-476/bscmainnet.ts diff --git a/simulations/vip-476/abi/ERC20.json b/simulations/vip-476/abi/ERC20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-476/abi/ERC20.json @@ -0,0 +1,295 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "userAddress", "type": "address" }, + { "indexed": false, "internalType": "address payable", "name": "relayerAddress", "type": "address" }, + { "indexed": false, "internalType": "bytes", "name": "functionSignature", "type": "bytes" } + ], + "name": "MetaTransactionExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC712_VERSION", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PREDICATE_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "userAddress", "type": "address" }, + { "internalType": "bytes", "name": "functionSignature", "type": "bytes" }, + { "internalType": "bytes32", "name": "sigR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "sigS", "type": "bytes32" }, + { "internalType": "uint8", "name": "sigV", "type": "uint8" } + ], + "name": "executeMetaTransaction", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeperator", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "getNonce", + "outputs": [{ "internalType": "uint256", "name": "nonce", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "getRoleMember", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleMemberCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-476/abi/OmnichainProposalSender.json b/simulations/vip-476/abi/OmnichainProposalSender.json new file mode 100644 index 000000000..66fd4df02 --- /dev/null +++ b/simulations/vip-476/abi/OmnichainProposalSender.json @@ -0,0 +1,314 @@ +[ + { + "inputs": [ + { "internalType": "contract ILayerZeroEndpoint", "name": "lzEndpoint_", "type": "address" }, + { "internalType": "address", "name": "accessControlManager_", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes32", "name": "executionHash", "type": "bytes32" } + ], + "name": "ClearPayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" } + ], + "name": "ExecuteRemoteProposal", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "FallbackWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "oldRemoteAddress", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "newRemoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": true, "internalType": "uint16", "name": "remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "adapterParams", "type": "bytes" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "StorePayload", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint16", "name": "chainId", "type": "uint16" }], + "name": "TrustedRemoteRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "LZ_ENDPOINT", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourCommandsSent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLast24HourWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToLastProposalSentTimestamp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "chainIdToMaxDailyLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bool", "name": "useZro_", "type": "bool" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" } + ], + "name": "estimateFees", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" } + ], + "name": "execute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to_", "type": "address" }, + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "fallbackWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }], + "name": "removeTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "pId_", "type": "uint256" }, + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" }, + { "internalType": "bytes", "name": "adapterParams_", "type": "bytes" }, + { "internalType": "address", "name": "zroPaymentAddress_", "type": "address" }, + { "internalType": "uint256", "name": "originalValue_", "type": "uint256" } + ], + "name": "retryExecute", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "version_", "type": "uint16" }, + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "configType_", "type": "uint256" }, + { "internalType": "bytes", "name": "config_", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "chainId_", "type": "uint16" }, + { "internalType": "uint256", "name": "limit_", "type": "uint256" } + ], + "name": "setMaxDailyLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "version_", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "remoteChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "newRemoteAddress_", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "storedExecutionHashes", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-476/abi/VTreasury.json b/simulations/vip-476/abi/VTreasury.json new file mode 100644 index 000000000..18aabb61a --- /dev/null +++ b/simulations/vip-476/abi/VTreasury.json @@ -0,0 +1,86 @@ +[ + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "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" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "indexed": true, "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "WithdrawTreasuryNative", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "tokenAddress", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "indexed": true, "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "WithdrawTreasuryToken", + "type": "event" + }, + { "stateMutability": "payable", "type": "fallback" }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "internalType": "address payable", "name": "withdrawAddress", "type": "address" } + ], + "name": "withdrawTreasuryNative", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "tokenAddress", "type": "address" }, + { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "withdrawTreasuryToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/simulations/vip-476/abi/dlnSource.json b/simulations/vip-476/abi/dlnSource.json new file mode 100644 index 000000000..46774b4f6 --- /dev/null +++ b/simulations/vip-476/abi/dlnSource.json @@ -0,0 +1,1997 @@ +[ + { + "inputs": [], + "name": "AdminBadRole", + "type": "error" + }, + { + "inputs": [], + "name": "CallProxyBadRole", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "internalType": "uint48", + "name": "takeChainId", + "type": "uint48" + }, + { + "internalType": "uint256", + "name": "submissionsChainIdFrom", + "type": "uint256" + } + ], + "name": "CriticalMismatchTakeChainId", + "type": "error" + }, + { + "inputs": [], + "name": "EthTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "GovMonitoringBadRole", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectOrderStatus", + "type": "error" + }, + { + "inputs": [], + "name": "MismatchNativeGiveAmount", + "type": "error" + }, + { + "inputs": [], + "name": "MismatchedOrderId", + "type": "error" + }, + { + "inputs": [], + "name": "MismatchedTransferAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "nativeSender", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "chainIdFrom", + "type": "uint256" + } + ], + "name": "NativeSenderBadRole", + "type": "error" + }, + { + "inputs": [], + "name": "NotSupportedDstChain", + "type": "error" + }, + { + "inputs": [], + "name": "SignatureInvalidV", + "type": "error" + }, + { + "inputs": [], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "UnknownEngine", + "type": "error" + }, + { + "inputs": [], + "name": "WrongAddressLength", + "type": "error" + }, + { + "inputs": [], + "name": "WrongAffiliateFeeLength", + "type": "error" + }, + { + "inputs": [], + "name": "WrongArgument", + "type": "error" + }, + { + "inputs": [], + "name": "WrongChain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "WrongFixedFee", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "_orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "affiliateFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + } + ], + "name": "AffiliateFeePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "paidAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + } + ], + "name": "ClaimedOrderCancel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + } + ], + "name": "ClaimedUnlock", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "makerOrderNonce", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "makerSrc", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "giveTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "givePatchAuthoritySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct DlnOrderLib.Order", + "name": "order", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "affiliateFee", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nativeFixFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percentFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "referralCode", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "metadata", + "type": "bytes" + } + ], + "name": "CreatedOrder", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "submissionChainIdFrom", + "type": "uint256" + } + ], + "name": "CriticalMismatchChainId", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint88", + "name": "oldGlobalFixedNativeFee", + "type": "uint88" + }, + { + "indexed": false, + "internalType": "uint88", + "name": "newGlobalFixedNativeFee", + "type": "uint88" + } + ], + "name": "GlobalFixedNativeFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "oldGlobalTransferFeeBps", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newGlobalTransferFeeBps", + "type": "uint16" + } + ], + "name": "GlobalTransferFeeBpsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "orderGiveFinalAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "finalPercentFee", + "type": "uint256" + } + ], + "name": "IncreasedGiveAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "chainIdTo", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "dlnDestinationAddress", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "enum DlnOrderLib.ChainEngine", + "name": "chainEngine", + "type": "uint8" + } + ], + "name": "SetDlnDestinationAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum DlnSource.OrderGiveStatus", + "name": "status", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "UnexpectedOrderStatusForCancel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "orderId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum DlnSource.OrderGiveStatus", + "name": "status", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "UnexpectedOrderStatusForClaim", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "beneficiary", + "type": "address" + } + ], + "name": "WithdrawnFee", + "type": "event" + }, + { + "inputs": [], + "name": "BPS_DENOMINATOR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EVM_ADDRESS_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GOVMONITORING_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_ADDRESS_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SOLANA_ADDRESS_LENGTH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "chainEngines", + "outputs": [ + { + "internalType": "enum DlnOrderLib.ChainEngine", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_orderIds", + "type": "bytes32[]" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + } + ], + "name": "claimBatchCancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "_orderIds", + "type": "bytes32[]" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + } + ], + "name": "claimBatchUnlock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_orderId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + } + ], + "name": "claimCancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_orderId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + } + ], + "name": "claimUnlock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "collectedFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "address", + "name": "givePatchAuthoritySrc", + "type": "address" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.OrderCreation", + "name": "_orderCreation", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "_affiliateFee", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "_referralCode", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "_permitEnvelope", + "type": "bytes" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "address", + "name": "givePatchAuthoritySrc", + "type": "address" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.OrderCreation", + "name": "_orderCreation", + "type": "tuple" + }, + { + "internalType": "uint64", + "name": "_salt", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "_affiliateFee", + "type": "bytes" + }, + { + "internalType": "uint32", + "name": "_referralCode", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "_permitEnvelope", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_metadata", + "type": "bytes" + } + ], + "name": "createSaltedOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "deBridgeGate", + "outputs": [ + { + "internalType": "contract IDeBridgeGate", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "dlnDestinationAddresses", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "cid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "makerOrderNonce", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "makerSrc", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "giveTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "givePatchAuthoritySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.Order", + "name": "_order", + "type": "tuple" + } + ], + "name": "getOrderId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "giveOrders", + "outputs": [ + { + "internalType": "enum DlnSource.OrderGiveStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint160", + "name": "giveTokenAddress", + "type": "uint160" + }, + { + "internalType": "uint88", + "name": "nativeFixFee", + "type": "uint88" + }, + { + "internalType": "uint48", + "name": "takeChainId", + "type": "uint48" + }, + { + "internalType": "uint208", + "name": "percentFee", + "type": "uint208" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "affiliateBeneficiary", + "type": "address" + }, + { + "internalType": "uint256", + "name": "affiliateAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "givePatches", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalFixedNativeFee", + "outputs": [ + { + "internalType": "uint88", + "name": "", + "type": "uint88" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalTransferFeeBps", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IDeBridgeGate", + "name": "_deBridgeGate", + "type": "address" + }, + { + "internalType": "uint88", + "name": "_globalFixedNativeFee", + "type": "uint88" + }, + { + "internalType": "uint16", + "name": "_globalTransferFeeBps", + "type": "uint16" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "masterNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "makerOrderNonce", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "makerSrc", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "giveTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "givePatchAuthoritySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.Order", + "name": "_order", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "_addGiveAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_permitEnvelope", + "type": "bytes" + } + ], + "name": "patchOrderGive", + "outputs": [], + "stateMutability": "payable", + "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": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_chainIdTo", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_dlnDestinationAddress", + "type": "bytes" + }, + { + "internalType": "enum DlnOrderLib.ChainEngine", + "name": "_chainEngine", + "type": "uint8" + } + ], + "name": "setDlnDestinationAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "unclaimedAffiliateETHFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "unexpectedOrderStatusForCancel", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "unexpectedOrderStatusForClaim", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint88", + "name": "_globalFixedNativeFee", + "type": "uint88" + }, + { + "internalType": "uint16", + "name": "_globalTransferFeeBps", + "type": "uint16" + } + ], + "name": "updateGlobalFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "address", + "name": "givePatchAuthoritySrc", + "type": "address" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.OrderCreation", + "name": "_orderCreation", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_signer", + "type": "address" + }, + { + "internalType": "uint64", + "name": "_salt", + "type": "uint64" + } + ], + "name": "validateCreationOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "makerOrderNonce", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "makerSrc", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "giveTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "givePatchAuthoritySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.Order", + "name": "order", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "giveTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "address", + "name": "givePatchAuthoritySrc", + "type": "address" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.OrderCreation", + "name": "_orderCreation", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_signer", + "type": "address" + } + ], + "name": "validateCreationOrder", + "outputs": [ + { + "components": [ + { + "internalType": "uint64", + "name": "makerOrderNonce", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "makerSrc", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "giveTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "giveAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "takeChainId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "takeTokenAddress", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "takeAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "receiverDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "givePatchAuthoritySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "orderAuthorityAddressDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedTakerDst", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "allowedCancelBeneficiarySrc", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "externalCall", + "type": "bytes" + } + ], + "internalType": "struct DlnOrderLib.Order", + "name": "order", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "_beneficiary", + "type": "address" + } + ], + "name": "withdrawFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-476/abi/vToken.json b/simulations/vip-476/abi/vToken.json new file mode 100644 index 000000000..a413ca84d --- /dev/null +++ b/simulations/vip-476/abi/vToken.json @@ -0,0 +1,1872 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualAddAmount", + "type": "uint256" + } + ], + "name": "AddReservesFactorFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowCashNotAvailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "BorrowComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "ForceLiquidateBorrowUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HealBorrowUnauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateAccrueBorrowInterestFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateAccrueCollateralInterestFailed", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCloseAmountIsUintMax", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCloseAmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCollateralFreshnessCheck", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateLiquidatorIsBorrower", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateRepayBorrowFreshFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateSeizeComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateSeizeLiquidatorIsBorrower", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "MintComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "MintFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "ProtocolSeizeShareTooBig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "RedeemComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "RedeemFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "RedeemTransferOutNotPossible", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesAdminCheck", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesCashNotAvailable", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesCashValidation", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesFreshCheck", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "RepayBorrowComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "RepayBorrowFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetComptrollerOwnerCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetInterestRateModelFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetInterestRateModelOwnerCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetProtocolSeizeShareUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "SetReserveFactorAdminCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetReserveFactorBoundsCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetReserveFactorFreshCheck", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "TransferComptrollerRejection", + "type": "error" + }, + { + "inputs": [], + "name": "TransferNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "TransferNotEnough", + "type": "error" + }, + { + "inputs": [], + "name": "TransferTooMuch", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "cashPrior", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "interestAccumulated", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "AccrueInterest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtOld", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtNew", + "type": "uint256" + } + ], + "name": "BadDebtIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtOld", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtNew", + "type": "uint256" + } + ], + "name": "BadDebtRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "HealBorrow", + "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": "liquidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "LiquidateBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBalance", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract AccessControlManager", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract AccessControlManager", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ComptrollerInterface", + "name": "oldComptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ComptrollerInterface", + "name": "newComptroller", + "type": "address" + } + ], + "name": "NewComptroller", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "NewMarketInterestRateModel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldProtocolSeizeShareMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newProtocolSeizeShareMantissa", + "type": "uint256" + } + ], + "name": "NewProtocolSeizeShare", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactorMantissa", + "type": "uint256" + } + ], + "name": "NewReserveFactor", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBalance", + "type": "uint256" + } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "RepayBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "benefactor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "ReservesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "ReservesReduced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "NO_ERROR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract AccessControlManager", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrueInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + } + ], + "name": "addReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "badDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "recoveredAmount_", + "type": "uint256" + } + ], + "name": "badDebtRecovered", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOfUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptroller", + "outputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "contract VTokenInterface", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "bool", + "name": "skipLiquidityCheck", + "type": "bool" + } + ], + "name": "forceLiquidateBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vTokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exchangeRate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "healBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract ComptrollerInterface", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract InterestRateModel", + "name": "interestRateModel_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialExchangeRateMantissa_", + "type": "uint256" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "contract AccessControlManager", + "name": "accessControlManager_", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "shortfall", + "type": "address" + }, + { + "internalType": "address payable", + "name": "riskFund", + "type": "address" + }, + { + "internalType": "address payable", + "name": "protocolShareReserve", + "type": "address" + } + ], + "internalType": "struct VTokenInterface.RiskManagementInit", + "name": "riskManagement", + "type": "tuple" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "interestRateModel", + "outputs": [ + { + "internalType": "contract InterestRateModel", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isVToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "contract VTokenInterface", + "name": "vTokenCollateral", + "type": "address" + } + ], + "name": "liquidateBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolSeizeShareMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + } + ], + "name": "redeemUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + } + ], + "name": "reduceReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract AccessControlManager", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "setAccessControlAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "setInterestRateModel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newProtocolSeizeShareMantissa_", + "type": "uint256" + } + ], + "name": "setProtocolSeizeShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newReserveFactorMantissa", + "type": "uint256" + } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shortfall", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrows", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-476/basemainnet.ts b/simulations/vip-476/basemainnet.ts new file mode 100644 index 000000000..d43c7380e --- /dev/null +++ b/simulations/vip-476/basemainnet.ts @@ -0,0 +1,60 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { initMainnetUser } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip476, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-476/bscmainnet"; +import ERC20_ABI from "./abi/ERC20.json"; +import VTOKEN_ABI from "./abi/vToken.json"; +import VTREASURY_ABI from "./abi/vTreasury.json"; + +// "mintBehalf(address,uint256)" internally executes comptroller.preMintHook(address(this), minter, mintAmount) +// and distribute reward tokens through "rewardsDistributor.distributeSupplierRewardToken(vToken, minter)" +// it calculates REWARD TOKEN accrued by a supplier and possibly transfer it to them. +// it also executes "accrueInterest()", internally it calculates interest accrued +// from the last checkpointed slot(block or second) up to the current slot(block or second) +// and writes new checkpoint to storage and reduce spread reserves to protocol share reserve +// i.e _doTransferOut(protocolSeizeShare, amount) +const rewardVTokensAccrued = ethers.BigNumber.from("101443046573365"); // till block 28615549 +const VWETH_AMOUNT_RECEIVED = ethers.BigNumber.from("9968973998"); // till block 28615549 +const wethHolder_address = "0xb2cc224c1c9feE385f8ad6a55b4d94E92359DC59"; + +forking(28615549, async () => { + let weth: Contract; + let vWeth: Contract; + let wethHolderSigner: SignerWithAddress; + let wethBalanceForVWeth: BigNumber; + let vWethBalanceForTreasury: BigNumber; + let treasury: Contract; + + before(async () => { + weth = new ethers.Contract(BASE_WETH, ERC20_ABI, ethers.provider); + vWeth = new ethers.Contract(BASE_VWETH, VTOKEN_ABI, ethers.provider); + treasury = new ethers.Contract(VTREASURY_BASE, VTREASURY_ABI, ethers.provider); + wethBalanceForVWeth = await weth.balanceOf(BASE_VWETH); + vWethBalanceForTreasury = await vWeth.balanceOf(VTREASURY_BASE); + wethHolderSigner = await initMainnetUser(wethHolder_address, ethers.utils.parseEther("1")); + + await weth.connect(wethHolderSigner).transfer(VTREASURY_BASE, parseUnits("100", 18)); + }); + + testForkedNetworkVipCommands( + "VIP-476 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", + await vip476(), + ); + + describe("Post-VIP behaviour", async () => { + it("Should increase weth balance in vWETH market", async () => { + const balance = await weth.balanceOf(BASE_VWETH); + expect(balance).equals(wethBalanceForVWeth.add(ETH_AMOUNT_RECEIVED).sub(rewardVTokensAccrued)); + }); + + it("Should increase vWeth balance in vTreasury market", async () => { + const balance = await vWeth.balanceOf(VTREASURY_BASE); + expect(balance).equals(vWethBalanceForTreasury.add(VWETH_AMOUNT_RECEIVED)); + }); + }); +}); diff --git a/simulations/vip-476/bscmainnet.ts b/simulations/vip-476/bscmainnet.ts new file mode 100644 index 000000000..e36d73cfe --- /dev/null +++ b/simulations/vip-476/bscmainnet.ts @@ -0,0 +1,43 @@ +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip476, { BSCMAINNET_ETH, ETH_AMOUNT_SEND } from "../../vips/vip-476/bscmainnet"; +import ERC20_ABI from "./abi/ERC20.json"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; +import DLNSOURCE_ABI from "./abi/dlnSource.json"; + +const { VTREASURY } = NETWORK_ADDRESSES["bscmainnet"]; + +forking(48142130, async () => { + let eth: Contract; + let beforeTransfer: BigNumber; + let afterTransfer: BigNumber; + + before(async () => { + eth = new ethers.Contract(BSCMAINNET_ETH, ERC20_ABI, ethers.provider); + beforeTransfer = await eth.balanceOf(VTREASURY); + }); + + testVip("VIP-476 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", await vip476(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + await expectEvents(txResponse, [DLNSOURCE_ABI], ["CreatedOrder"], [1]); + }, + }); + + describe("Post-VIP behavior", async () => { + it("Should decrease eth balance in vTreasury BNB", async () => { + afterTransfer = await eth.balanceOf(VTREASURY); + expect(beforeTransfer).to.equal(afterTransfer.add(ETH_AMOUNT_SEND)); + }); + }); +}); diff --git a/vips/vip-476/bscmainnet.ts b/vips/vip-476/bscmainnet.ts new file mode 100644 index 000000000..41dfe6a1f --- /dev/null +++ b/vips/vip-476/bscmainnet.ts @@ -0,0 +1,104 @@ +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { VTREASURY, NORMAL_TIMELOCK } = NETWORK_ADDRESSES["bscmainnet"]; +const basemainnet = NETWORK_ADDRESSES["basemainnet"]; + +// Constructing valid 52-byte affiliateFee +const affiliateBeneficiary = ethers.utils.arrayify(ethers.constants.AddressZero); +const affiliateAmount = ethers.utils.hexZeroPad(ethers.utils.parseEther("0").toHexString(), 32); +export const affiliateFee = ethers.utils.concat([affiliateBeneficiary, affiliateAmount]); + +export const BRIDGE_FEES = parseUnits("0.005", 18); +export const ACM = "0x4788629abc6cfca10f9f969efdeaa1cf70c23555"; +export const BASE_ACM = "0x9E6CeEfDC6183e4D0DF8092A9B90cDF659687daB"; +export const BSCMAINNET_ETH = "0x2170Ed0880ac9A755fd29B2688956BD959F933F8"; +export const DLNSOURCE_CONTRACT = "0xeF4fB24aD0916217251F553c0596F8Edc630EB66"; +export const ETH_AMOUNT_SEND = parseUnits("101", 18); +export const ETH_AMOUNT_RECEIVED = parseUnits("100.99586785", 18); +export const WITHDRAW_ETH_AMOUNT_BASE = parseUnits("100", 18); +export const BASE_CHAIN_ID = 8453; // Base Chain ID +export const BASE_VWETH = "0xEB8A79bD44cF4500943bf94a2b4434c95C008599"; +export const BASE_WETH = "0x4200000000000000000000000000000000000006"; +export const VTREASURY_BASE = "0xbefD8d06f403222dd5E8e37D2ba93320A97939D1"; + +export const vip476 = () => { + const meta = { + version: "v2", + title: "VIP-476", + description: + "Bootstrapping WETH market on Base with Protocol-OwnedLiquidity(POL), Deposit 100 WETH into the WETH market on Base, using Venus Treasury funds", + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: VTREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [BSCMAINNET_ETH, ETH_AMOUNT_SEND, NORMAL_TIMELOCK], + }, + { + target: BSCMAINNET_ETH, + signature: "approve(address,uint256)", + params: [DLNSOURCE_CONTRACT, ETH_AMOUNT_SEND], + }, + { + target: DLNSOURCE_CONTRACT, + signature: + "createOrder((address,uint256,bytes,uint256,uint256,bytes,address,bytes,bytes,bytes,bytes),bytes,uint32,bytes)", + params: [ + [ + BSCMAINNET_ETH, + ETH_AMOUNT_SEND, + BASE_WETH, + ETH_AMOUNT_RECEIVED, + BASE_CHAIN_ID, + VTREASURY_BASE, + VTREASURY_BASE, + VTREASURY_BASE, + "0x", + "0x", + "0x", + ], + affiliateFee, + 0, + "0x", + ], + value: BRIDGE_FEES.toString(), + }, + { + target: BSCMAINNET_ETH, + signature: "approve(address,uint256)", + params: [DLNSOURCE_CONTRACT, 0], + }, + { + target: VTREASURY_BASE, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [BASE_WETH, WITHDRAW_ETH_AMOUNT_BASE, basemainnet.NORMAL_TIMELOCK], + dstChainId: LzChainId.basemainnet, + }, + { + target: BASE_WETH, + signature: "approve(address,uint256)", + params: [BASE_VWETH, WITHDRAW_ETH_AMOUNT_BASE], + dstChainId: LzChainId.basemainnet, + }, + { + target: BASE_VWETH, + signature: "mintBehalf(address,uint256)", + params: [VTREASURY_BASE, WITHDRAW_ETH_AMOUNT_BASE], + dstChainId: LzChainId.basemainnet, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip476; From 53cdd6fd0b17e2bac4d649cb2f8dafa9383effe7 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 9 Apr 2025 17:35:00 +0530 Subject: [PATCH 2/4] fix: lint issues --- simulations/vip-476/basemainnet.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/simulations/vip-476/basemainnet.ts b/simulations/vip-476/basemainnet.ts index d43c7380e..589fc5b72 100644 --- a/simulations/vip-476/basemainnet.ts +++ b/simulations/vip-476/basemainnet.ts @@ -9,7 +9,6 @@ import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import vip476, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-476/bscmainnet"; import ERC20_ABI from "./abi/ERC20.json"; import VTOKEN_ABI from "./abi/vToken.json"; -import VTREASURY_ABI from "./abi/vTreasury.json"; // "mintBehalf(address,uint256)" internally executes comptroller.preMintHook(address(this), minter, mintAmount) // and distribute reward tokens through "rewardsDistributor.distributeSupplierRewardToken(vToken, minter)" @@ -28,12 +27,10 @@ forking(28615549, async () => { let wethHolderSigner: SignerWithAddress; let wethBalanceForVWeth: BigNumber; let vWethBalanceForTreasury: BigNumber; - let treasury: Contract; before(async () => { weth = new ethers.Contract(BASE_WETH, ERC20_ABI, ethers.provider); vWeth = new ethers.Contract(BASE_VWETH, VTOKEN_ABI, ethers.provider); - treasury = new ethers.Contract(VTREASURY_BASE, VTREASURY_ABI, ethers.provider); wethBalanceForVWeth = await weth.balanceOf(BASE_VWETH); vWethBalanceForTreasury = await vWeth.balanceOf(VTREASURY_BASE); wethHolderSigner = await initMainnetUser(wethHolder_address, ethers.utils.parseEther("1")); From eb970a66826d4cf9360e3f2ca93c4847e9b20608 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 11 Apr 2025 17:03:14 +0530 Subject: [PATCH 3/4] refactor: update vip sequence --- simulations/{vip-476 => vip-477}/abi/dlnSource.json | 0 .../{vip-476/abi/ERC20.json => vip-477/abi/erc20.json} | 0 .../abi/omnichainProposalSender.json} | 0 simulations/{vip-476 => vip-477}/abi/vToken.json | 0 .../abi/VTreasury.json => vip-477/abi/vTreasury.json} | 0 simulations/{vip-476 => vip-477}/basemainnet.ts | 10 +++++----- simulations/{vip-476 => vip-477}/bscmainnet.ts | 8 ++++---- vips/{vip-476 => vip-477}/bscmainnet.ts | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) rename simulations/{vip-476 => vip-477}/abi/dlnSource.json (100%) rename simulations/{vip-476/abi/ERC20.json => vip-477/abi/erc20.json} (100%) rename simulations/{vip-476/abi/OmnichainProposalSender.json => vip-477/abi/omnichainProposalSender.json} (100%) rename simulations/{vip-476 => vip-477}/abi/vToken.json (100%) rename simulations/{vip-476/abi/VTreasury.json => vip-477/abi/vTreasury.json} (100%) rename simulations/{vip-476 => vip-477}/basemainnet.ts (87%) rename simulations/{vip-476 => vip-477}/bscmainnet.ts (80%) rename vips/{vip-476 => vip-477}/bscmainnet.ts (97%) diff --git a/simulations/vip-476/abi/dlnSource.json b/simulations/vip-477/abi/dlnSource.json similarity index 100% rename from simulations/vip-476/abi/dlnSource.json rename to simulations/vip-477/abi/dlnSource.json diff --git a/simulations/vip-476/abi/ERC20.json b/simulations/vip-477/abi/erc20.json similarity index 100% rename from simulations/vip-476/abi/ERC20.json rename to simulations/vip-477/abi/erc20.json diff --git a/simulations/vip-476/abi/OmnichainProposalSender.json b/simulations/vip-477/abi/omnichainProposalSender.json similarity index 100% rename from simulations/vip-476/abi/OmnichainProposalSender.json rename to simulations/vip-477/abi/omnichainProposalSender.json diff --git a/simulations/vip-476/abi/vToken.json b/simulations/vip-477/abi/vToken.json similarity index 100% rename from simulations/vip-476/abi/vToken.json rename to simulations/vip-477/abi/vToken.json diff --git a/simulations/vip-476/abi/VTreasury.json b/simulations/vip-477/abi/vTreasury.json similarity index 100% rename from simulations/vip-476/abi/VTreasury.json rename to simulations/vip-477/abi/vTreasury.json diff --git a/simulations/vip-476/basemainnet.ts b/simulations/vip-477/basemainnet.ts similarity index 87% rename from simulations/vip-476/basemainnet.ts rename to simulations/vip-477/basemainnet.ts index 589fc5b72..c978dec90 100644 --- a/simulations/vip-476/basemainnet.ts +++ b/simulations/vip-477/basemainnet.ts @@ -6,8 +6,8 @@ import { ethers } from "hardhat"; import { initMainnetUser } from "src/utils"; import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; -import vip476, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-476/bscmainnet"; -import ERC20_ABI from "./abi/ERC20.json"; +import vip477, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-477/bscmainnet"; +import ERC20_ABI from "./abi/erc20.json"; import VTOKEN_ABI from "./abi/vToken.json"; // "mintBehalf(address,uint256)" internally executes comptroller.preMintHook(address(this), minter, mintAmount) @@ -17,7 +17,7 @@ import VTOKEN_ABI from "./abi/vToken.json"; // from the last checkpointed slot(block or second) up to the current slot(block or second) // and writes new checkpoint to storage and reduce spread reserves to protocol share reserve // i.e _doTransferOut(protocolSeizeShare, amount) -const rewardVTokensAccrued = ethers.BigNumber.from("101443046573365"); // till block 28615549 +const rewardVTokensAccrued = ethers.BigNumber.from("995969293046573365"); // till block 28615549 const VWETH_AMOUNT_RECEIVED = ethers.BigNumber.from("9968973998"); // till block 28615549 const wethHolder_address = "0xb2cc224c1c9feE385f8ad6a55b4d94E92359DC59"; @@ -39,8 +39,8 @@ forking(28615549, async () => { }); testForkedNetworkVipCommands( - "VIP-476 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", - await vip476(), + "VIP-477 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", + await vip477(), ); describe("Post-VIP behaviour", async () => { diff --git a/simulations/vip-476/bscmainnet.ts b/simulations/vip-477/bscmainnet.ts similarity index 80% rename from simulations/vip-476/bscmainnet.ts rename to simulations/vip-477/bscmainnet.ts index e36d73cfe..3fa83b2ad 100644 --- a/simulations/vip-476/bscmainnet.ts +++ b/simulations/vip-477/bscmainnet.ts @@ -5,10 +5,10 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { expectEvents } from "src/utils"; import { forking, testVip } from "src/vip-framework"; -import vip476, { BSCMAINNET_ETH, ETH_AMOUNT_SEND } from "../../vips/vip-476/bscmainnet"; -import ERC20_ABI from "./abi/ERC20.json"; -import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; +import vip477, { BSCMAINNET_ETH, ETH_AMOUNT_SEND } from "../../vips/vip-477/bscmainnet"; import DLNSOURCE_ABI from "./abi/dlnSource.json"; +import ERC20_ABI from "./abi/erc20.json"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/omnichainProposalSender.json"; const { VTREASURY } = NETWORK_ADDRESSES["bscmainnet"]; @@ -22,7 +22,7 @@ forking(48142130, async () => { beforeTransfer = await eth.balanceOf(VTREASURY); }); - testVip("VIP-476 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", await vip476(), { + testVip("VIP-477 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", await vip477(), { callbackAfterExecution: async txResponse => { await expectEvents( txResponse, diff --git a/vips/vip-476/bscmainnet.ts b/vips/vip-477/bscmainnet.ts similarity index 97% rename from vips/vip-476/bscmainnet.ts rename to vips/vip-477/bscmainnet.ts index 41dfe6a1f..4a6c36eed 100644 --- a/vips/vip-476/bscmainnet.ts +++ b/vips/vip-477/bscmainnet.ts @@ -25,10 +25,10 @@ export const BASE_VWETH = "0xEB8A79bD44cF4500943bf94a2b4434c95C008599"; export const BASE_WETH = "0x4200000000000000000000000000000000000006"; export const VTREASURY_BASE = "0xbefD8d06f403222dd5E8e37D2ba93320A97939D1"; -export const vip476 = () => { +export const vip477 = () => { const meta = { version: "v2", - title: "VIP-476", + title: "VIP-477", description: "Bootstrapping WETH market on Base with Protocol-OwnedLiquidity(POL), Deposit 100 WETH into the WETH market on Base, using Venus Treasury funds", forDescription: "Execute this proposal", @@ -101,4 +101,4 @@ export const vip476 = () => { ); }; -export default vip476; +export default vip477; From 72064fdea1a51ab1df52add382ef493428dc8e4b Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 11 Apr 2025 17:09:50 +0530 Subject: [PATCH 4/4] refactor: update vip sequence --- simulations/{vip-477 => vip-479}/abi/dlnSource.json | 0 simulations/{vip-477 => vip-479}/abi/erc20.json | 0 .../{vip-477 => vip-479}/abi/omnichainProposalSender.json | 0 simulations/{vip-477 => vip-479}/abi/vToken.json | 0 simulations/{vip-477 => vip-479}/abi/vTreasury.json | 0 simulations/{vip-477 => vip-479}/basemainnet.ts | 6 +++--- simulations/{vip-477 => vip-479}/bscmainnet.ts | 4 ++-- vips/{vip-477 => vip-479}/bscmainnet.ts | 6 +++--- 8 files changed, 8 insertions(+), 8 deletions(-) rename simulations/{vip-477 => vip-479}/abi/dlnSource.json (100%) rename simulations/{vip-477 => vip-479}/abi/erc20.json (100%) rename simulations/{vip-477 => vip-479}/abi/omnichainProposalSender.json (100%) rename simulations/{vip-477 => vip-479}/abi/vToken.json (100%) rename simulations/{vip-477 => vip-479}/abi/vTreasury.json (100%) rename simulations/{vip-477 => vip-479}/basemainnet.ts (92%) rename simulations/{vip-477 => vip-479}/bscmainnet.ts (87%) rename vips/{vip-477 => vip-479}/bscmainnet.ts (97%) diff --git a/simulations/vip-477/abi/dlnSource.json b/simulations/vip-479/abi/dlnSource.json similarity index 100% rename from simulations/vip-477/abi/dlnSource.json rename to simulations/vip-479/abi/dlnSource.json diff --git a/simulations/vip-477/abi/erc20.json b/simulations/vip-479/abi/erc20.json similarity index 100% rename from simulations/vip-477/abi/erc20.json rename to simulations/vip-479/abi/erc20.json diff --git a/simulations/vip-477/abi/omnichainProposalSender.json b/simulations/vip-479/abi/omnichainProposalSender.json similarity index 100% rename from simulations/vip-477/abi/omnichainProposalSender.json rename to simulations/vip-479/abi/omnichainProposalSender.json diff --git a/simulations/vip-477/abi/vToken.json b/simulations/vip-479/abi/vToken.json similarity index 100% rename from simulations/vip-477/abi/vToken.json rename to simulations/vip-479/abi/vToken.json diff --git a/simulations/vip-477/abi/vTreasury.json b/simulations/vip-479/abi/vTreasury.json similarity index 100% rename from simulations/vip-477/abi/vTreasury.json rename to simulations/vip-479/abi/vTreasury.json diff --git a/simulations/vip-477/basemainnet.ts b/simulations/vip-479/basemainnet.ts similarity index 92% rename from simulations/vip-477/basemainnet.ts rename to simulations/vip-479/basemainnet.ts index c978dec90..24ad11fd2 100644 --- a/simulations/vip-477/basemainnet.ts +++ b/simulations/vip-479/basemainnet.ts @@ -6,7 +6,7 @@ import { ethers } from "hardhat"; import { initMainnetUser } from "src/utils"; import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; -import vip477, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-477/bscmainnet"; +import vip479, { BASE_VWETH, BASE_WETH, ETH_AMOUNT_RECEIVED, VTREASURY_BASE } from "../../vips/vip-479/bscmainnet"; import ERC20_ABI from "./abi/erc20.json"; import VTOKEN_ABI from "./abi/vToken.json"; @@ -39,8 +39,8 @@ forking(28615549, async () => { }); testForkedNetworkVipCommands( - "VIP-477 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", - await vip477(), + "VIP-479 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", + await vip479(), ); describe("Post-VIP behaviour", async () => { diff --git a/simulations/vip-477/bscmainnet.ts b/simulations/vip-479/bscmainnet.ts similarity index 87% rename from simulations/vip-477/bscmainnet.ts rename to simulations/vip-479/bscmainnet.ts index 3fa83b2ad..b15717fc9 100644 --- a/simulations/vip-477/bscmainnet.ts +++ b/simulations/vip-479/bscmainnet.ts @@ -5,7 +5,7 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { expectEvents } from "src/utils"; import { forking, testVip } from "src/vip-framework"; -import vip477, { BSCMAINNET_ETH, ETH_AMOUNT_SEND } from "../../vips/vip-477/bscmainnet"; +import vip479, { BSCMAINNET_ETH, ETH_AMOUNT_SEND } from "../../vips/vip-479/bscmainnet"; import DLNSOURCE_ABI from "./abi/dlnSource.json"; import ERC20_ABI from "./abi/erc20.json"; import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/omnichainProposalSender.json"; @@ -22,7 +22,7 @@ forking(48142130, async () => { beforeTransfer = await eth.balanceOf(VTREASURY); }); - testVip("VIP-477 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", await vip477(), { + testVip("VIP-479 Bridge 101 ETH from the Treasury on BNB Chain to the Treasury on Base", await vip479(), { callbackAfterExecution: async txResponse => { await expectEvents( txResponse, diff --git a/vips/vip-477/bscmainnet.ts b/vips/vip-479/bscmainnet.ts similarity index 97% rename from vips/vip-477/bscmainnet.ts rename to vips/vip-479/bscmainnet.ts index 4a6c36eed..cfecb94a0 100644 --- a/vips/vip-477/bscmainnet.ts +++ b/vips/vip-479/bscmainnet.ts @@ -25,10 +25,10 @@ export const BASE_VWETH = "0xEB8A79bD44cF4500943bf94a2b4434c95C008599"; export const BASE_WETH = "0x4200000000000000000000000000000000000006"; export const VTREASURY_BASE = "0xbefD8d06f403222dd5E8e37D2ba93320A97939D1"; -export const vip477 = () => { +export const vip479 = () => { const meta = { version: "v2", - title: "VIP-477", + title: "VIP-479", description: "Bootstrapping WETH market on Base with Protocol-OwnedLiquidity(POL), Deposit 100 WETH into the WETH market on Base, using Venus Treasury funds", forDescription: "Execute this proposal", @@ -101,4 +101,4 @@ export const vip477 = () => { ); }; -export default vip477; +export default vip479;