From d62b6a2b5ebd69bae7f3cf7530a9809b5aca2a7d Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:14:29 +0530 Subject: [PATCH 1/5] feat: add VIP for Ethena pool on sepolia --- .../abi/OmnichainProposalSender.json | 314 +++ .../vip-407+vip-408/abi/ResilientOracle.json | 301 +++ .../abi/SingleTokenConverter.json | 1267 +++++++++++ .../vip-407+vip-408/abi/comptroller.json | 1496 +++++++++++++ simulations/vip-407+vip-408/abi/erc20.json | 295 +++ .../vip-407+vip-408/abi/poolRegistry.json | 724 +++++++ simulations/vip-407+vip-408/abi/vToken.json | 1872 +++++++++++++++++ simulations/vip-407+vip-408/bsctestnet.ts | 28 + simulations/vip-407+vip-408/sepolia.ts | 397 ++++ vips/vip-407/bsctestnet.ts | 261 +++ vips/vip-408/bsctestnet.ts | 188 ++ 11 files changed, 7143 insertions(+) create mode 100644 simulations/vip-407+vip-408/abi/OmnichainProposalSender.json create mode 100644 simulations/vip-407+vip-408/abi/ResilientOracle.json create mode 100644 simulations/vip-407+vip-408/abi/SingleTokenConverter.json create mode 100644 simulations/vip-407+vip-408/abi/comptroller.json create mode 100644 simulations/vip-407+vip-408/abi/erc20.json create mode 100644 simulations/vip-407+vip-408/abi/poolRegistry.json create mode 100644 simulations/vip-407+vip-408/abi/vToken.json create mode 100644 simulations/vip-407+vip-408/bsctestnet.ts create mode 100644 simulations/vip-407+vip-408/sepolia.ts create mode 100644 vips/vip-407/bsctestnet.ts create mode 100644 vips/vip-408/bsctestnet.ts diff --git a/simulations/vip-407+vip-408/abi/OmnichainProposalSender.json b/simulations/vip-407+vip-408/abi/OmnichainProposalSender.json new file mode 100644 index 000000000..66fd4df02 --- /dev/null +++ b/simulations/vip-407+vip-408/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-407+vip-408/abi/ResilientOracle.json b/simulations/vip-407+vip-408/abi/ResilientOracle.json new file mode 100644 index 000000000..e2f944a9d --- /dev/null +++ b/simulations/vip-407+vip-408/abi/ResilientOracle.json @@ -0,0 +1,301 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "nativeMarketAddress", "type": "address" }, + { "internalType": "address", "name": "vaiAddress", "type": "address" }, + { "internalType": "contract BoundValidatorInterface", "name": "_boundValidator", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" }, + { "indexed": true, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "OracleEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "oracle", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" } + ], + "name": "OracleSet", + "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": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "mainOracle", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "pivotOracle", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "INVALID_PRICE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "boundValidator", + "outputs": [{ "internalType": "contract BoundValidatorInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "enableOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "getOracle", + "outputs": [ + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getTokenConfig", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getUnderlyingPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nativeMarket", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "setOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "updateAssetPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "updatePrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vai", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/SingleTokenConverter.json b/simulations/vip-407+vip-408/abi/SingleTokenConverter.json new file mode 100644 index 000000000..1c8e0f8ec --- /dev/null +++ b/simulations/vip-407+vip-408/abi/SingleTokenConverter.json @@ -0,0 +1,1267 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "conversionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "converterNetwork", + "outputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "destinationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ + { + "internalType": "contract ResilientOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" + } + ], + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" + } + ], + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + } + ], + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/comptroller.json b/simulations/vip-407+vip-408/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-407+vip-408/abi/comptroller.json @@ -0,0 +1,1496 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "poolRegistry_", + "type": "address" + }, + { + "internalType": "address", + "name": "accessControl_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "ActionPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedLessThanOrEqualTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { + "inputs": [], + "name": "ComptrollerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralToSeize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableCollateral", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientShortfall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCollateralFactor", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLiquidationThreshold", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedGreaterThan", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { + "inputs": [], + "name": "NonzeroBorrowBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PriceError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "TooMuchRepay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedSender", + "type": "address" + }, + { + "internalType": "address", + "name": "actualSender", + "type": "address" + } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinLiquidatableCollateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardsDistributor", + "type": "address" + } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControl", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RewardsDistributor", + "name": "_rewardsDistributor", + "type": "address" + } + ], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [ + { + "internalType": "contract RewardsDistributor[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "supplySpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowSpeed", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isDeprecated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract VToken", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensToSeize", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract PriceOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "skipLiquidityCheck", + "type": "bool" + } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "seizerContract", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "marketsList", + "type": "address[]" + }, + { + "internalType": "enum ComptrollerStorage.Action[]", + "name": "actionsList", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PriceOracle", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/erc20.json b/simulations/vip-407+vip-408/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-407+vip-408/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-407+vip-408/abi/poolRegistry.json b/simulations/vip-407+vip-408/abi/poolRegistry.json new file mode 100644 index 000000000..2d0268aeb --- /dev/null +++ b/simulations/vip-407+vip-408/abi/poolRegistry.json @@ -0,0 +1,724 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "MarketAdded", + "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": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "enum PoolRegistryInterface.RiskRating", + "name": "riskRating", + "type": "uint8" + }, + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "oldMetadata", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "enum PoolRegistryInterface.RiskRating", + "name": "riskRating", + "type": "uint8" + }, + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "newMetadata", + "type": "tuple" + } + ], + "name": "PoolMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "oldName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "PoolNameSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "pool", + "type": "tuple" + } + ], + "name": "PoolRegistered", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "enum PoolRegistry.InterestRateModels", + "name": "rateModel", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "baseRatePerYear", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "multiplierPerYear", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "jumpMultiplierPerYear", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "kink_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "contract AccessControlManager", + "name": "accessControlManager", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenProxyAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "beaconAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supplyCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistry.AddMarketInput", + "name": "input", + "type": "tuple" + } + ], + "name": "addMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "beaconAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidatableCollateral", + "type": "uint256" + }, + { + "internalType": "address", + "name": "priceOracle", + "type": "address" + } + ], + "name": "createRegistryPool", + "outputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "address", + "name": "proxyAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllPools", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPool[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getPoolByComptroller", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getPoolsSupportedByAsset", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getVTokenForAsset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getVenusPoolMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "enum PoolRegistryInterface.RiskRating", + "name": "riskRating", + "type": "uint8" + }, + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VTokenProxyFactory", + "name": "_vTokenFactory", + "type": "address" + }, + { + "internalType": "contract JumpRateModelFactory", + "name": "_jumpRateFactory", + "type": "address" + }, + { + "internalType": "contract WhitePaperInterestRateModelFactory", + "name": "_whitePaperFactory", + "type": "address" + }, + { + "internalType": "contract Shortfall", + "name": "_shortfall", + "type": "address" + }, + { + "internalType": "address payable", + "name": "riskFund_", + "type": "address" + }, + { + "internalType": "address payable", + "name": "protocolShareReserve_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "metadata", + "outputs": [ + { + "internalType": "enum PoolRegistryInterface.RiskRating", + "name": "riskRating", + "type": "uint8" + }, + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "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": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "enum PoolRegistryInterface.RiskRating", + "name": "riskRating", + "type": "uint8" + }, + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "_metadata", + "type": "tuple" + } + ], + "name": "updatePoolMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/vToken.json b/simulations/vip-407+vip-408/abi/vToken.json new file mode 100644 index 000000000..a413ca84d --- /dev/null +++ b/simulations/vip-407+vip-408/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-407+vip-408/bsctestnet.ts b/simulations/vip-407+vip-408/bsctestnet.ts new file mode 100644 index 000000000..31c39c970 --- /dev/null +++ b/simulations/vip-407+vip-408/bsctestnet.ts @@ -0,0 +1,28 @@ +import { expectEvents } from "../../src/utils"; +import { forking, testVip } from "../../src/vip-framework"; +import vip407 from "../../vips/vip-407/bsctestnet"; +import vip408 from "../../vips/vip-407/bsctestnet"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +forking(46452753, async () => { + testVip("Ethena", await vip407(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); + testVip("Ethena", await vip408(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); +}); diff --git a/simulations/vip-407+vip-408/sepolia.ts b/simulations/vip-407+vip-408/sepolia.ts new file mode 100644 index 000000000..127f34dd7 --- /dev/null +++ b/simulations/vip-407+vip-408/sepolia.ts @@ -0,0 +1,397 @@ +import { expect } from "chai"; +import { BigNumber, BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { + COMPTROLLER_ETHENA, + MockPT_USDe_27MAR2025, + MockPT_sUSDE_27MAR2025, + MockUSDC, + MocksUSDe, + VPT_USDe_27MAR2025_ETHENA, + VPT_sUSDE_27MAR2025_ETHENA, + VUSDC_Ethena, + VsUSDe_Ethena, + vip407, +} from "../../vips/vip-407/bsctestnet"; +import { CONVERSION_INCENTIVE, converterBaseAssets, underlyingAddress, vip408 } from "../../vips/vip-408/bsctestnet"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const { sepolia } = NETWORK_ADDRESSES; + +const BLOCKS_PER_YEAR = BigNumber.from("2252571"); // assuming a block is mined every 14 seconds +const GUARDIAN = "0xb15f6EfEbC276A3b9805df81b5FB3D50C2A62BDf"; + +type VTokenSymbol = "vPT-USDe-27MAR2025_Ethena" | "vPT-sUSDE-27MAR2025_Ethena" | "vsUSDe_Ethena" | "vUSDC_Ethena"; + +const vTokens: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": VPT_USDe_27MAR2025_ETHENA, + "vPT-sUSDE-27MAR2025_Ethena": VPT_sUSDE_27MAR2025_ETHENA, + vsUSDe_Ethena: VsUSDe_Ethena, + vUSDC_Ethena: VUSDC_Ethena, +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: number; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + "vPT-USDe-27MAR2025_Ethena": { + name: "Venus PT-USDe-27MAR2025(Ethena)", + symbol: "vPT-USDe-27MAR2025_Ethena", + decimals: 8, + underlying: MockPT_USDe_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + "vPT-sUSDE-27MAR2025_Ethena": { + name: "Venus PT-sUSDE-27MAR2025 (Ethena)", + symbol: "vPT-sUSDE-27MAR2025_Ethena", + decimals: 8, + underlying: MockPT_sUSDE_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + vsUSDe_Ethena: { + name: "Venus sUSDe (Ethena)", + symbol: "vsUSDe_Ethena", + decimals: 8, + underlying: MocksUSDe, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + vUSDC_Ethena: { + name: "Venus USDC (Ethena)", + symbol: "vUSDC_Ethena", + decimals: 8, + underlying: MockUSDC, + exchangeRate: parseUnits("1", 16), + comptroller: COMPTROLLER_ETHENA, + }, +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; + protocolSeizeShareMantissa: string; + price: BigNumber; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + "vPT-USDe-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "850000", + collateralFactor: "0.86", + liquidationThreshold: "0.88", + reserveFactor: "0", + initialSupply: "10619", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, + "vPT-sUSDE-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "12000000", + collateralFactor: "0.85", + liquidationThreshold: "0.87", + reserveFactor: "0", + initialSupply: "10653", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, + vsUSDe_Ethena: { + borrowCap: "0", + supplyCap: "50000000", + collateralFactor: "0.9", + liquidationThreshold: "0.92", + reserveFactor: "0", + initialSupply: "10000", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.0010", + price: parseUnits("1", 18), + }, + vUSDC_Ethena: { + borrowCap: "46000000", + supplyCap: "50000000", + collateralFactor: "0", + liquidationThreshold: "0", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.0020", + price: parseUnits("1", 18), + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: ["vPT-USDe-27MAR2025_Ethena", "vPT-sUSDE-27MAR2025_Ethena", "vsUSDe_Ethena"], + kink: "0.8", + base: "0", + multiplier: "0.07", + jump: "0.8", + }, + { + vTokens: ["vUSDC_Ethena"], + kink: "0.92", + base: "0", + multiplier: "0.16304", + jump: "2.5", + }, +]; + +const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": "", + "vPT-sUSDE-27MAR2025_Ethena": "", + vsUSDe_Ethena: "", + vUSDC_Ethena: "", +}; + +forking(7270036, async () => { + let poolRegistry: Contract; + let noOfPools: BigNumber; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, sepolia.POOL_REGISTRY); + }); + + describe("Contracts setup", async () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testForkedNetworkVipCommands("Ethena pool", await vip407()); + testForkedNetworkVipCommands("Ethena pool", await vip408()); + + describe("Post-Execution state", () => { + before(async () => { + noOfPools = await poolRegistry.getAllPools(); + + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + interestRateModelAddresses[symbol] = await vToken.interestRateModel(); + } + } + }); + describe("PoolRegistry state", () => { + let registeredPools: { name: string; creator: string; comptroller: string }[]; + + before(async () => { + console.log(`PoolRegistry: ${poolRegistry.address}`); + registeredPools = await poolRegistry.getAllPools(); + }); + + it("should have 4 pools", async () => { + expect(registeredPools).to.have.lengthOf(noOfPools.add(1)); + }); + + it("should register Ethena pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Ethena"); + expect(pool.creator).to.equal(GUARDIAN); + expect(pool.comptroller).to.equal(COMPTROLLER_ETHENA); + }); + + it("should register Core pool vTokens in Core pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_ETHENA); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(4); + expect(poolVTokens).to.include(vTokens["vPT-USDe-27MAR2025_Ethena"]); + expect(poolVTokens).to.include(vTokens["vPT-sUSDE-27MAR2025_Ethena"]); + expect(poolVTokens).to.include(vTokens.vUSDC_Ethena); + expect(poolVTokens).to.include(vTokens.vsUSDe_Ethena); + }); + + for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { + it(`should register ${symbol} in PoolRegistry`, async () => { + const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); + expect(registeredVToken).to.equal(vTokens[symbol]); + }); + } + }); + + describe("Ownership", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(GUARDIAN); + }); + } + }); + + describe("Initial supply", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + it(`should mint initial supply of ${symbol} to ${params.vTokenReceiver}`, async () => { + // Since we're distributing 1:1, decimals should be accounted for in the exchange rate + const expectedSupply = parseUnits(params.initialSupply, 8); + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + expect(await vToken.balanceOf(params.vTokenReceiver)).to.equal(expectedSupply); + }); + } + }); + + describe("Risk parameters", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + describe(`${symbol} risk parameters`, () => { + let vToken: Contract; + let comptroller: Contract; + let underlyingDecimals: number; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, vTokenState[symbol].comptroller); + const underlyingAddress = vTokenState[symbol].underlying; + const underlying = await ethers.getContractAt(ERC20_ABI, underlyingAddress); + underlyingDecimals = await underlying.decimals(); + }); + + it(`should set ${symbol} reserve factor to ${params.reserveFactor}`, async () => { + expect(await vToken.reserveFactorMantissa()).to.equal(parseUnits(params.reserveFactor, 18)); + }); + + it(`should set ${symbol} collateral factor to ${params.collateralFactor}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.collateralFactorMantissa).to.equal(parseUnits(params.collateralFactor, 18)); + }); + + it(`should set ${symbol} liquidation threshold to ${params.liquidationThreshold}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.liquidationThresholdMantissa).to.equal(parseUnits(params.liquidationThreshold, 18)); + }); + + it(`should set ${symbol} protocol seize share ${params.protocolSeizeShareMantissa}`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal( + parseUnits(params.protocolSeizeShareMantissa, 18), + ); + }); + + it(`should set ${symbol} supply cap to ${params.supplyCap}`, async () => { + expect(await comptroller.supplyCaps(vTokens[symbol])).to.equal( + parseUnits(params.supplyCap, underlyingDecimals), + ); + }); + + it(`should set ${symbol} borrow cap to ${params.borrowCap}`, async () => { + expect(await comptroller.borrowCaps(vTokens[symbol])).to.equal( + parseUnits(params.borrowCap, underlyingDecimals), + ); + }); + }); + } + }); + + describe("Pools configuration", () => { + const checkComptroller = (comptrollerAddress: string, comptrollerName: string) => { + describe(`${comptrollerName} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, comptrollerAddress); + }); + + it("should use the correct comptroller address", async () => { + expect(comptroller.address).to.equal(comptrollerAddress); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(sepolia.RESILIENT_ORACLE); + }); + + it("should have close factor = 0.5", async () => { + expect(await comptroller.closeFactorMantissa()).to.equal(parseUnits("0.5", 18)); + }); + + it("should have liquidation incentive = 1.04", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.04", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = GUARDIAN", async () => { + expect(await comptroller.owner()).to.equal(GUARDIAN); + }); + }); + }; + + checkComptroller(COMPTROLLER_ETHENA, "Ethena"); + }); + + it("Interest rates", async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate( + interestRateModelAddresses[symbol], + symbol, + { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }, + BLOCKS_PER_YEAR, + ); + } + } + }); + it("Check Price", async () => { + const resilientOracle = new ethers.Contract(sepolia.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).to.be.closeTo( + params.price, + parseUnits("1", 18), + ); + expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).to.be.closeTo( + params.price, + parseUnits("1", 18), + ); + } + }); + + describe("Converters", () => { + for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { + const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + for (const asset of underlyingAddress) { + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset ${asset}`, async () => { + const result = await converterContract.conversionConfigurations(baseAsset, asset); + expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + }); + } + } + }); + }); +}); diff --git a/vips/vip-407/bsctestnet.ts b/vips/vip-407/bsctestnet.ts new file mode 100644 index 000000000..a91f825a6 --- /dev/null +++ b/vips/vip-407/bsctestnet.ts @@ -0,0 +1,261 @@ +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 { sepolia } = NETWORK_ADDRESSES; + +export const ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; +export const COMPTROLLER_ETHENA = "0x05Cdc6c3dceA796971Db0d9edDbC7C56f2176D1c"; + +export const MockPT_USDe_27MAR2025 = "0x74671106a04496199994787B6BcB064d08afbCCf"; +export const MockPT_sUSDE_27MAR2025 = "0x3EBa2Aa29eC2498c2124523634324d4ce89c8579"; +export const MocksUSDe = "0xD28894b4A8AB53Ce55965AfD330b55C2DbB3E07D"; +export const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; +const MockUSDe = "0x8bAe3E12870a002A0D4b6Eb0F0CBf91b29d9806F"; + +export const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; +export const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; +export const VsUSDe_Ethena = "0xb17abC45289EE8075447853D4E443f1E7e36fF99"; +export const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; + +const ERC4626ORACLE = "0x4EeA919A68db78572f5B2bb69815D325923AE5AD"; +const MockPendleOracle_PT_USDe_27MAR2025 = "0x063a57223EE477d7CB959bc7328d3A06494931A9"; +const MockPendleOracle_PT_sUSDe_27MAR2025 = "0x981217A0bb898752543D54cE782DAfb7427b9B54"; +const PendleOracle_PT_USDe_27MAR2025 = "0xFad31F9f22ED81F4aa998A12B51ED9f2169C7D3E"; +const PendleOracle_PT_sUSDe_27MAR2025 = "0x6123151E67922a197DdF9e7F73c8a28A0664fCd5"; +const BOUND_VALIDATOR = "0x60c4Aa92eEb6884a76b309Dd8B3731ad514d6f9B"; + +const CHAINLINK_USDe_FEED = "0x55ec7c3ed0d7CB5DF4d3d8bfEd2ecaf28b4638fb"; + +export const EXCHANGE_RATE = parseUnits("1", 18); +const TWAP_DURATION = 1800; +const STALE_PERIOD_26H = 60 * 60 * 26; // 26 hours (pricefeeds with heartbeat of 24 hr) +const UPPER_BOUND_RATIO = parseUnits("1.01", 18); +const LOWER_BOUND_RATIO = parseUnits("0.99", 18); + +export const vip407 = () => { + const meta = { + version: "v2", + title: "VIP-407 [Sepolia] New Ethena pool", + description: `#### Summary`, + forDescription: "Process to configure and launch the new pool", + againstDescription: "Defer configuration and launch of the new pool", + abstainDescription: "No opinion on the matter", + }; + return makeProposal( + [ + { + target: COMPTROLLER_ETHENA, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.sepolia, + }, + { + target: BOUND_VALIDATOR, + signature: "setValidateConfig((address,uint256,uint256))", + params: [[MockPT_USDe_27MAR2025, UPPER_BOUND_RATIO, LOWER_BOUND_RATIO]], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.REDSTONE_ORACLE, + signature: "setDirectPrice(address,uint256)", + params: [MockUSDe, parseUnits("1", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.CHAINLINK_ORACLE, + signature: "setTokenConfig((address,address,uint256))", + params: [[MockUSDe, CHAINLINK_USDe_FEED, STALE_PERIOD_26H]], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + MockPT_USDe_27MAR2025, + [sepolia.REDSTONE_ORACLE, sepolia.CHAINLINK_ORACLE, sepolia.CHAINLINK_ORACLE], + [true, true, true], + ], + ], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + MocksUSDe, + [ERC4626ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.sepolia, + }, + + { + target: MockPendleOracle_PT_USDe_27MAR2025, + signature: "setPtToAssetRate(address,uint32,uint256)", + params: [VPT_USDe_27MAR2025_ETHENA, TWAP_DURATION, EXCHANGE_RATE], + dstChainId: LzChainId.sepolia, + }, + + { + target: sepolia.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + MockPT_USDe_27MAR2025, + [PendleOracle_PT_USDe_27MAR2025, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.sepolia, + }, + { + target: MockPendleOracle_PT_sUSDe_27MAR2025, + signature: "setPtToAssetRate(address,uint32,uint256)", + params: [MockPT_sUSDE_27MAR2025, TWAP_DURATION, EXCHANGE_RATE], + dstChainId: LzChainId.sepolia, + }, + + { + target: sepolia.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + MockPT_sUSDE_27MAR2025, + [PendleOracle_PT_sUSDe_27MAR2025, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.sepolia, + }, + + { + target: COMPTROLLER_ETHENA, + signature: "setPriceOracle(address)", + params: [sepolia.RESILIENT_ORACLE], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["Core", COMPTROLLER_ETHENA, parseUnits("0.5", 18), parseUnits("1.04", 18), parseUnits("100", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [MockPT_USDe_27MAR2025, parseUnits("10619", 18), sepolia.NORMAL_TIMELOCK], + dstChainId: LzChainId.sepolia, + }, + { + target: MockPT_USDe_27MAR2025, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, 0], + dstChainId: LzChainId.sepolia, + }, + { + target: MockPT_USDe_27MAR2025, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, parseUnits("10619", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: VPT_USDe_27MAR2025_ETHENA, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VPT_USDe_27MAR2025_ETHENA, + parseUnits("0.86", 18), + parseUnits("0.88", 18), + parseUnits("10619", 18), + sepolia.VTREASURY, + parseUnits("850000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [MockPT_sUSDE_27MAR2025, parseUnits("10000", 18), sepolia.NORMAL_TIMELOCK], + dstChainId: LzChainId.sepolia, + }, + { + target: MockPT_sUSDE_27MAR2025, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, 0], + dstChainId: LzChainId.sepolia, + }, + { + target: MockPT_sUSDE_27MAR2025, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, parseUnits("10000", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: VPT_sUSDE_27MAR2025_ETHENA, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VPT_sUSDE_27MAR2025_ETHENA, + parseUnits("0.85", 18), + parseUnits("0.87", 18), + parseUnits("10000", 18), + sepolia.VTREASURY, + parseUnits("12000000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.sepolia, + }, + + { + target: VPT_USDe_27MAR2025_ETHENA, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.004", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: VPT_sUSDE_27MAR2025_ETHENA, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.004", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: VsUSDe_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.0010", 18)], + dstChainId: LzChainId.sepolia, + }, + + { + target: VUSDC_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.0020", 18)], + dstChainId: LzChainId.sepolia, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip407; diff --git a/vips/vip-408/bsctestnet.ts b/vips/vip-408/bsctestnet.ts new file mode 100644 index 000000000..a5f9308df --- /dev/null +++ b/vips/vip-408/bsctestnet.ts @@ -0,0 +1,188 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { sepolia } = NETWORK_ADDRESSES; + +const COMPTROLLER_ETHENA = "0x05Cdc6c3dceA796971Db0d9edDbC7C56f2176D1c"; + +const MockPT_USDe_27MAR2025 = "0x74671106a04496199994787B6BcB064d08afbCCf"; +const MockPT_sUSDE_27MAR2025 = "0x3EBa2Aa29eC2498c2124523634324d4ce89c8579"; +const MocksUSDe = "0xD28894b4A8AB53Ce55965AfD330b55C2DbB3E07D"; +const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; + +const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; +const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; +const VsUSDe_Ethena = "0xb17abC45289EE8075447853D4E443f1E7e36fF99"; +const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; + +export const underlyingAddress = [MockPT_USDe_27MAR2025, MockPT_sUSDE_27MAR2025, MocksUSDe, MockUSDC]; + +enum ConversionAccessibility { + NONE = 0, + ALL = 1, + ONLY_FOR_CONVERTERS = 2, + ONLY_FOR_USERS = 3, +} + +export const CONVERSION_INCENTIVE = 1e14; + +export const USDT_PRIME_CONVERTER = "0x3716C24EA86A67cAf890d7C9e4C4505cDDC2F8A2"; +export const USDC_PRIME_CONVERTER = "0x511a559a699cBd665546a1F75908f7E9454Bfc67"; +export const WBTC_PRIME_CONVERTER = "0x8a3937F27921e859db3FDA05729CbCea8cfd82AE"; +export const WETH_PRIME_CONVERTER = "0x274a834eFFA8D5479502dD6e78925Bc04ae82B46"; +export const XVS_VAULT_CONVERTER = "0xc203bfA9dCB0B5fEC510Db644A494Ff7f4968ed2"; +const USDT = "0x8d412FD0bc5d826615065B931171Eed10F5AF266"; +const USDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; +const WBTC = "0x92A2928f5634BEa89A195e7BeCF0f0FEEDAB885b"; +const WETH = "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9"; +const XVS = "0x66ebd019E86e0af5f228a0439EBB33f045CBe63E"; + +export const converterBaseAssets = { + [USDT_PRIME_CONVERTER]: USDT, + [USDC_PRIME_CONVERTER]: USDC, + [WBTC_PRIME_CONVERTER]: WBTC, + [WETH_PRIME_CONVERTER]: WETH, + [XVS_VAULT_CONVERTER]: XVS, +}; + +export const vip408 = () => { + const meta = { + version: "v2", + title: "VIP-408 [Sepolia] New Ethena pool (Part-II)", + description: `#### Summary`, + forDescription: "Process to configure and launch the new pool", + againstDescription: "Defer configuration and launch of the new pool", + abstainDescription: "No opinion on the matter", + }; + return makeProposal( + [ + { + target: sepolia.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [MocksUSDe, parseUnits("10653", 6), sepolia.NORMAL_TIMELOCK], + dstChainId: LzChainId.sepolia, + }, + { + target: MocksUSDe, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, 0], + dstChainId: LzChainId.sepolia, + }, + { + target: MocksUSDe, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, parseUnits("10653", 6)], + dstChainId: LzChainId.sepolia, + }, + { + target: VsUSDe_Ethena, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VsUSDe_Ethena, + parseUnits("0.9", 18), + parseUnits("0.92", 18), + parseUnits("10653", 18), + sepolia.VTREASURY, + parseUnits("50000000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [MockUSDC, parseUnits("10000", 18), sepolia.NORMAL_TIMELOCK], + dstChainId: LzChainId.sepolia, + }, + { + target: MockUSDC, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, 0], + dstChainId: LzChainId.sepolia, + }, + { + target: MockUSDC, + signature: "approve(address,uint256)", + params: [sepolia.POOL_REGISTRY, parseUnits("10000", 18)], + dstChainId: LzChainId.sepolia, + }, + { + target: VUSDC_Ethena, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.sepolia, + }, + { + target: sepolia.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VUSDC_Ethena, + parseUnits("0", 18), + parseUnits("0", 18), + parseUnits("10000", 6), + sepolia.VTREASURY, + parseUnits("50000000", 6), + parseUnits("46000000", 6), + ], + ], + dstChainId: LzChainId.sepolia, + }, + + { + target: COMPTROLLER_ETHENA, + signature: "setActionsPaused(address[],uint256[],bool)", + params: [ + [VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA, VsUSDe_Ethena, VUSDC_Ethena], + [3, 3, 3, 8], + true, + ], + dstChainId: LzChainId.sepolia, + }, + + // Configure converters + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [MockPT_USDe_27MAR2025], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.sepolia, + })), + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [MockPT_sUSDE_27MAR2025], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.sepolia, + })), + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [MocksUSDe], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.sepolia, + })), + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [MockUSDC], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.sepolia, + })), + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip408; From 8898a7fc0a6aa70db93a4548159bf72bdff5a5ad Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:27:11 +0530 Subject: [PATCH 2/5] fix: typos --- simulations/vip-407+vip-408/sepolia.ts | 2 +- vips/vip-407/bsctestnet.ts | 17 +++++++---------- vips/vip-408/bsctestnet.ts | 8 ++++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/simulations/vip-407+vip-408/sepolia.ts b/simulations/vip-407+vip-408/sepolia.ts index 127f34dd7..b39a28223 100644 --- a/simulations/vip-407+vip-408/sepolia.ts +++ b/simulations/vip-407+vip-408/sepolia.ts @@ -177,7 +177,7 @@ const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { vUSDC_Ethena: "", }; -forking(7270036, async () => { +forking(7291756, async () => { let poolRegistry: Contract; let noOfPools: BigNumber; diff --git a/vips/vip-407/bsctestnet.ts b/vips/vip-407/bsctestnet.ts index a91f825a6..617ad661e 100644 --- a/vips/vip-407/bsctestnet.ts +++ b/vips/vip-407/bsctestnet.ts @@ -20,7 +20,7 @@ export const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1 export const VsUSDe_Ethena = "0xb17abC45289EE8075447853D4E443f1E7e36fF99"; export const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; -const ERC4626ORACLE = "0x4EeA919A68db78572f5B2bb69815D325923AE5AD"; +const ERC4626ORACLE = "0xa79EC375573f213860320cd401F2D90913AC28FF"; const MockPendleOracle_PT_USDe_27MAR2025 = "0x063a57223EE477d7CB959bc7328d3A06494931A9"; const MockPendleOracle_PT_sUSDe_27MAR2025 = "0x981217A0bb898752543D54cE782DAfb7427b9B54"; const PendleOracle_PT_USDe_27MAR2025 = "0xFad31F9f22ED81F4aa998A12B51ED9f2169C7D3E"; @@ -34,6 +34,7 @@ const TWAP_DURATION = 1800; const STALE_PERIOD_26H = 60 * 60 * 26; // 26 hours (pricefeeds with heartbeat of 24 hr) const UPPER_BOUND_RATIO = parseUnits("1.01", 18); const LOWER_BOUND_RATIO = parseUnits("0.99", 18); +const ADDRESS_ONE = "0x0000000000000000000000000000000000000001"; export const vip407 = () => { const meta = { @@ -55,7 +56,7 @@ export const vip407 = () => { { target: BOUND_VALIDATOR, signature: "setValidateConfig((address,uint256,uint256))", - params: [[MockPT_USDe_27MAR2025, UPPER_BOUND_RATIO, LOWER_BOUND_RATIO]], + params: [[MockUSDe, UPPER_BOUND_RATIO, LOWER_BOUND_RATIO]], dstChainId: LzChainId.sepolia, }, { @@ -74,11 +75,7 @@ export const vip407 = () => { target: sepolia.RESILIENT_ORACLE, signature: "setTokenConfig((address,address[3],bool[3]))", params: [ - [ - MockPT_USDe_27MAR2025, - [sepolia.REDSTONE_ORACLE, sepolia.CHAINLINK_ORACLE, sepolia.CHAINLINK_ORACLE], - [true, true, true], - ], + [MockUSDe, [sepolia.REDSTONE_ORACLE, sepolia.CHAINLINK_ORACLE, sepolia.CHAINLINK_ORACLE], [true, true, true]], ], dstChainId: LzChainId.sepolia, }, @@ -98,7 +95,7 @@ export const vip407 = () => { { target: MockPendleOracle_PT_USDe_27MAR2025, signature: "setPtToAssetRate(address,uint32,uint256)", - params: [VPT_USDe_27MAR2025_ETHENA, TWAP_DURATION, EXCHANGE_RATE], + params: [ADDRESS_ONE, TWAP_DURATION, EXCHANGE_RATE], dstChainId: LzChainId.sepolia, }, @@ -117,7 +114,7 @@ export const vip407 = () => { { target: MockPendleOracle_PT_sUSDe_27MAR2025, signature: "setPtToAssetRate(address,uint32,uint256)", - params: [MockPT_sUSDE_27MAR2025, TWAP_DURATION, EXCHANGE_RATE], + params: [ADDRESS_ONE, TWAP_DURATION, EXCHANGE_RATE], dstChainId: LzChainId.sepolia, }, @@ -143,7 +140,7 @@ export const vip407 = () => { { target: sepolia.POOL_REGISTRY, signature: "addPool(string,address,uint256,uint256,uint256)", - params: ["Core", COMPTROLLER_ETHENA, parseUnits("0.5", 18), parseUnits("1.04", 18), parseUnits("100", 18)], + params: ["Ethena", COMPTROLLER_ETHENA, parseUnits("0.5", 18), parseUnits("1.04", 18), parseUnits("100", 18)], dstChainId: LzChainId.sepolia, }, { diff --git a/vips/vip-408/bsctestnet.ts b/vips/vip-408/bsctestnet.ts index a5f9308df..c15c1f9c7 100644 --- a/vips/vip-408/bsctestnet.ts +++ b/vips/vip-408/bsctestnet.ts @@ -61,7 +61,7 @@ export const vip408 = () => { { target: sepolia.VTREASURY, signature: "withdrawTreasuryToken(address,uint256,address)", - params: [MocksUSDe, parseUnits("10653", 6), sepolia.NORMAL_TIMELOCK], + params: [MocksUSDe, parseUnits("10653", 18), sepolia.NORMAL_TIMELOCK], dstChainId: LzChainId.sepolia, }, { @@ -73,7 +73,7 @@ export const vip408 = () => { { target: MocksUSDe, signature: "approve(address,uint256)", - params: [sepolia.POOL_REGISTRY, parseUnits("10653", 6)], + params: [sepolia.POOL_REGISTRY, parseUnits("10653", 18)], dstChainId: LzChainId.sepolia, }, { @@ -101,7 +101,7 @@ export const vip408 = () => { { target: sepolia.VTREASURY, signature: "withdrawTreasuryToken(address,uint256,address)", - params: [MockUSDC, parseUnits("10000", 18), sepolia.NORMAL_TIMELOCK], + params: [MockUSDC, parseUnits("10000", 6), sepolia.NORMAL_TIMELOCK], dstChainId: LzChainId.sepolia, }, { @@ -113,7 +113,7 @@ export const vip408 = () => { { target: MockUSDC, signature: "approve(address,uint256)", - params: [sepolia.POOL_REGISTRY, parseUnits("10000", 18)], + params: [sepolia.POOL_REGISTRY, parseUnits("10000", 6)], dstChainId: LzChainId.sepolia, }, { From 8d26d1ca0af577598cd52b2955c9d065202be5f7 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:56:36 +0530 Subject: [PATCH 3/5] refactor: update addresses & shuffle commands --- simulations/vip-407+vip-408/sepolia.ts | 2 +- vips/vip-407/bsctestnet.ts | 21 +++++++-------------- vips/vip-408/bsctestnet.ts | 23 ++++++++++++++++------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/simulations/vip-407+vip-408/sepolia.ts b/simulations/vip-407+vip-408/sepolia.ts index b39a28223..0b7a8251f 100644 --- a/simulations/vip-407+vip-408/sepolia.ts +++ b/simulations/vip-407+vip-408/sepolia.ts @@ -177,7 +177,7 @@ const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { vUSDC_Ethena: "", }; -forking(7291756, async () => { +forking(7296105, async () => { let poolRegistry: Contract; let noOfPools: BigNumber; diff --git a/vips/vip-407/bsctestnet.ts b/vips/vip-407/bsctestnet.ts index 617ad661e..ee695dcf7 100644 --- a/vips/vip-407/bsctestnet.ts +++ b/vips/vip-407/bsctestnet.ts @@ -11,16 +11,16 @@ export const COMPTROLLER_ETHENA = "0x05Cdc6c3dceA796971Db0d9edDbC7C56f2176D1c"; export const MockPT_USDe_27MAR2025 = "0x74671106a04496199994787B6BcB064d08afbCCf"; export const MockPT_sUSDE_27MAR2025 = "0x3EBa2Aa29eC2498c2124523634324d4ce89c8579"; -export const MocksUSDe = "0xD28894b4A8AB53Ce55965AfD330b55C2DbB3E07D"; +export const MocksUSDe = "0xA3A3e5ecEA56940a4Ae32d0927bfd8821DdA848A"; export const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; const MockUSDe = "0x8bAe3E12870a002A0D4b6Eb0F0CBf91b29d9806F"; export const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; export const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; -export const VsUSDe_Ethena = "0xb17abC45289EE8075447853D4E443f1E7e36fF99"; +export const VsUSDe_Ethena = "0x4DD1e84040Fe689aDDfeE1996b225e3b193d6A8D"; export const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; -const ERC4626ORACLE = "0xa79EC375573f213860320cd401F2D90913AC28FF"; +const sUSDE_ERC4626ORACLE = "0xeD4E76bAbA330287Ca2D8d5857da6703bc653621"; const MockPendleOracle_PT_USDe_27MAR2025 = "0x063a57223EE477d7CB959bc7328d3A06494931A9"; const MockPendleOracle_PT_sUSDe_27MAR2025 = "0x981217A0bb898752543D54cE782DAfb7427b9B54"; const PendleOracle_PT_USDe_27MAR2025 = "0xFad31F9f22ED81F4aa998A12B51ED9f2169C7D3E"; @@ -85,7 +85,7 @@ export const vip407 = () => { params: [ [ MocksUSDe, - [ERC4626ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [sUSDE_ERC4626ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], [true, false, false], ], ], @@ -237,16 +237,9 @@ export const vip407 = () => { dstChainId: LzChainId.sepolia, }, { - target: VsUSDe_Ethena, - signature: "setProtocolSeizeShare(uint256)", - params: [parseUnits("0.0010", 18)], - dstChainId: LzChainId.sepolia, - }, - - { - target: VUSDC_Ethena, - signature: "setProtocolSeizeShare(uint256)", - params: [parseUnits("0.0020", 18)], + target: COMPTROLLER_ETHENA, + signature: "setActionsPaused(address[],uint256[],bool)", + params: [[VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA], [3, 3], true], dstChainId: LzChainId.sepolia, }, ], diff --git a/vips/vip-408/bsctestnet.ts b/vips/vip-408/bsctestnet.ts index c15c1f9c7..63689058a 100644 --- a/vips/vip-408/bsctestnet.ts +++ b/vips/vip-408/bsctestnet.ts @@ -9,12 +9,12 @@ const COMPTROLLER_ETHENA = "0x05Cdc6c3dceA796971Db0d9edDbC7C56f2176D1c"; const MockPT_USDe_27MAR2025 = "0x74671106a04496199994787B6BcB064d08afbCCf"; const MockPT_sUSDE_27MAR2025 = "0x3EBa2Aa29eC2498c2124523634324d4ce89c8579"; -const MocksUSDe = "0xD28894b4A8AB53Ce55965AfD330b55C2DbB3E07D"; +const MocksUSDe = "0xA3A3e5ecEA56940a4Ae32d0927bfd8821DdA848A"; const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; -const VsUSDe_Ethena = "0xb17abC45289EE8075447853D4E443f1E7e36fF99"; +const VsUSDe_Ethena = "0x4DD1e84040Fe689aDDfeE1996b225e3b193d6A8D"; const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; export const underlyingAddress = [MockPT_USDe_27MAR2025, MockPT_sUSDE_27MAR2025, MocksUSDe, MockUSDC]; @@ -138,15 +138,24 @@ export const vip408 = () => { ], dstChainId: LzChainId.sepolia, }, + { + target: VsUSDe_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.0010", 18)], + dstChainId: LzChainId.sepolia, + }, + + { + target: VUSDC_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.0020", 18)], + dstChainId: LzChainId.sepolia, + }, { target: COMPTROLLER_ETHENA, signature: "setActionsPaused(address[],uint256[],bool)", - params: [ - [VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA, VsUSDe_Ethena, VUSDC_Ethena], - [3, 3, 3, 8], - true, - ], + params: [[VsUSDe_Ethena, VUSDC_Ethena], [3, 7], true], dstChainId: LzChainId.sepolia, }, From 82d354e67116186bb2d45011f80306a3d4e667b8 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:28:19 +0530 Subject: [PATCH 4/5] refactor: file structure and update addresses --- .../vip-407+vip-408/abi/poolRegistry.json | 724 ------- .../abi/OmnichainProposalSender.json | 0 .../abi/ResilientOracle.json | 0 .../abi/SingleTokenConverter.json | 0 simulations/vip-407/abi/comptroller.json | 954 +++++++++ .../abi/erc20.json | 0 simulations/vip-407/abi/poolRegistry.json | 310 +++ .../abi/vToken.json | 0 .../bsctestnet.ts | 11 - simulations/vip-407/sepolia.ts | 312 +++ .../vip-408/abi/OmnichainProposalSender.json | 314 +++ simulations/vip-408/abi/ResilientOracle.json | 301 +++ .../abi/SingleTokenConverter.json} | 1301 +++++------- simulations/vip-408/abi/comptroller.json | 954 +++++++++ simulations/vip-408/abi/erc20.json | 295 +++ simulations/vip-408/abi/poolRegistry.json | 310 +++ simulations/vip-408/abi/vToken.json | 1872 +++++++++++++++++ simulations/vip-408/bsctestnet.ts | 17 + .../{vip-407+vip-408 => vip-408}/sepolia.ts | 113 +- vips/vip-407/bsctestnet.ts | 16 +- vips/vip-408/bsctestnet.ts | 32 +- 21 files changed, 6220 insertions(+), 1616 deletions(-) delete mode 100644 simulations/vip-407+vip-408/abi/poolRegistry.json rename simulations/{vip-407+vip-408 => vip-407}/abi/OmnichainProposalSender.json (100%) rename simulations/{vip-407+vip-408 => vip-407}/abi/ResilientOracle.json (100%) rename simulations/{vip-407+vip-408 => vip-407}/abi/SingleTokenConverter.json (100%) create mode 100644 simulations/vip-407/abi/comptroller.json rename simulations/{vip-407+vip-408 => vip-407}/abi/erc20.json (100%) create mode 100644 simulations/vip-407/abi/poolRegistry.json rename simulations/{vip-407+vip-408 => vip-407}/abi/vToken.json (100%) rename simulations/{vip-407+vip-408 => vip-407}/bsctestnet.ts (63%) create mode 100644 simulations/vip-407/sepolia.ts create mode 100644 simulations/vip-408/abi/OmnichainProposalSender.json create mode 100644 simulations/vip-408/abi/ResilientOracle.json rename simulations/{vip-407+vip-408/abi/comptroller.json => vip-408/abi/SingleTokenConverter.json} (58%) create mode 100644 simulations/vip-408/abi/comptroller.json create mode 100644 simulations/vip-408/abi/erc20.json create mode 100644 simulations/vip-408/abi/poolRegistry.json create mode 100644 simulations/vip-408/abi/vToken.json create mode 100644 simulations/vip-408/bsctestnet.ts rename simulations/{vip-407+vip-408 => vip-408}/sepolia.ts (77%) diff --git a/simulations/vip-407+vip-408/abi/poolRegistry.json b/simulations/vip-407+vip-408/abi/poolRegistry.json deleted file mode 100644 index 2d0268aeb..000000000 --- a/simulations/vip-407+vip-408/abi/poolRegistry.json +++ /dev/null @@ -1,724 +0,0 @@ -[ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "vTokenAddress", - "type": "address" - } - ], - "name": "MarketAdded", - "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": "comptroller", - "type": "address" - }, - { - "components": [ - { - "internalType": "enum PoolRegistryInterface.RiskRating", - "name": "riskRating", - "type": "uint8" - }, - { - "internalType": "string", - "name": "category", - "type": "string" - }, - { - "internalType": "string", - "name": "logoURL", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "indexed": false, - "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", - "name": "oldMetadata", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "enum PoolRegistryInterface.RiskRating", - "name": "riskRating", - "type": "uint8" - }, - { - "internalType": "string", - "name": "category", - "type": "string" - }, - { - "internalType": "string", - "name": "logoURL", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "indexed": false, - "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", - "name": "newMetadata", - "type": "tuple" - } - ], - "name": "PoolMetadataUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "oldName", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "newName", - "type": "string" - } - ], - "name": "PoolNameSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "components": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "uint256", - "name": "blockPosted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timestampPosted", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct PoolRegistryInterface.VenusPool", - "name": "pool", - "type": "tuple" - } - ], - "name": "PoolRegistered", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "address", - "name": "asset", - "type": "address" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "enum PoolRegistry.InterestRateModels", - "name": "rateModel", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "baseRatePerYear", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "multiplierPerYear", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "jumpMultiplierPerYear", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "kink_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationThreshold", - "type": "uint256" - }, - { - "internalType": "contract AccessControlManager", - "name": "accessControlManager", - "type": "address" - }, - { - "internalType": "address", - "name": "vTokenProxyAdmin", - "type": "address" - }, - { - "internalType": "address", - "name": "beaconAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supplyCap", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowCap", - "type": "uint256" - } - ], - "internalType": "struct PoolRegistry.AddMarketInput", - "name": "input", - "type": "tuple" - } - ], - "name": "addMarket", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "beaconAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "closeFactor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "liquidationIncentive", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLiquidatableCollateral", - "type": "uint256" - }, - { - "internalType": "address", - "name": "priceOracle", - "type": "address" - } - ], - "name": "createRegistryPool", - "outputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "address", - "name": "proxyAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAllPools", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "uint256", - "name": "blockPosted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timestampPosted", - "type": "uint256" - } - ], - "internalType": "struct PoolRegistryInterface.VenusPool[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - } - ], - "name": "getPoolByComptroller", - "outputs": [ - { - "components": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "uint256", - "name": "blockPosted", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timestampPosted", - "type": "uint256" - } - ], - "internalType": "struct PoolRegistryInterface.VenusPool", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], - "name": "getPoolsSupportedByAsset", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "address", - "name": "asset", - "type": "address" - } - ], - "name": "getVTokenForAsset", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - } - ], - "name": "getVenusPoolMetadata", - "outputs": [ - { - "components": [ - { - "internalType": "enum PoolRegistryInterface.RiskRating", - "name": "riskRating", - "type": "uint8" - }, - { - "internalType": "string", - "name": "category", - "type": "string" - }, - { - "internalType": "string", - "name": "logoURL", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract VTokenProxyFactory", - "name": "_vTokenFactory", - "type": "address" - }, - { - "internalType": "contract JumpRateModelFactory", - "name": "_jumpRateFactory", - "type": "address" - }, - { - "internalType": "contract WhitePaperInterestRateModelFactory", - "name": "_whitePaperFactory", - "type": "address" - }, - { - "internalType": "contract Shortfall", - "name": "_shortfall", - "type": "address" - }, - { - "internalType": "address payable", - "name": "riskFund_", - "type": "address" - }, - { - "internalType": "address payable", - "name": "protocolShareReserve_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "metadata", - "outputs": [ - { - "internalType": "enum PoolRegistryInterface.RiskRating", - "name": "riskRating", - "type": "uint8" - }, - { - "internalType": "string", - "name": "category", - "type": "string" - }, - { - "internalType": "string", - "name": "logoURL", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "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": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "setPoolName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "components": [ - { - "internalType": "enum PoolRegistryInterface.RiskRating", - "name": "riskRating", - "type": "uint8" - }, - { - "internalType": "string", - "name": "category", - "type": "string" - }, - { - "internalType": "string", - "name": "logoURL", - "type": "string" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", - "name": "_metadata", - "type": "tuple" - } - ], - "name": "updatePoolMetadata", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/simulations/vip-407+vip-408/abi/OmnichainProposalSender.json b/simulations/vip-407/abi/OmnichainProposalSender.json similarity index 100% rename from simulations/vip-407+vip-408/abi/OmnichainProposalSender.json rename to simulations/vip-407/abi/OmnichainProposalSender.json diff --git a/simulations/vip-407+vip-408/abi/ResilientOracle.json b/simulations/vip-407/abi/ResilientOracle.json similarity index 100% rename from simulations/vip-407+vip-408/abi/ResilientOracle.json rename to simulations/vip-407/abi/ResilientOracle.json diff --git a/simulations/vip-407+vip-408/abi/SingleTokenConverter.json b/simulations/vip-407/abi/SingleTokenConverter.json similarity index 100% rename from simulations/vip-407+vip-408/abi/SingleTokenConverter.json rename to simulations/vip-407/abi/SingleTokenConverter.json diff --git a/simulations/vip-407/abi/comptroller.json b/simulations/vip-407/abi/comptroller.json new file mode 100644 index 000000000..6a3775d20 --- /dev/null +++ b/simulations/vip-407/abi/comptroller.json @@ -0,0 +1,954 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "poolRegistry_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "ActionPaused", + "type": "error" + }, + { "inputs": [], "name": "BorrowActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "BorrowCapIsNotZero", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedLessThanOrEqualTo", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { "inputs": [], "name": "CollateralFactorIsNotZero", "type": "error" }, + { "inputs": [], "name": "ComptrollerMismatch", "type": "error" }, + { "inputs": [], "name": "DelegationStatusUnchanged", "type": "error" }, + { "inputs": [], "name": "EnterMarketActionNotPaused", "type": "error" }, + { "inputs": [], "name": "ExitMarketActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "collateralToSeize", "type": "uint256" }, + { "internalType": "uint256", "name": "availableCollateral", "type": "uint256" } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { "inputs": [], "name": "InsufficientLiquidity", "type": "error" }, + { "inputs": [], "name": "InsufficientShortfall", "type": "error" }, + { "inputs": [], "name": "InvalidCollateralFactor", "type": "error" }, + { "inputs": [], "name": "InvalidLiquidationThreshold", "type": "error" }, + { "inputs": [], "name": "LiquidateActionNotPaused", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "MarketNotCollateral", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopsLimit", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredLoops", "type": "uint256" } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedGreaterThan", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { "inputs": [], "name": "MintActionNotPaused", "type": "error" }, + { "inputs": [], "name": "NonzeroBorrowBalance", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "PriceError", + "type": "error" + }, + { "inputs": [], "name": "RedeemActionNotPaused", "type": "error" }, + { "inputs": [], "name": "RepayActionNotPaused", "type": "error" }, + { "inputs": [], "name": "SeizeActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "SupplyCapIsNotZero", "type": "error" }, + { "inputs": [], "name": "TooMuchRepay", "type": "error" }, + { "inputs": [], "name": "TransferActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "expectedSender", "type": "address" }, + { "internalType": "address", "name": "actualSender", "type": "address" } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "enum Action", "name": "action", "type": "uint8" }, + { "indexed": false, "internalType": "bool", "name": "pauseState", "type": "bool" } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "approver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLoopsLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newmaxLoopsLimit", "type": "uint256" } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldCloseFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldCollateralFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationIncentiveMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationThresholdMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableCollateral", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IPrime", "name": "oldPrimeToken", "type": "address" }, + { "indexed": false, "internalType": "contract IPrime", "name": "newPrimeToken", "type": "address" } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "accountAssets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "actionPaused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract RewardsDistributor", "name": "_rewardsDistributor", "type": "address" }], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "allMarkets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "approvedDelegates", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "borrowCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "contract VToken", "name": "vToken", "type": "address" } + ], + "name": "checkMembership", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "vTokens", "type": "address[]" }], + "name": "enterMarkets", + "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vTokenAddress", "type": "address" }], + "name": "exitMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAssetsIn", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getBorrowingPower", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "vTokenModify", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [{ "internalType": "contract RewardsDistributor[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "supplySpeed", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowSpeed", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopLimit", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isForcedLiquidationEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "isMarketListed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { + "components": [ + { "internalType": "contract VToken", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "contract VToken", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "tokensToSeize", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "markets", + "outputs": [ + { "internalType": "bool", "name": "isListed", "type": "bool" }, + { "internalType": "uint256", "name": "collateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThresholdMantissa", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "actualMintAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "seizerContract", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [{ "internalType": "contract IPrime", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowerIndex", "type": "uint256" } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "marketsList", "type": "address[]" }, + { "internalType": "enum Action[]", "name": "actionsList", "type": "uint256[]" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" }], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" }], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newBorrowCaps", "type": "uint256[]" } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newSupplyCaps", "type": "uint256[]" } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" }], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ResilientOracleInterface", "name": "newOracle", "type": "address" }], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IPrime", "name": "_prime", "type": "address" }], + "name": "setPrimeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "supplyCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "unlistMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "updatePrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/erc20.json b/simulations/vip-407/abi/erc20.json similarity index 100% rename from simulations/vip-407+vip-408/abi/erc20.json rename to simulations/vip-407/abi/erc20.json diff --git a/simulations/vip-407/abi/poolRegistry.json b/simulations/vip-407/abi/poolRegistry.json new file mode 100644 index 000000000..8f15277d2 --- /dev/null +++ b/simulations/vip-407/abi/poolRegistry.json @@ -0,0 +1,310 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "vTokenAddress", "type": "address" } + ], + "name": "MarketAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "oldMetadata", + "type": "tuple" + }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "newMetadata", + "type": "tuple" + } + ], + "name": "PoolMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "oldName", "type": "string" }, + { "indexed": false, "internalType": "string", "name": "newName", "type": "string" } + ], + "name": "PoolNameSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "pool", + "type": "tuple" + } + ], + "name": "PoolRegistered", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThreshold", "type": "uint256" }, + { "internalType": "uint256", "name": "initialSupply", "type": "uint256" }, + { "internalType": "address", "name": "vTokenReceiver", "type": "address" }, + { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowCap", "type": "uint256" } + ], + "internalType": "struct PoolRegistry.AddMarketInput", + "name": "input", + "type": "tuple" + } + ], + "name": "addMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "contract Comptroller", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "closeFactor", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationIncentive", "type": "uint256" }, + { "internalType": "uint256", "name": "minLiquidatableCollateral", "type": "uint256" } + ], + "name": "addPool", + "outputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllPools", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "internalType": "struct PoolRegistryInterface.VenusPool[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "comptroller", "type": "address" }], + "name": "getPoolByComptroller", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPoolsSupportedByAsset", + "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getVTokenForAsset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "comptroller", "type": "address" }], + "name": "getVenusPoolMetadata", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "metadata", + "outputs": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "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": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "string", "name": "name", "type": "string" } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "metadata_", + "type": "tuple" + } + ], + "name": "updatePoolMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/vToken.json b/simulations/vip-407/abi/vToken.json similarity index 100% rename from simulations/vip-407+vip-408/abi/vToken.json rename to simulations/vip-407/abi/vToken.json diff --git a/simulations/vip-407+vip-408/bsctestnet.ts b/simulations/vip-407/bsctestnet.ts similarity index 63% rename from simulations/vip-407+vip-408/bsctestnet.ts rename to simulations/vip-407/bsctestnet.ts index 31c39c970..a4f971e77 100644 --- a/simulations/vip-407+vip-408/bsctestnet.ts +++ b/simulations/vip-407/bsctestnet.ts @@ -1,7 +1,6 @@ import { expectEvents } from "../../src/utils"; import { forking, testVip } from "../../src/vip-framework"; import vip407 from "../../vips/vip-407/bsctestnet"; -import vip408 from "../../vips/vip-407/bsctestnet"; import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; forking(46452753, async () => { @@ -15,14 +14,4 @@ forking(46452753, async () => { ); }, }); - testVip("Ethena", await vip408(), { - callbackAfterExecution: async txResponse => { - await expectEvents( - txResponse, - [OMNICHAIN_PROPOSAL_SENDER_ABI], - ["ExecuteRemoteProposal", "StorePayload"], - [1, 0], - ); - }, - }); }); diff --git a/simulations/vip-407/sepolia.ts b/simulations/vip-407/sepolia.ts new file mode 100644 index 000000000..f2c9bbfbd --- /dev/null +++ b/simulations/vip-407/sepolia.ts @@ -0,0 +1,312 @@ +import { expect } from "chai"; +import { BigNumber, BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { + COMPTROLLER_ETHENA, + MockPT_USDe_27MAR2025, + MockPT_sUSDE_27MAR2025, + VPT_USDe_27MAR2025_ETHENA, + VPT_sUSDE_27MAR2025_ETHENA, + vip407, +} from "../../vips/vip-407/bsctestnet"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const { sepolia } = NETWORK_ADDRESSES; + +const BLOCKS_PER_YEAR = BigNumber.from("2628000"); // assuming a block is mined every 14 seconds + +type VTokenSymbol = "vPT-USDe-27MAR2025_Ethena" | "vPT-sUSDE-27MAR2025_Ethena"; + +const vTokens: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": VPT_USDe_27MAR2025_ETHENA, + "vPT-sUSDE-27MAR2025_Ethena": VPT_sUSDE_27MAR2025_ETHENA, +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: number; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + "vPT-USDe-27MAR2025_Ethena": { + name: "Venus PT-USDe-27MAR2025(Ethena)", + symbol: "vPT-USDe-27MAR2025_Ethena", + decimals: 8, + underlying: MockPT_USDe_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + "vPT-sUSDE-27MAR2025_Ethena": { + name: "Venus PT-sUSDE-27MAR2025 (Ethena)", + symbol: "vPT-sUSDE-27MAR2025_Ethena", + decimals: 8, + underlying: MockPT_sUSDE_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; + protocolSeizeShareMantissa: string; + price: BigNumber; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + "vPT-USDe-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "850000", + collateralFactor: "0.86", + liquidationThreshold: "0.88", + reserveFactor: "0", + initialSupply: "10619", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, + "vPT-sUSDE-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "12000000", + collateralFactor: "0.85", + liquidationThreshold: "0.87", + reserveFactor: "0", + initialSupply: "10653", + vTokenReceiver: sepolia.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: ["vPT-USDe-27MAR2025_Ethena", "vPT-sUSDE-27MAR2025_Ethena"], + kink: "0.8", + base: "0", + multiplier: "0.08", + jump: "0.8", + }, +]; + +const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": "", + "vPT-sUSDE-27MAR2025_Ethena": "", +}; + +forking(7302561, async () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, sepolia.POOL_REGISTRY); + }); + + describe("Contracts setup", async () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testForkedNetworkVipCommands("Ethena pool", await vip407()); + + describe("Post-Execution state", () => { + before(async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + interestRateModelAddresses[symbol] = await vToken.interestRateModel(); + } + } + }); + describe("PoolRegistry state", () => { + let registeredPools: { name: string; creator: string; comptroller: string }[]; + before(async () => { + registeredPools = await poolRegistry.getAllPools(); + }); + it("should have 5 pools", async () => { + expect(registeredPools).to.have.lengthOf(5); + }); + it("should register Ethena pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Ethena"); + expect(pool.creator).to.equal(sepolia.NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(COMPTROLLER_ETHENA); + }); + it("should register Ethena pool vTokens in Ethena pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_ETHENA); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(2); + expect(poolVTokens).to.include(vTokens["vPT-USDe-27MAR2025_Ethena"]); + expect(poolVTokens).to.include(vTokens["vPT-sUSDE-27MAR2025_Ethena"]); + }); + + for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { + it(`should register ${symbol} in PoolRegistry`, async () => { + const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); + expect(registeredVToken).to.equal(vTokens[symbol]); + }); + } + }); + + describe("Ownership", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(sepolia.GUARDIAN); + }); + } + }); + + describe("Initial supply", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + it(`should mint initial supply of ${symbol} to ${params.vTokenReceiver}`, async () => { + // Since we're distributing 1:1, decimals should be accounted for in the exchange rate + const expectedSupply = parseUnits(params.initialSupply, 8); + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + expect(await vToken.balanceOf(params.vTokenReceiver)).to.equal(expectedSupply); + }); + } + }); + + describe("Risk parameters", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + describe(`${symbol} risk parameters`, () => { + let vToken: Contract; + let comptroller: Contract; + let underlyingDecimals: number; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, vTokenState[symbol].comptroller); + const underlyingAddress = vTokenState[symbol].underlying; + const underlying = await ethers.getContractAt(ERC20_ABI, underlyingAddress); + underlyingDecimals = await underlying.decimals(); + }); + + it(`should set ${symbol} reserve factor to ${params.reserveFactor}`, async () => { + expect(await vToken.reserveFactorMantissa()).to.equal(parseUnits(params.reserveFactor, 18)); + }); + + it(`should set ${symbol} collateral factor to ${params.collateralFactor}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.collateralFactorMantissa).to.equal(parseUnits(params.collateralFactor, 18)); + }); + + it(`should set ${symbol} liquidation threshold to ${params.liquidationThreshold}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.liquidationThresholdMantissa).to.equal(parseUnits(params.liquidationThreshold, 18)); + }); + + it(`should set ${symbol} protocol seize share ${params.protocolSeizeShareMantissa}`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal( + parseUnits(params.protocolSeizeShareMantissa, 18), + ); + }); + + it(`should set ${symbol} supply cap to ${params.supplyCap}`, async () => { + expect(await comptroller.supplyCaps(vTokens[symbol])).to.equal( + parseUnits(params.supplyCap, underlyingDecimals), + ); + }); + + it(`should set ${symbol} borrow cap to ${params.borrowCap}`, async () => { + expect(await comptroller.borrowCaps(vTokens[symbol])).to.equal( + parseUnits(params.borrowCap, underlyingDecimals), + ); + }); + }); + } + }); + + describe("Pools configuration", () => { + const checkComptroller = (comptrollerAddress: string, comptrollerName: string) => { + describe(`${comptrollerName} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, comptrollerAddress); + }); + + it("should use the correct comptroller address", async () => { + expect(comptroller.address).to.equal(comptrollerAddress); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(sepolia.RESILIENT_ORACLE); + }); + + it("should have close factor = 0.5", async () => { + expect(await comptroller.closeFactorMantissa()).to.equal(parseUnits("0.5", 18)); + }); + + it("should have liquidation incentive = 1.04", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.04", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = NORMAL TIMELOCK", async () => { + expect(await comptroller.owner()).to.equal(sepolia.NORMAL_TIMELOCK); + }); + }); + }; + + checkComptroller(COMPTROLLER_ETHENA, "Ethena"); + }); + + it("Interest rates", async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate( + interestRateModelAddresses[symbol], + symbol, + { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }, + BLOCKS_PER_YEAR, + ); + } + } + }); + it("Check Price", async () => { + const resilientOracle = new ethers.Contract(sepolia.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).equals(params.price); + expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).equals(params.price); + } + }); + }); +}); diff --git a/simulations/vip-408/abi/OmnichainProposalSender.json b/simulations/vip-408/abi/OmnichainProposalSender.json new file mode 100644 index 000000000..66fd4df02 --- /dev/null +++ b/simulations/vip-408/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-408/abi/ResilientOracle.json b/simulations/vip-408/abi/ResilientOracle.json new file mode 100644 index 000000000..e2f944a9d --- /dev/null +++ b/simulations/vip-408/abi/ResilientOracle.json @@ -0,0 +1,301 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "nativeMarketAddress", "type": "address" }, + { "internalType": "address", "name": "vaiAddress", "type": "address" }, + { "internalType": "contract BoundValidatorInterface", "name": "_boundValidator", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" }, + { "indexed": true, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "OracleEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "oracle", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" } + ], + "name": "OracleSet", + "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": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "mainOracle", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "pivotOracle", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "INVALID_PRICE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "boundValidator", + "outputs": [{ "internalType": "contract BoundValidatorInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "enableOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "getOracle", + "outputs": [ + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getTokenConfig", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getUnderlyingPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nativeMarket", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "setOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" } + ], + "internalType": "struct ResilientOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "updateAssetPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "updatePrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vai", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-407+vip-408/abi/comptroller.json b/simulations/vip-408/abi/SingleTokenConverter.json similarity index 58% rename from simulations/vip-407+vip-408/abi/comptroller.json rename to simulations/vip-408/abi/SingleTokenConverter.json index fafe7b35e..1c8e0f8ec 100644 --- a/simulations/vip-407+vip-408/abi/comptroller.json +++ b/simulations/vip-408/abi/SingleTokenConverter.json @@ -1,198 +1,130 @@ [ - { - "inputs": [ - { - "internalType": "address", - "name": "poolRegistry_", - "type": "address" - }, - { - "internalType": "address", - "name": "accessControl_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "enum ComptrollerStorage.Action", - "name": "action", - "type": "uint8" - } - ], - "name": "ActionPaused", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cap", - "type": "uint256" - } - ], - "name": "BorrowCapExceeded", - "type": "error" - }, { "inputs": [ { "internalType": "uint256", - "name": "expectedLessThanOrEqualTo", + "name": "amountInMantissa", "type": "uint256" }, { "internalType": "uint256", - "name": "actual", + "name": "amountInMaxMantissa", "type": "uint256" } ], - "name": "CollateralExceedsThreshold", + "name": "AmountInHigherThanMax", "type": "error" }, { "inputs": [], - "name": "ComptrollerMismatch", + "name": "AmountInMismatched", "type": "error" }, { "inputs": [ { "internalType": "uint256", - "name": "collateralToSeize", + "name": "amountOutMantissa", "type": "uint256" }, { "internalType": "uint256", - "name": "availableCollateral", + "name": "amountOutMinMantissa", "type": "uint256" } ], - "name": "InsufficientCollateral", + "name": "AmountOutLowerThanMinRequired", "type": "error" }, { "inputs": [], - "name": "InsufficientLiquidity", + "name": "AmountOutMismatched", "type": "error" }, { "inputs": [], - "name": "InsufficientShortfall", + "name": "ConversionConfigNotEnabled", "type": "error" }, { "inputs": [], - "name": "InvalidCollateralFactor", + "name": "ConversionEnabledOnlyForPrivateConversions", "type": "error" }, { "inputs": [], - "name": "InvalidLiquidationThreshold", + "name": "ConversionTokensActive", "type": "error" }, { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketAlreadyListed", + "inputs": [], + "name": "ConversionTokensPaused", "type": "error" }, { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketNotListed", + "inputs": [], + "name": "DeflationaryTokenNotSupported", "type": "error" }, { "inputs": [ { "internalType": "uint256", - "name": "expectedGreaterThan", + "name": "incentive", "type": "uint256" }, { "internalType": "uint256", - "name": "actual", + "name": "maxIncentive", "type": "uint256" } ], - "name": "MinimalCollateralViolated", + "name": "IncentiveTooHigh", "type": "error" }, { "inputs": [], - "name": "NonzeroBorrowBalance", + "name": "InputLengthMisMatch", "type": "error" }, { - "inputs": [ - { - "internalType": "address", - "name": "vToken", - "type": "address" - } - ], - "name": "PriceError", + "inputs": [], + "name": "InsufficientInputAmount", "type": "error" }, { - "inputs": [ - { - "internalType": "address", - "name": "vToken", - "type": "address" - }, - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "SnapshotError", + "inputs": [], + "name": "InsufficientOutputAmount", "type": "error" }, { - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "uint256", - "name": "cap", - "type": "uint256" - } - ], - "name": "SupplyCapExceeded", + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", "type": "error" }, { "inputs": [], - "name": "TooMuchRepay", + "name": "NonZeroIncentiveForPrivateConversion", "type": "error" }, { @@ -217,253 +149,273 @@ "type": "error" }, { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "expectedSender", + "name": "tokenAddressIn", "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "actualSender", + "name": "tokenAddressOut", "type": "address" - } - ], - "name": "UnexpectedSender", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ + }, { "indexed": false, - "internalType": "contract VToken", - "name": "vToken", - "type": "address" + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" }, { "indexed": false, - "internalType": "enum ComptrollerStorage.Action", - "name": "action", + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", "type": "uint8" }, { "indexed": false, - "internalType": "bool", - "name": "pauseState", - "type": "bool" + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" } ], - "name": "ActionPausedMarket", + "name": "ConversionConfigUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" } ], - "name": "Initialized", + "name": "ConversionPaused", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "contract VToken", - "name": "vToken", - "type": "address" - }, - { - "indexed": false, + "indexed": true, "internalType": "address", - "name": "account", + "name": "sender", "type": "address" } ], - "name": "MarketEntered", + "name": "ConversionResumed", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "contract VToken", - "name": "vToken", + "indexed": true, + "internalType": "address", + "name": "sender", "type": "address" }, { - "indexed": false, + "indexed": true, "internalType": "address", - "name": "account", + "name": "receiver", "type": "address" - } - ], - "name": "MarketExited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { "indexed": false, - "internalType": "contract VToken", - "name": "vToken", + "internalType": "address", + "name": "tokenAddressIn", "type": "address" - } - ], - "name": "MarketSupported", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { "indexed": true, - "internalType": "contract VToken", - "name": "vToken", + "internalType": "address", + "name": "tokenAddressOut", "type": "address" }, { "indexed": false, "internalType": "uint256", - "name": "newBorrowCap", - "type": "uint256" - } - ], - "name": "NewBorrowCap", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldCloseFactorMantissa", + "name": "amountIn", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newCloseFactorMantissa", + "name": "amountOut", "type": "uint256" } ], - "name": "NewCloseFactor", + "name": "ConvertedExactTokens", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "contract VToken", - "name": "vToken", + "indexed": true, + "internalType": "address", + "name": "sender", "type": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "oldCollateralFactorMantissa", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" }, { "indexed": false, - "internalType": "uint256", - "name": "newCollateralFactorMantissa", - "type": "uint256" - } - ], - "name": "NewCollateralFactor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, { "indexed": false, "internalType": "uint256", - "name": "oldLiquidationIncentiveMantissa", + "name": "amountIn", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newLiquidationIncentiveMantissa", + "name": "amountOut", "type": "uint256" } ], - "name": "NewLiquidationIncentive", + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", "type": "event" }, { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, { "indexed": false, - "internalType": "contract VToken", - "name": "vToken", + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", "type": "address" }, { "indexed": false, "internalType": "uint256", - "name": "oldLiquidationThresholdMantissa", + "name": "amountIn", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newLiquidationThresholdMantissa", + "name": "amountOut", "type": "uint256" } ], - "name": "NewLiquidationThreshold", + "name": "ConvertedForExactTokens", "type": "event" }, { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, { "indexed": false, "internalType": "uint256", - "name": "oldMinLiquidatableCollateral", + "name": "amountIn", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newMinLiquidatableCollateral", + "name": "amountOut", "type": "uint256" } ], - "name": "NewMinLiquidatableCollateral", + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "contract PriceOracle", - "name": "oldPriceOracle", + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", "type": "address" }, { - "indexed": false, - "internalType": "contract PriceOracle", - "name": "newPriceOracle", + "indexed": true, + "internalType": "address", + "name": "converterNetwork", "type": "address" } ], - "name": "NewPriceOracle", + "name": "ConverterNetworkAddressUpdated", "type": "event" }, { @@ -472,49 +424,68 @@ { "indexed": true, "internalType": "address", - "name": "rewardsDistributor", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", "type": "address" } ], - "name": "NewRewardsDistributor", + "name": "DestinationAddressUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, - "internalType": "contract VToken", - "name": "vToken", - "type": "address" + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "newSupplyCap", + "name": "newMinAmountToConvert", "type": "uint256" } ], - "name": "NewSupplyCap", + "name": "MinAmountToConvertUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "previousOwner", + "name": "oldAccessControlManager", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "newOwner", + "name": "newAccessControlManager", "type": "address" } ], - "name": "OwnershipTransferStarted", + "name": "NewAccessControlManager", "type": "event" }, { @@ -533,102 +504,98 @@ "type": "address" } ], - "name": "OwnershipTransferred", + "name": "OwnershipTransferStarted", "type": "event" }, { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "accessControl", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferred", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "", + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", "type": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "accountAssets", - "outputs": [ - { - "internalType": "contract VToken", - "name": "", + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "PriceOracleUpdated", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "market", + "name": "token", "type": "address" }, { - "internalType": "enum ComptrollerStorage.Action", - "name": "action", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "name": "actionPaused", + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "contract RewardsDistributor", - "name": "_rewardsDistributor", - "type": "address" - } - ], - "name": "addRewardsDistributor", + "inputs": [], + "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "allMarkets", + "inputs": [], + "name": "accessControlManager", "outputs": [ { - "internalType": "contract VToken", + "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" } @@ -640,15 +607,15 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "token", "type": "address" } ], - "name": "borrowCaps", + "name": "balanceOf", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "tokenBalance", "type": "uint256" } ], @@ -659,458 +626,226 @@ "inputs": [ { "internalType": "address", - "name": "account", + "name": "", "type": "address" }, { - "internalType": "contract VToken", - "name": "vToken", - "type": "address" - } - ], - "name": "checkMembership", - "outputs": [ - { - "internalType": "bool", + "internalType": "address", "name": "", - "type": "bool" + "type": "address" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "closeFactorMantissa", + "name": "conversionConfigurations", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "incentive", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "vTokens", - "type": "address[]" - } - ], - "name": "enterMarkets", - "outputs": [ + }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "vTokenAddress", - "type": "address" - } - ], - "name": "exitMarket", + "inputs": [], + "name": "conversionPaused", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountLiquidity", - "outputs": [ { "internalType": "uint256", - "name": "error", + "name": "amountInMantissa", "type": "uint256" }, { "internalType": "uint256", - "name": "liquidity", + "name": "amountOutMinMantissa", "type": "uint256" }, - { - "internalType": "uint256", - "name": "shortfall", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAllMarkets", - "outputs": [ - { - "internalType": "contract VToken[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", - "name": "account", + "name": "tokenAddressIn", "type": "address" - } - ], - "name": "getAssetsIn", - "outputs": [ - { - "internalType": "contract VToken[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + }, { "internalType": "address", - "name": "account", + "name": "tokenAddressOut", "type": "address" }, { "internalType": "address", - "name": "vTokenModify", + "name": "to", "type": "address" - }, - { - "internalType": "uint256", - "name": "redeemTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" } ], - "name": "getHypotheticalAccountLiquidity", + "name": "convertExactTokens", "outputs": [ { "internalType": "uint256", - "name": "error", + "name": "actualAmountIn", "type": "uint256" }, { "internalType": "uint256", - "name": "liquidity", + "name": "actualAmountOut", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shortfall", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRewardDistributors", - "outputs": [ - { - "internalType": "contract RewardsDistributor[]", - "name": "", - "type": "address[]" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "vToken", - "type": "address" - } - ], - "name": "getRewardsByMarket", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "rewardToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "supplySpeed", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "borrowSpeed", - "type": "uint256" - } - ], - "internalType": "struct ComptrollerStorage.RewardSpeeds[]", - "name": "rewardSpeeds", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "healAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "isComptroller", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "pure", - "type": "function" - }, { "inputs": [ { - "internalType": "contract VToken", - "name": "vToken", - "type": "address" - } - ], - "name": "isDeprecated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract VToken", - "name": "vToken", - "type": "address" - } - ], - "name": "isMarketListed", - "outputs": [ + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "borrower", + "name": "tokenAddressIn", "type": "address" }, - { - "components": [ - { - "internalType": "contract VToken", - "name": "vTokenCollateral", - "type": "address" - }, - { - "internalType": "contract VToken", - "name": "vTokenBorrowed", - "type": "address" - }, - { - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - } - ], - "internalType": "struct ComptrollerStorage.LiquidationOrder[]", - "name": "orders", - "type": "tuple[]" - } - ], - "name": "liquidateAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", - "name": "vTokenBorrowed", + "name": "tokenAddressOut", "type": "address" }, { "internalType": "address", - "name": "vTokenCollateral", + "name": "to", "type": "address" - }, - { - "internalType": "uint256", - "name": "actualRepayAmount", - "type": "uint256" } ], - "name": "liquidateCalculateSeizeTokens", + "name": "convertExactTokensSupportingFeeOnTransferTokens", "outputs": [ { "internalType": "uint256", - "name": "error", + "name": "actualAmountIn", "type": "uint256" }, { "internalType": "uint256", - "name": "tokensToSeize", + "name": "actualAmountOut", "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "liquidationIncentiveMantissa", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "amountInMaxMantissa", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", "type": "address" } ], - "name": "markets", + "name": "convertForExactTokens", "outputs": [ - { - "internalType": "bool", - "name": "isListed", - "type": "bool" - }, { "internalType": "uint256", - "name": "collateralFactorMantissa", + "name": "actualAmountIn", "type": "uint256" }, { "internalType": "uint256", - "name": "liquidationThresholdMantissa", + "name": "actualAmountOut", "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "minLiquidatableCollateral", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "amountInMaxMantissa", "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracle", - "outputs": [ + }, { - "internalType": "contract PriceOracle", - "name": "", + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", "type": "address" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", + "name": "convertForExactTokensSupportingFeeOnTransferTokens", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" } ], - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "pendingOwner", + "name": "converterNetwork", "outputs": [ { - "internalType": "address", + "internalType": "contract IConverterNetwork", "name": "", "type": "address" } @@ -1120,7 +855,7 @@ }, { "inputs": [], - "name": "poolRegistry", + "name": "destinationAddress", "outputs": [ { "internalType": "address", @@ -1133,178 +868,197 @@ }, { "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "vToken", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "borrower", + "name": "tokenAddressOut", "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { "internalType": "uint256", - "name": "borrowAmount", + "name": "amountInMantissa", "type": "uint256" } ], - "name": "preBorrowHook", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { - "internalType": "address", - "name": "vTokenBorrowed", - "type": "address" + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" }, { "internalType": "address", - "name": "vTokenCollateral", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "borrower", + "name": "tokenAddressOut", "type": "address" - }, + } + ], + "name": "getAmountOut", + "outputs": [ { "internalType": "uint256", - "name": "repayAmount", + "name": "amountConvertedMantissa", "type": "uint256" }, { - "internalType": "bool", - "name": "skipLiquidityCheck", - "type": "bool" + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" } ], - "name": "preLiquidateHook", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "vToken", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "minter", + "name": "tokenAddressOut", "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { "internalType": "uint256", - "name": "mintAmount", + "name": "amountInMantissa", "type": "uint256" } ], - "name": "preMintHook", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "vToken", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "redeemer", + "name": "tokenAddressOut", "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { "internalType": "uint256", - "name": "redeemTokens", + "name": "amountOutMantissa", "type": "uint256" } ], - "name": "preRedeemHook", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "vToken", - "type": "address" - }, + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ { - "internalType": "address", - "name": "borrower", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "preRepayHook", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "vTokenCollateral", - "type": "address" - }, - { - "internalType": "address", - "name": "seizerContract", - "type": "address" - }, - { - "internalType": "address", - "name": "liquidator", - "type": "address" - }, + "inputs": [], + "name": "owner", + "outputs": [ { "internalType": "address", - "name": "borrower", + "name": "", "type": "address" } ], - "name": "preSeizeHook", + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "vToken", - "type": "address" - }, + "inputs": [], + "name": "pendingOwner", + "outputs": [ { "internalType": "address", - "name": "src", + "name": "", "type": "address" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ { - "internalType": "address", - "name": "dst", + "internalType": "contract ResilientOracle", + "name": "", "type": "address" - }, - { - "internalType": "uint256", - "name": "transferTokens", - "type": "uint256" } ], - "name": "preTransferHook", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -1315,24 +1069,8 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "contract VToken[]", - "name": "marketsList", - "type": "address[]" - }, - { - "internalType": "enum ComptrollerStorage.Action[]", - "name": "actionsList", - "type": "uint8[]" - }, - { - "internalType": "bool", - "name": "paused", - "type": "bool" - } - ], - "name": "setActionsPaused", + "inputs": [], + "name": "resumeConversion", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1340,12 +1078,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "newCloseFactorMantissa", - "type": "uint256" + "internalType": "address", + "name": "accessControlManager_", + "type": "address" } ], - "name": "setCloseFactor", + "name": "setAccessControlManager", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1353,22 +1091,34 @@ { "inputs": [ { - "internalType": "contract VToken", - "name": "vToken", + "internalType": "address", + "name": "tokenAddressIn", "type": "address" }, { - "internalType": "uint256", - "name": "newCollateralFactorMantissa", - "type": "uint256" + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" }, { - "internalType": "uint256", - "name": "newLiquidationThresholdMantissa", - "type": "uint256" + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" } ], - "name": "setCollateralFactor", + "name": "setConversionConfig", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1376,12 +1126,34 @@ { "inputs": [ { - "internalType": "uint256", - "name": "newLiquidationIncentiveMantissa", - "type": "uint256" + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" } ], - "name": "setLiquidationIncentive", + "name": "setConversionConfigs", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1389,17 +1161,12 @@ { "inputs": [ { - "internalType": "contract VToken[]", - "name": "vTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "newBorrowCaps", - "type": "uint256[]" + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" } ], - "name": "setMarketBorrowCaps", + "name": "setConverterNetwork", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1407,17 +1174,12 @@ { "inputs": [ { - "internalType": "contract VToken[]", - "name": "vTokens", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "newSupplyCaps", - "type": "uint256[]" + "internalType": "address", + "name": "destinationAddress_", + "type": "address" } ], - "name": "setMarketSupplyCaps", + "name": "setDestination", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1426,11 +1188,11 @@ "inputs": [ { "internalType": "uint256", - "name": "newMinLiquidatableCollateral", + "name": "minAmountToConvert_", "type": "uint256" } ], - "name": "setMinLiquidatableCollateral", + "name": "setMinAmountToConvert", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1438,8 +1200,8 @@ { "inputs": [ { - "internalType": "contract PriceOracle", - "name": "newOracle", + "internalType": "contract ResilientOracle", + "name": "priceOracle_", "type": "address" } ], @@ -1452,30 +1214,34 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "tokenAddress", "type": "address" - } - ], - "name": "supplyCaps", - "outputs": [ + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "stateMutability": "view", + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "internalType": "contract VToken", - "name": "vToken", + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "name": "supportMarket", + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1484,11 +1250,16 @@ "inputs": [ { "internalType": "address", - "name": "newOwner", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", "type": "address" } ], - "name": "transferOwnership", + "name": "updateAssetsState", "outputs": [], "stateMutability": "nonpayable", "type": "function" diff --git a/simulations/vip-408/abi/comptroller.json b/simulations/vip-408/abi/comptroller.json new file mode 100644 index 000000000..6a3775d20 --- /dev/null +++ b/simulations/vip-408/abi/comptroller.json @@ -0,0 +1,954 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "poolRegistry_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "ActionPaused", + "type": "error" + }, + { "inputs": [], "name": "BorrowActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "BorrowCapIsNotZero", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedLessThanOrEqualTo", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { "inputs": [], "name": "CollateralFactorIsNotZero", "type": "error" }, + { "inputs": [], "name": "ComptrollerMismatch", "type": "error" }, + { "inputs": [], "name": "DelegationStatusUnchanged", "type": "error" }, + { "inputs": [], "name": "EnterMarketActionNotPaused", "type": "error" }, + { "inputs": [], "name": "ExitMarketActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "collateralToSeize", "type": "uint256" }, + { "internalType": "uint256", "name": "availableCollateral", "type": "uint256" } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { "inputs": [], "name": "InsufficientLiquidity", "type": "error" }, + { "inputs": [], "name": "InsufficientShortfall", "type": "error" }, + { "inputs": [], "name": "InvalidCollateralFactor", "type": "error" }, + { "inputs": [], "name": "InvalidLiquidationThreshold", "type": "error" }, + { "inputs": [], "name": "LiquidateActionNotPaused", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "MarketNotCollateral", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopsLimit", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredLoops", "type": "uint256" } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedGreaterThan", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { "inputs": [], "name": "MintActionNotPaused", "type": "error" }, + { "inputs": [], "name": "NonzeroBorrowBalance", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "PriceError", + "type": "error" + }, + { "inputs": [], "name": "RedeemActionNotPaused", "type": "error" }, + { "inputs": [], "name": "RepayActionNotPaused", "type": "error" }, + { "inputs": [], "name": "SeizeActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "SupplyCapIsNotZero", "type": "error" }, + { "inputs": [], "name": "TooMuchRepay", "type": "error" }, + { "inputs": [], "name": "TransferActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "expectedSender", "type": "address" }, + { "internalType": "address", "name": "actualSender", "type": "address" } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "enum Action", "name": "action", "type": "uint8" }, + { "indexed": false, "internalType": "bool", "name": "pauseState", "type": "bool" } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "approver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLoopsLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newmaxLoopsLimit", "type": "uint256" } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldCloseFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldCollateralFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationIncentiveMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationThresholdMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableCollateral", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IPrime", "name": "oldPrimeToken", "type": "address" }, + { "indexed": false, "internalType": "contract IPrime", "name": "newPrimeToken", "type": "address" } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "accountAssets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "actionPaused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract RewardsDistributor", "name": "_rewardsDistributor", "type": "address" }], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "allMarkets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "approvedDelegates", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "borrowCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "contract VToken", "name": "vToken", "type": "address" } + ], + "name": "checkMembership", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "vTokens", "type": "address[]" }], + "name": "enterMarkets", + "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vTokenAddress", "type": "address" }], + "name": "exitMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAssetsIn", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getBorrowingPower", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "vTokenModify", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [{ "internalType": "contract RewardsDistributor[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "supplySpeed", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowSpeed", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopLimit", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isForcedLiquidationEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "isMarketListed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { + "components": [ + { "internalType": "contract VToken", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "contract VToken", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "tokensToSeize", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "markets", + "outputs": [ + { "internalType": "bool", "name": "isListed", "type": "bool" }, + { "internalType": "uint256", "name": "collateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThresholdMantissa", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "actualMintAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "seizerContract", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [{ "internalType": "contract IPrime", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowerIndex", "type": "uint256" } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "marketsList", "type": "address[]" }, + { "internalType": "enum Action[]", "name": "actionsList", "type": "uint256[]" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" }], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" }], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newBorrowCaps", "type": "uint256[]" } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newSupplyCaps", "type": "uint256[]" } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" }], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ResilientOracleInterface", "name": "newOracle", "type": "address" }], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IPrime", "name": "_prime", "type": "address" }], + "name": "setPrimeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "supplyCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "unlistMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "updatePrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-408/abi/erc20.json b/simulations/vip-408/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-408/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-408/abi/poolRegistry.json b/simulations/vip-408/abi/poolRegistry.json new file mode 100644 index 000000000..8f15277d2 --- /dev/null +++ b/simulations/vip-408/abi/poolRegistry.json @@ -0,0 +1,310 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "vTokenAddress", "type": "address" } + ], + "name": "MarketAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "oldMetadata", + "type": "tuple" + }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "newMetadata", + "type": "tuple" + } + ], + "name": "PoolMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "oldName", "type": "string" }, + { "indexed": false, "internalType": "string", "name": "newName", "type": "string" } + ], + "name": "PoolNameSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "pool", + "type": "tuple" + } + ], + "name": "PoolRegistered", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "collateralFactor", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThreshold", "type": "uint256" }, + { "internalType": "uint256", "name": "initialSupply", "type": "uint256" }, + { "internalType": "address", "name": "vTokenReceiver", "type": "address" }, + { "internalType": "uint256", "name": "supplyCap", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowCap", "type": "uint256" } + ], + "internalType": "struct PoolRegistry.AddMarketInput", + "name": "input", + "type": "tuple" + } + ], + "name": "addMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "contract Comptroller", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "closeFactor", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationIncentive", "type": "uint256" }, + { "internalType": "uint256", "name": "minLiquidatableCollateral", "type": "uint256" } + ], + "name": "addPool", + "outputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllPools", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "internalType": "struct PoolRegistryInterface.VenusPool[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "comptroller", "type": "address" }], + "name": "getPoolByComptroller", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "address", "name": "creator", "type": "address" }, + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "uint256", "name": "blockPosted", "type": "uint256" }, + { "internalType": "uint256", "name": "timestampPosted", "type": "uint256" } + ], + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPoolsSupportedByAsset", + "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getVTokenForAsset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "comptroller", "type": "address" }], + "name": "getVenusPoolMetadata", + "outputs": [ + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "metadata", + "outputs": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "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": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { "internalType": "string", "name": "name", "type": "string" } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "comptroller", "type": "address" }, + { + "components": [ + { "internalType": "string", "name": "category", "type": "string" }, + { "internalType": "string", "name": "logoURL", "type": "string" }, + { "internalType": "string", "name": "description", "type": "string" } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "metadata_", + "type": "tuple" + } + ], + "name": "updatePoolMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-408/abi/vToken.json b/simulations/vip-408/abi/vToken.json new file mode 100644 index 000000000..a413ca84d --- /dev/null +++ b/simulations/vip-408/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-408/bsctestnet.ts b/simulations/vip-408/bsctestnet.ts new file mode 100644 index 000000000..a4f971e77 --- /dev/null +++ b/simulations/vip-408/bsctestnet.ts @@ -0,0 +1,17 @@ +import { expectEvents } from "../../src/utils"; +import { forking, testVip } from "../../src/vip-framework"; +import vip407 from "../../vips/vip-407/bsctestnet"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +forking(46452753, async () => { + testVip("Ethena", await vip407(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); +}); diff --git a/simulations/vip-407+vip-408/sepolia.ts b/simulations/vip-408/sepolia.ts similarity index 77% rename from simulations/vip-407+vip-408/sepolia.ts rename to simulations/vip-408/sepolia.ts index 0b7a8251f..fbefe8e21 100644 --- a/simulations/vip-407+vip-408/sepolia.ts +++ b/simulations/vip-408/sepolia.ts @@ -8,19 +8,15 @@ import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import { checkVToken } from "src/vip-framework/checks/checkVToken"; import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; +import { COMPTROLLER_ETHENA, MockUSDC, MocksUSDe, vip407 } from "../../vips/vip-407/bsctestnet"; import { - COMPTROLLER_ETHENA, - MockPT_USDe_27MAR2025, - MockPT_sUSDE_27MAR2025, - MockUSDC, - MocksUSDe, - VPT_USDe_27MAR2025_ETHENA, - VPT_sUSDE_27MAR2025_ETHENA, + CONVERSION_INCENTIVE, VUSDC_Ethena, VsUSDe_Ethena, - vip407, -} from "../../vips/vip-407/bsctestnet"; -import { CONVERSION_INCENTIVE, converterBaseAssets, underlyingAddress, vip408 } from "../../vips/vip-408/bsctestnet"; + converterBaseAssets, + underlyingAddress, + vip408, +} from "../../vips/vip-408/bsctestnet"; import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; import COMPTROLLER_ABI from "./abi/comptroller.json"; @@ -30,14 +26,11 @@ import VTOKEN_ABI from "./abi/vToken.json"; const { sepolia } = NETWORK_ADDRESSES; -const BLOCKS_PER_YEAR = BigNumber.from("2252571"); // assuming a block is mined every 14 seconds -const GUARDIAN = "0xb15f6EfEbC276A3b9805df81b5FB3D50C2A62BDf"; +const BLOCKS_PER_YEAR = BigNumber.from(2628000); -type VTokenSymbol = "vPT-USDe-27MAR2025_Ethena" | "vPT-sUSDE-27MAR2025_Ethena" | "vsUSDe_Ethena" | "vUSDC_Ethena"; +type VTokenSymbol = "vsUSDe_Ethena" | "vUSDC_Ethena"; const vTokens: { [key in VTokenSymbol]: string } = { - "vPT-USDe-27MAR2025_Ethena": VPT_USDe_27MAR2025_ETHENA, - "vPT-sUSDE-27MAR2025_Ethena": VPT_sUSDE_27MAR2025_ETHENA, vsUSDe_Ethena: VsUSDe_Ethena, vUSDC_Ethena: VUSDC_Ethena, }; @@ -52,22 +45,6 @@ interface VTokenState { } const vTokenState: { [key in VTokenSymbol]: VTokenState } = { - "vPT-USDe-27MAR2025_Ethena": { - name: "Venus PT-USDe-27MAR2025(Ethena)", - symbol: "vPT-USDe-27MAR2025_Ethena", - decimals: 8, - underlying: MockPT_USDe_27MAR2025, - exchangeRate: parseUnits("1", 28), - comptroller: COMPTROLLER_ETHENA, - }, - "vPT-sUSDE-27MAR2025_Ethena": { - name: "Venus PT-sUSDE-27MAR2025 (Ethena)", - symbol: "vPT-sUSDE-27MAR2025_Ethena", - decimals: 8, - underlying: MockPT_sUSDE_27MAR2025, - exchangeRate: parseUnits("1", 28), - comptroller: COMPTROLLER_ETHENA, - }, vsUSDe_Ethena: { name: "Venus sUSDe (Ethena)", symbol: "vsUSDe_Ethena", @@ -99,28 +76,6 @@ interface RiskParameters { } const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { - "vPT-USDe-27MAR2025_Ethena": { - borrowCap: "0", - supplyCap: "850000", - collateralFactor: "0.86", - liquidationThreshold: "0.88", - reserveFactor: "0", - initialSupply: "10619", - vTokenReceiver: sepolia.VTREASURY, - protocolSeizeShareMantissa: "0.004", - price: parseUnits("1", 18), - }, - "vPT-sUSDE-27MAR2025_Ethena": { - borrowCap: "0", - supplyCap: "12000000", - collateralFactor: "0.85", - liquidationThreshold: "0.87", - reserveFactor: "0", - initialSupply: "10653", - vTokenReceiver: sepolia.VTREASURY, - protocolSeizeShareMantissa: "0.004", - price: parseUnits("1", 18), - }, vsUSDe_Ethena: { borrowCap: "0", supplyCap: "50000000", @@ -141,7 +96,7 @@ const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { initialSupply: "10000", vTokenReceiver: sepolia.VTREASURY, protocolSeizeShareMantissa: "0.0020", - price: parseUnits("1", 18), + price: BigNumber.from("999987420000000000000000000000"), }, }; @@ -154,13 +109,6 @@ interface InterestRateModelSpec { } const interestRateModels: InterestRateModelSpec[] = [ - { - vTokens: ["vPT-USDe-27MAR2025_Ethena", "vPT-sUSDE-27MAR2025_Ethena", "vsUSDe_Ethena"], - kink: "0.8", - base: "0", - multiplier: "0.07", - jump: "0.8", - }, { vTokens: ["vUSDC_Ethena"], kink: "0.92", @@ -171,15 +119,12 @@ const interestRateModels: InterestRateModelSpec[] = [ ]; const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { - "vPT-USDe-27MAR2025_Ethena": "", - "vPT-sUSDE-27MAR2025_Ethena": "", vsUSDe_Ethena: "", vUSDC_Ethena: "", }; -forking(7296105, async () => { +forking(7302561, async () => { let poolRegistry: Contract; - let noOfPools: BigNumber; before(async () => { poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, sepolia.POOL_REGISTRY); @@ -196,8 +141,6 @@ forking(7296105, async () => { describe("Post-Execution state", () => { before(async () => { - noOfPools = await poolRegistry.getAllPools(); - for (const model of interestRateModels) { for (const symbol of model.vTokens) { const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); @@ -207,33 +150,25 @@ forking(7296105, async () => { }); describe("PoolRegistry state", () => { let registeredPools: { name: string; creator: string; comptroller: string }[]; - before(async () => { - console.log(`PoolRegistry: ${poolRegistry.address}`); registeredPools = await poolRegistry.getAllPools(); }); - - it("should have 4 pools", async () => { - expect(registeredPools).to.have.lengthOf(noOfPools.add(1)); + it("should have 5 pools", async () => { + expect(registeredPools).to.have.lengthOf(5); }); - it("should register Ethena pool in PoolRegistry", async () => { const pool = registeredPools[4]; expect(pool.name).to.equal("Ethena"); - expect(pool.creator).to.equal(GUARDIAN); + expect(pool.creator).to.equal(sepolia.NORMAL_TIMELOCK); expect(pool.comptroller).to.equal(COMPTROLLER_ETHENA); }); - - it("should register Core pool vTokens in Core pool Comptroller", async () => { + it("should register Ethena pool vTokens in Ethena pool Comptroller", async () => { const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_ETHENA); const poolVTokens = await comptroller.getAllMarkets(); expect(poolVTokens).to.have.lengthOf(4); - expect(poolVTokens).to.include(vTokens["vPT-USDe-27MAR2025_Ethena"]); - expect(poolVTokens).to.include(vTokens["vPT-sUSDE-27MAR2025_Ethena"]); expect(poolVTokens).to.include(vTokens.vUSDC_Ethena); expect(poolVTokens).to.include(vTokens.vsUSDe_Ethena); }); - for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { it(`should register ${symbol} in PoolRegistry`, async () => { const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); @@ -246,7 +181,7 @@ forking(7296105, async () => { for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { const vToken = await ethers.getContractAt(VTOKEN_ABI, address); - expect(await vToken.owner()).to.equal(GUARDIAN); + expect(await vToken.owner()).to.equal(sepolia.GUARDIAN); }); } }); @@ -342,7 +277,7 @@ forking(7296105, async () => { }); it("should have owner = GUARDIAN", async () => { - expect(await comptroller.owner()).to.equal(GUARDIAN); + expect(await comptroller.owner()).to.equal(sepolia.NORMAL_TIMELOCK); }); }); }; @@ -371,14 +306,8 @@ forking(7296105, async () => { const resilientOracle = new ethers.Contract(sepolia.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { - expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).to.be.closeTo( - params.price, - parseUnits("1", 18), - ); - expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).to.be.closeTo( - params.price, - parseUnits("1", 18), - ); + expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).equals(params.price); + expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).equals(params.price); } }); @@ -387,8 +316,10 @@ forking(7296105, async () => { const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); for (const asset of underlyingAddress) { it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset ${asset}`, async () => { - const result = await converterContract.conversionConfigurations(baseAsset, asset); - expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + if (baseAsset != asset) { + const result = await converterContract.conversionConfigurations(baseAsset, asset); + expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + } }); } } diff --git a/vips/vip-407/bsctestnet.ts b/vips/vip-407/bsctestnet.ts index ee695dcf7..7cd247a56 100644 --- a/vips/vip-407/bsctestnet.ts +++ b/vips/vip-407/bsctestnet.ts @@ -15,10 +15,8 @@ export const MocksUSDe = "0xA3A3e5ecEA56940a4Ae32d0927bfd8821DdA848A"; export const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; const MockUSDe = "0x8bAe3E12870a002A0D4b6Eb0F0CBf91b29d9806F"; -export const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; -export const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; -export const VsUSDe_Ethena = "0x4DD1e84040Fe689aDDfeE1996b225e3b193d6A8D"; -export const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; +export const VPT_USDe_27MAR2025_ETHENA = "0xf2C00a9C3314f7997721253c49276c8531a30803"; +export const VPT_sUSDE_27MAR2025_ETHENA = "0x6c87587b1813eAf5571318E2139048b04eAaFf97"; const sUSDE_ERC4626ORACLE = "0xeD4E76bAbA330287Ca2D8d5857da6703bc653621"; const MockPendleOracle_PT_USDe_27MAR2025 = "0x063a57223EE477d7CB959bc7328d3A06494931A9"; @@ -186,7 +184,7 @@ export const vip407 = () => { { target: sepolia.VTREASURY, signature: "withdrawTreasuryToken(address,uint256,address)", - params: [MockPT_sUSDE_27MAR2025, parseUnits("10000", 18), sepolia.NORMAL_TIMELOCK], + params: [MockPT_sUSDE_27MAR2025, parseUnits("10653", 18), sepolia.NORMAL_TIMELOCK], dstChainId: LzChainId.sepolia, }, { @@ -198,7 +196,7 @@ export const vip407 = () => { { target: MockPT_sUSDE_27MAR2025, signature: "approve(address,uint256)", - params: [sepolia.POOL_REGISTRY, parseUnits("10000", 18)], + params: [sepolia.POOL_REGISTRY, parseUnits("10653", 18)], dstChainId: LzChainId.sepolia, }, { @@ -215,7 +213,7 @@ export const vip407 = () => { VPT_sUSDE_27MAR2025_ETHENA, parseUnits("0.85", 18), parseUnits("0.87", 18), - parseUnits("10000", 18), + parseUnits("10653", 18), sepolia.VTREASURY, parseUnits("12000000", 18), parseUnits("0", 18), @@ -238,8 +236,8 @@ export const vip407 = () => { }, { target: COMPTROLLER_ETHENA, - signature: "setActionsPaused(address[],uint256[],bool)", - params: [[VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA], [3, 3], true], + signature: "setActionsPaused(address[],uint8[],bool)", + params: [[VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA], [2, 2], true], dstChainId: LzChainId.sepolia, }, ], diff --git a/vips/vip-408/bsctestnet.ts b/vips/vip-408/bsctestnet.ts index 63689058a..f5d0ccd39 100644 --- a/vips/vip-408/bsctestnet.ts +++ b/vips/vip-408/bsctestnet.ts @@ -11,11 +11,8 @@ const MockPT_USDe_27MAR2025 = "0x74671106a04496199994787B6BcB064d08afbCCf"; const MockPT_sUSDE_27MAR2025 = "0x3EBa2Aa29eC2498c2124523634324d4ce89c8579"; const MocksUSDe = "0xA3A3e5ecEA56940a4Ae32d0927bfd8821DdA848A"; const MockUSDC = "0x772d68929655ce7234C8C94256526ddA66Ef641E"; - -const VPT_USDe_27MAR2025_ETHENA = "0x11B3a14D9F4182b841bBb48637B26ecCC527A30c"; -const VPT_sUSDE_27MAR2025_ETHENA = "0x4975ECc52179b49ECE4B8328601572f07a1fC51D"; -const VsUSDe_Ethena = "0x4DD1e84040Fe689aDDfeE1996b225e3b193d6A8D"; -const VUSDC_Ethena = "0xf3c213775e0592108350Bd0A1864d7e581fBd3a0"; +export const VsUSDe_Ethena = "0x643a2BE96e7675Ca34bcceCB33F4f0fECA1ba9fC"; +export const VUSDC_Ethena = "0x466fe60aE3d8520e49D67e3483626786Ba0E6416"; export const underlyingAddress = [MockPT_USDe_27MAR2025, MockPT_sUSDE_27MAR2025, MocksUSDe, MockUSDC]; @@ -61,7 +58,7 @@ export const vip408 = () => { { target: sepolia.VTREASURY, signature: "withdrawTreasuryToken(address,uint256,address)", - params: [MocksUSDe, parseUnits("10653", 18), sepolia.NORMAL_TIMELOCK], + params: [MocksUSDe, parseUnits("10000", 18), sepolia.NORMAL_TIMELOCK], dstChainId: LzChainId.sepolia, }, { @@ -73,7 +70,7 @@ export const vip408 = () => { { target: MocksUSDe, signature: "approve(address,uint256)", - params: [sepolia.POOL_REGISTRY, parseUnits("10653", 18)], + params: [sepolia.POOL_REGISTRY, parseUnits("10000", 18)], dstChainId: LzChainId.sepolia, }, { @@ -90,7 +87,7 @@ export const vip408 = () => { VsUSDe_Ethena, parseUnits("0.9", 18), parseUnits("0.92", 18), - parseUnits("10653", 18), + parseUnits("10000", 18), sepolia.VTREASURY, parseUnits("50000000", 18), parseUnits("0", 18), @@ -154,8 +151,8 @@ export const vip408 = () => { { target: COMPTROLLER_ETHENA, - signature: "setActionsPaused(address[],uint256[],bool)", - params: [[VsUSDe_Ethena, VUSDC_Ethena], [3, 7], true], + signature: "setActionsPaused(address[],uint8[],bool)", + params: [[VsUSDe_Ethena, VUSDC_Ethena], [2, 7], true], dstChainId: LzChainId.sepolia, }, @@ -182,13 +179,16 @@ export const vip408 = () => { dstChainId: LzChainId.sepolia, })), - ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ - target: converter, - signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", - params: [baseAsset, [MockUSDC], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], - dstChainId: LzChainId.sepolia, - })), + ...Object.entries(converterBaseAssets) + .filter(([, baseAsset]) => baseAsset !== MockUSDC) // Skip if base asset is USDC + .map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [MockUSDC], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.sepolia, + })), ], + meta, ProposalType.REGULAR, ); From f76ac4cd8ef505f98c451afd1434d8d1da742ce5 Mon Sep 17 00:00:00 2001 From: GitGuru7 <128375421+GitGuru7@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:22:19 +0530 Subject: [PATCH 5/5] [WIP]: add vip for ethereum & fix protocolSeizeShare on sepolia --- multisig/proposals/ethereum/vip-072/index.ts | 16 + simulations/vip-407/bscmainnet.ts | 17 + simulations/vip-407/ethereum.ts | 312 ++++++++++++++++++ simulations/vip-408/bscmainnet.ts | 17 + simulations/vip-408/ethereum.ts | 328 +++++++++++++++++++ simulations/vip-408/sepolia.ts | 4 +- vips/vip-407/bscmainnet.ts | 239 ++++++++++++++ vips/vip-408/bscmainnet.ts | 196 +++++++++++ vips/vip-408/bsctestnet.ts | 4 +- 9 files changed, 1129 insertions(+), 4 deletions(-) create mode 100644 multisig/proposals/ethereum/vip-072/index.ts create mode 100644 simulations/vip-407/bscmainnet.ts create mode 100644 simulations/vip-407/ethereum.ts create mode 100644 simulations/vip-408/bscmainnet.ts create mode 100644 simulations/vip-408/ethereum.ts create mode 100644 vips/vip-407/bscmainnet.ts create mode 100644 vips/vip-408/bscmainnet.ts diff --git a/multisig/proposals/ethereum/vip-072/index.ts b/multisig/proposals/ethereum/vip-072/index.ts new file mode 100644 index 000000000..faec7423f --- /dev/null +++ b/multisig/proposals/ethereum/vip-072/index.ts @@ -0,0 +1,16 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +const { VTREASURY, NORMAL_TIMELOCK } = NETWORK_ADDRESSES.ethereum; + +export const vip071 = () => { + return makeProposal([ + { + target: VTREASURY, + signature: "transferOwnership(address)", + params: [NORMAL_TIMELOCK], + }, + ]); +}; + +export default vip071; diff --git a/simulations/vip-407/bscmainnet.ts b/simulations/vip-407/bscmainnet.ts new file mode 100644 index 000000000..e8f12caf9 --- /dev/null +++ b/simulations/vip-407/bscmainnet.ts @@ -0,0 +1,17 @@ +import { expectEvents } from "../../src/utils"; +import { forking, testVip } from "../../src/vip-framework"; +import vip407 from "../../vips/vip-407/bscmainnet"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +forking(46452753, async () => { + testVip("Ethena", await vip407(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); +}); diff --git a/simulations/vip-407/ethereum.ts b/simulations/vip-407/ethereum.ts new file mode 100644 index 000000000..42a350b6b --- /dev/null +++ b/simulations/vip-407/ethereum.ts @@ -0,0 +1,312 @@ +import { expect } from "chai"; +import { BigNumber, BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { + COMPTROLLER_ETHENA, + PT_USDe_27MAR2025, + PT_sUSDE_27MAR2025, + VPT_USDe_27MAR2025_ETHENA, + VPT_sUSDE_27MAR2025_ETHENA, + vip407, +} from "../../vips/vip-407/bscmainnet"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const { ethereum } = NETWORK_ADDRESSES; + +const BLOCKS_PER_YEAR = BigNumber.from("2628000"); // assuming a block is mined every 14 seconds + +type VTokenSymbol = "vPT-USDe-27MAR2025_Ethena" | "vPT-sUSDE-27MAR2025_Ethena"; + +const vTokens: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": VPT_USDe_27MAR2025_ETHENA, + "vPT-sUSDE-27MAR2025_Ethena": VPT_sUSDE_27MAR2025_ETHENA, +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: number; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + "vPT-USDe-27MAR2025_Ethena": { + name: "Venus PT-USDe-27MAR2025(Ethena)", + symbol: "vPT-USDe-27MAR2025_Ethena", + decimals: 8, + underlying: PT_USDe_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + "vPT-sUSDE-27MAR2025_Ethena": { + name: "Venus PT-sUSDE-27MAR2025 (Ethena)", + symbol: "vPT-sUSDE-27MAR2025_Ethena", + decimals: 8, + underlying: PT_sUSDE_27MAR2025, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; + protocolSeizeShareMantissa: string; + price: BigNumber; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + "vPT-USDe-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "850000", + collateralFactor: "0.86", + liquidationThreshold: "0.88", + reserveFactor: "0", + initialSupply: "10619", + vTokenReceiver: ethereum.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, + "vPT-sUSDE-27MAR2025_Ethena": { + borrowCap: "0", + supplyCap: "12000000", + collateralFactor: "0.85", + liquidationThreshold: "0.87", + reserveFactor: "0", + initialSupply: "10653", + vTokenReceiver: ethereum.VTREASURY, + protocolSeizeShareMantissa: "0.004", + price: parseUnits("1", 18), + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: ["vPT-USDe-27MAR2025_Ethena", "vPT-sUSDE-27MAR2025_Ethena"], + kink: "0.8", + base: "0", + multiplier: "0.08", + jump: "0.8", + }, +]; + +const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { + "vPT-USDe-27MAR2025_Ethena": "", + "vPT-sUSDE-27MAR2025_Ethena": "", +}; + +forking(7302561, async () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, ethereum.POOL_REGISTRY); + }); + + describe("Contracts setup", async () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testForkedNetworkVipCommands("Ethena pool", await vip407()); + + describe("Post-Execution state", () => { + before(async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + interestRateModelAddresses[symbol] = await vToken.interestRateModel(); + } + } + }); + describe("PoolRegistry state", () => { + let registeredPools: { name: string; creator: string; comptroller: string }[]; + before(async () => { + registeredPools = await poolRegistry.getAllPools(); + }); + it("should have 5 pools", async () => { + expect(registeredPools).to.have.lengthOf(5); + }); + it("should register Ethena pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Ethena"); + expect(pool.creator).to.equal(ethereum.NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(COMPTROLLER_ETHENA); + }); + it("should register Ethena pool vTokens in Ethena pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_ETHENA); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(2); + expect(poolVTokens).to.include(vTokens["vPT-USDe-27MAR2025_Ethena"]); + expect(poolVTokens).to.include(vTokens["vPT-sUSDE-27MAR2025_Ethena"]); + }); + + for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { + it(`should register ${symbol} in PoolRegistry`, async () => { + const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); + expect(registeredVToken).to.equal(vTokens[symbol]); + }); + } + }); + + describe("Ownership", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(ethereum.GUARDIAN); + }); + } + }); + + describe("Initial supply", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + it(`should mint initial supply of ${symbol} to ${params.vTokenReceiver}`, async () => { + // Since we're distributing 1:1, decimals should be accounted for in the exchange rate + const expectedSupply = parseUnits(params.initialSupply, 8); + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + expect(await vToken.balanceOf(params.vTokenReceiver)).to.equal(expectedSupply); + }); + } + }); + + describe("Risk parameters", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + describe(`${symbol} risk parameters`, () => { + let vToken: Contract; + let comptroller: Contract; + let underlyingDecimals: number; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, vTokenState[symbol].comptroller); + const underlyingAddress = vTokenState[symbol].underlying; + const underlying = await ethers.getContractAt(ERC20_ABI, underlyingAddress); + underlyingDecimals = await underlying.decimals(); + }); + + it(`should set ${symbol} reserve factor to ${params.reserveFactor}`, async () => { + expect(await vToken.reserveFactorMantissa()).to.equal(parseUnits(params.reserveFactor, 18)); + }); + + it(`should set ${symbol} collateral factor to ${params.collateralFactor}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.collateralFactorMantissa).to.equal(parseUnits(params.collateralFactor, 18)); + }); + + it(`should set ${symbol} liquidation threshold to ${params.liquidationThreshold}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.liquidationThresholdMantissa).to.equal(parseUnits(params.liquidationThreshold, 18)); + }); + + it(`should set ${symbol} protocol seize share ${params.protocolSeizeShareMantissa}`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal( + parseUnits(params.protocolSeizeShareMantissa, 18), + ); + }); + + it(`should set ${symbol} supply cap to ${params.supplyCap}`, async () => { + expect(await comptroller.supplyCaps(vTokens[symbol])).to.equal( + parseUnits(params.supplyCap, underlyingDecimals), + ); + }); + + it(`should set ${symbol} borrow cap to ${params.borrowCap}`, async () => { + expect(await comptroller.borrowCaps(vTokens[symbol])).to.equal( + parseUnits(params.borrowCap, underlyingDecimals), + ); + }); + }); + } + }); + + describe("Pools configuration", () => { + const checkComptroller = (comptrollerAddress: string, comptrollerName: string) => { + describe(`${comptrollerName} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, comptrollerAddress); + }); + + it("should use the correct comptroller address", async () => { + expect(comptroller.address).to.equal(comptrollerAddress); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(ethereum.RESILIENT_ORACLE); + }); + + it("should have close factor = 0.5", async () => { + expect(await comptroller.closeFactorMantissa()).to.equal(parseUnits("0.5", 18)); + }); + + it("should have liquidation incentive = 1.04", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.04", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = NORMAL TIMELOCK", async () => { + expect(await comptroller.owner()).to.equal(ethereum.NORMAL_TIMELOCK); + }); + }); + }; + + checkComptroller(COMPTROLLER_ETHENA, "Ethena"); + }); + + it("Interest rates", async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate( + interestRateModelAddresses[symbol], + symbol, + { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }, + BLOCKS_PER_YEAR, + ); + } + } + }); + it("Check Price", async () => { + const resilientOracle = new ethers.Contract(ethereum.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).equals(params.price); + expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).equals(params.price); + } + }); + }); +}); diff --git a/simulations/vip-408/bscmainnet.ts b/simulations/vip-408/bscmainnet.ts new file mode 100644 index 000000000..e8f12caf9 --- /dev/null +++ b/simulations/vip-408/bscmainnet.ts @@ -0,0 +1,17 @@ +import { expectEvents } from "../../src/utils"; +import { forking, testVip } from "../../src/vip-framework"; +import vip407 from "../../vips/vip-407/bscmainnet"; +import OMNICHAIN_PROPOSAL_SENDER_ABI from "./abi/OmnichainProposalSender.json"; + +forking(46452753, async () => { + testVip("Ethena", await vip407(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [OMNICHAIN_PROPOSAL_SENDER_ABI], + ["ExecuteRemoteProposal", "StorePayload"], + [1, 0], + ); + }, + }); +}); diff --git a/simulations/vip-408/ethereum.ts b/simulations/vip-408/ethereum.ts new file mode 100644 index 000000000..14e0f9d1c --- /dev/null +++ b/simulations/vip-408/ethereum.ts @@ -0,0 +1,328 @@ +import { expect } from "chai"; +import { BigNumber, BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { COMPTROLLER_ETHENA, USDC, sUSDe, vip407 } from "../../vips/vip-407/bscmainnet"; +import { + CONVERSION_INCENTIVE, + VUSDC_Ethena, + VsUSDe_Ethena, + converterBaseAssets, + underlyingAddress, + vip408, +} from "../../vips/vip-408/bscmainnet"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const { ethereum } = NETWORK_ADDRESSES; + +const BLOCKS_PER_YEAR = BigNumber.from(2628000); + +type VTokenSymbol = "vsUSDe_Ethena" | "vUSDC_Ethena"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vsUSDe_Ethena: VsUSDe_Ethena, + vUSDC_Ethena: VUSDC_Ethena, +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: number; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + vsUSDe_Ethena: { + name: "Venus sUSDe (Ethena)", + symbol: "vsUSDe_Ethena", + decimals: 8, + underlying: sUSDe, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_ETHENA, + }, + vUSDC_Ethena: { + name: "Venus USDC (Ethena)", + symbol: "vUSDC_Ethena", + decimals: 8, + underlying: USDC, + exchangeRate: parseUnits("1", 16), + comptroller: COMPTROLLER_ETHENA, + }, +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; + protocolSeizeShareMantissa: string; + price: BigNumber; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + vsUSDe_Ethena: { + borrowCap: "0", + supplyCap: "50000000", + collateralFactor: "0.9", + liquidationThreshold: "0.92", + reserveFactor: "0", + initialSupply: "10000", + vTokenReceiver: ethereum.VTREASURY, + protocolSeizeShareMantissa: "0.010", + price: parseUnits("1", 18), + }, + vUSDC_Ethena: { + borrowCap: "46000000", + supplyCap: "50000000", + collateralFactor: "0", + liquidationThreshold: "0", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: ethereum.VTREASURY, + protocolSeizeShareMantissa: "0.020", + price: BigNumber.from("999987420000000000000000000000"), + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: ["vUSDC_Ethena"], + kink: "0.92", + base: "0", + multiplier: "0.16304", + jump: "2.5", + }, +]; + +const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { + vsUSDe_Ethena: "", + vUSDC_Ethena: "", +}; + +forking(7302561, async () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, ethereum.POOL_REGISTRY); + }); + + describe("Contracts setup", async () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testForkedNetworkVipCommands("Ethena pool", await vip407()); + testForkedNetworkVipCommands("Ethena pool", await vip408()); + + describe("Post-Execution state", () => { + before(async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + interestRateModelAddresses[symbol] = await vToken.interestRateModel(); + } + } + }); + describe("PoolRegistry state", () => { + let registeredPools: { name: string; creator: string; comptroller: string }[]; + before(async () => { + registeredPools = await poolRegistry.getAllPools(); + }); + it("should have 5 pools", async () => { + expect(registeredPools).to.have.lengthOf(5); + }); + it("should register Ethena pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Ethena"); + expect(pool.creator).to.equal(ethereum.NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(COMPTROLLER_ETHENA); + }); + it("should register Ethena pool vTokens in Ethena pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_ETHENA); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(4); + expect(poolVTokens).to.include(vTokens.vUSDC_Ethena); + expect(poolVTokens).to.include(vTokens.vsUSDe_Ethena); + }); + for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { + it(`should register ${symbol} in PoolRegistry`, async () => { + const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); + expect(registeredVToken).to.equal(vTokens[symbol]); + }); + } + }); + + describe("Ownership", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(ethereum.GUARDIAN); + }); + } + }); + + describe("Initial supply", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + it(`should mint initial supply of ${symbol} to ${params.vTokenReceiver}`, async () => { + // Since we're distributing 1:1, decimals should be accounted for in the exchange rate + const expectedSupply = parseUnits(params.initialSupply, 8); + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + expect(await vToken.balanceOf(params.vTokenReceiver)).to.equal(expectedSupply); + }); + } + }); + + describe("Risk parameters", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + describe(`${symbol} risk parameters`, () => { + let vToken: Contract; + let comptroller: Contract; + let underlyingDecimals: number; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, vTokenState[symbol].comptroller); + const underlyingAddress = vTokenState[symbol].underlying; + const underlying = await ethers.getContractAt(ERC20_ABI, underlyingAddress); + underlyingDecimals = await underlying.decimals(); + }); + + it(`should set ${symbol} reserve factor to ${params.reserveFactor}`, async () => { + expect(await vToken.reserveFactorMantissa()).to.equal(parseUnits(params.reserveFactor, 18)); + }); + + it(`should set ${symbol} collateral factor to ${params.collateralFactor}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.collateralFactorMantissa).to.equal(parseUnits(params.collateralFactor, 18)); + }); + + it(`should set ${symbol} liquidation threshold to ${params.liquidationThreshold}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.liquidationThresholdMantissa).to.equal(parseUnits(params.liquidationThreshold, 18)); + }); + + it(`should set ${symbol} protocol seize share ${params.protocolSeizeShareMantissa}`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal( + parseUnits(params.protocolSeizeShareMantissa, 18), + ); + }); + + it(`should set ${symbol} supply cap to ${params.supplyCap}`, async () => { + expect(await comptroller.supplyCaps(vTokens[symbol])).to.equal( + parseUnits(params.supplyCap, underlyingDecimals), + ); + }); + + it(`should set ${symbol} borrow cap to ${params.borrowCap}`, async () => { + expect(await comptroller.borrowCaps(vTokens[symbol])).to.equal( + parseUnits(params.borrowCap, underlyingDecimals), + ); + }); + }); + } + }); + + describe("Pools configuration", () => { + const checkComptroller = (comptrollerAddress: string, comptrollerName: string) => { + describe(`${comptrollerName} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, comptrollerAddress); + }); + + it("should use the correct comptroller address", async () => { + expect(comptroller.address).to.equal(comptrollerAddress); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(ethereum.RESILIENT_ORACLE); + }); + + it("should have close factor = 0.5", async () => { + expect(await comptroller.closeFactorMantissa()).to.equal(parseUnits("0.5", 18)); + }); + + it("should have liquidation incentive = 1.04", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.04", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = GUARDIAN", async () => { + expect(await comptroller.owner()).to.equal(ethereum.NORMAL_TIMELOCK); + }); + }); + }; + + checkComptroller(COMPTROLLER_ETHENA, "Ethena"); + }); + + it("Interest rates", async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate( + interestRateModelAddresses[symbol], + symbol, + { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }, + BLOCKS_PER_YEAR, + ); + } + } + }); + it("Check Price", async () => { + const resilientOracle = new ethers.Contract(ethereum.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + expect(await resilientOracle.getPrice(vTokenState[symbol].underlying)).equals(params.price); + expect(await resilientOracle.getUnderlyingPrice(vTokens[symbol])).equals(params.price); + } + }); + + describe("Converters", () => { + for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { + const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + for (const asset of underlyingAddress) { + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset ${asset}`, async () => { + if (baseAsset != asset) { + const result = await converterContract.conversionConfigurations(baseAsset, asset); + expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + } + }); + } + } + }); + }); +}); diff --git a/simulations/vip-408/sepolia.ts b/simulations/vip-408/sepolia.ts index fbefe8e21..efd664b80 100644 --- a/simulations/vip-408/sepolia.ts +++ b/simulations/vip-408/sepolia.ts @@ -84,7 +84,7 @@ const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { reserveFactor: "0", initialSupply: "10000", vTokenReceiver: sepolia.VTREASURY, - protocolSeizeShareMantissa: "0.0010", + protocolSeizeShareMantissa: "0.010", price: parseUnits("1", 18), }, vUSDC_Ethena: { @@ -95,7 +95,7 @@ const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { reserveFactor: "0.1", initialSupply: "10000", vTokenReceiver: sepolia.VTREASURY, - protocolSeizeShareMantissa: "0.0020", + protocolSeizeShareMantissa: "0.020", price: BigNumber.from("999987420000000000000000000000"), }, }; diff --git a/vips/vip-407/bscmainnet.ts b/vips/vip-407/bscmainnet.ts new file mode 100644 index 000000000..7a4178b49 --- /dev/null +++ b/vips/vip-407/bscmainnet.ts @@ -0,0 +1,239 @@ +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 { ethereum } = NETWORK_ADDRESSES; + +export const ACM = "0x230058da2D23eb8836EC5DB7037ef7250c56E25E"; +export const COMPTROLLER_ETHENA = ""; + +export const PT_USDe_27MAR2025 = "0x8a47b431a7d947c6a3ed6e42d501803615a97eaa"; +export const PT_sUSDE_27MAR2025 = "0xe00bd3df25fb187d6abbb620b3dfd19839947b81"; +export const sUSDe = "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"; +export const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; +const USDe = "0x4c9edd5852cd905f086c759e8383e09bff1e68b3"; + +export const VPT_USDe_27MAR2025_ETHENA = ""; +export const VPT_sUSDE_27MAR2025_ETHENA = ""; + +const sUSDE_ERC4626ORACLE = ""; +const PendleOracle_PT_USDe_27MAR2025 = ""; +const PendleOracle_PT_sUSDe_27MAR2025 = ""; +const BOUND_VALIDATOR = ""; + +const REDSTONE_USDe_FEED = "0xbC5FBcf58CeAEa19D523aBc76515b9AEFb5cfd58"; +const CHAINLINK_USDe_FEED = "0xa569d910839Ae8865Da8F8e70FfFb0cBA869F961"; + +export const EXCHANGE_RATE = parseUnits("1", 18); +const STALE_PERIOD_26H = 60 * 60 * 26; // 26 hours (pricefeeds with heartbeat of 24 hr) +const UPPER_BOUND_RATIO = parseUnits("1.01", 18); +const LOWER_BOUND_RATIO = parseUnits("0.99", 18); + +export const vip407 = () => { + const meta = { + version: "v2", + title: "VIP-407 [Ethereum] New Ethena pool", + description: `#### Summary`, + forDescription: "Process to configure and launch the new pool", + againstDescription: "Defer configuration and launch of the new pool", + abstainDescription: "No opinion on the matter", + }; + return makeProposal( + [ + { + target: COMPTROLLER_ETHENA, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.VTREASURY, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.ethereum, + }, + { + target: BOUND_VALIDATOR, + signature: "setValidateConfig((address,uint256,uint256))", + params: [[USDe, UPPER_BOUND_RATIO, LOWER_BOUND_RATIO]], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.REDSTONE_ORACLE, + signature: "setTokenConfig((address,address,uint256))", + params: [USDe, REDSTONE_USDe_FEED, STALE_PERIOD_26H], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.CHAINLINK_ORACLE, + signature: "setTokenConfig((address,address,uint256))", + params: [[USDe, CHAINLINK_USDe_FEED, STALE_PERIOD_26H]], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [USDe, [ethereum.REDSTONE_ORACLE, ethereum.CHAINLINK_ORACLE, ethereum.CHAINLINK_ORACLE], [true, true, true]], + ], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + sUSDe, + [sUSDE_ERC4626ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.ethereum, + }, + + { + target: ethereum.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + PT_USDe_27MAR2025, + [PendleOracle_PT_USDe_27MAR2025, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.ethereum, + }, + + { + target: ethereum.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3]))", + params: [ + [ + PT_sUSDE_27MAR2025, + [PendleOracle_PT_sUSDe_27MAR2025, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + ], + ], + dstChainId: LzChainId.ethereum, + }, + + { + target: COMPTROLLER_ETHENA, + signature: "setPriceOracle(address)", + params: [ethereum.RESILIENT_ORACLE], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["Ethena", COMPTROLLER_ETHENA, parseUnits("0.5", 18), parseUnits("1.04", 18), parseUnits("100", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [PT_USDe_27MAR2025, parseUnits("10619", 18), ethereum.NORMAL_TIMELOCK], + dstChainId: LzChainId.ethereum, + }, + { + target: PT_USDe_27MAR2025, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, 0], + dstChainId: LzChainId.ethereum, + }, + { + target: PT_USDe_27MAR2025, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, parseUnits("10619", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: VPT_USDe_27MAR2025_ETHENA, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VPT_USDe_27MAR2025_ETHENA, + parseUnits("0.86", 18), + parseUnits("0.88", 18), + parseUnits("10619", 18), + ethereum.VTREASURY, + parseUnits("850000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [PT_sUSDE_27MAR2025, parseUnits("10653", 18), ethereum.NORMAL_TIMELOCK], + dstChainId: LzChainId.ethereum, + }, + { + target: PT_sUSDE_27MAR2025, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, 0], + dstChainId: LzChainId.ethereum, + }, + { + target: PT_sUSDE_27MAR2025, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, parseUnits("10653", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: VPT_sUSDE_27MAR2025_ETHENA, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VPT_sUSDE_27MAR2025_ETHENA, + parseUnits("0.85", 18), + parseUnits("0.87", 18), + parseUnits("10653", 18), + ethereum.VTREASURY, + parseUnits("12000000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.ethereum, + }, + + { + target: VPT_USDe_27MAR2025_ETHENA, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.004", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: VPT_sUSDE_27MAR2025_ETHENA, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.004", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: COMPTROLLER_ETHENA, + signature: "setActionsPaused(address[],uint8[],bool)", + params: [[VPT_USDe_27MAR2025_ETHENA, VPT_sUSDE_27MAR2025_ETHENA], [2, 2], true], + dstChainId: LzChainId.ethereum, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip407; diff --git a/vips/vip-408/bscmainnet.ts b/vips/vip-408/bscmainnet.ts new file mode 100644 index 000000000..d3d66d791 --- /dev/null +++ b/vips/vip-408/bscmainnet.ts @@ -0,0 +1,196 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { ethereum } = NETWORK_ADDRESSES; + +const COMPTROLLER_ETHENA = ""; + +const PT_USDe_27MAR2025 = "0x8a47b431a7d947c6a3ed6e42d501803615a97eaa"; +const PT_sUSDE_27MAR2025 = "0xe00bd3df25fb187d6abbb620b3dfd19839947b81"; +const sUSDe = "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"; +const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; +export const VsUSDe_Ethena = ""; +export const VUSDC_Ethena = ""; + +export const underlyingAddress = [PT_USDe_27MAR2025, PT_sUSDE_27MAR2025, sUSDe, USDC]; + +enum ConversionAccessibility { + NONE = 0, + ALL = 1, + ONLY_FOR_CONVERTERS = 2, + ONLY_FOR_USERS = 3, +} + +export const CONVERSION_INCENTIVE = 1e14; + +export const USDT_PRIME_CONVERTER = "0x4f55cb0a24D5542a3478B0E284259A6B850B06BD"; +export const USDC_PRIME_CONVERTER = "0xcEB9503f10B781E30213c0b320bCf3b3cE54216E"; +export const WBTC_PRIME_CONVERTER = "0xDcCDE673Cd8988745dA384A7083B0bd22085dEA0"; +export const WETH_PRIME_CONVERTER = "0xb8fD67f215117FADeF06447Af31590309750529D"; +export const XVS_VAULT_CONVERTER = "0x1FD30e761C3296fE36D9067b1e398FD97B4C0407"; +const USDT = "0xdAC17F958D2ee523a2206206994597C13D831ec7"; +const WBTC = "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"; +const WETH = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; +const XVS = "0xd3CC9d8f3689B83c91b7B59cAB4946B063EB894A"; + +export const converterBaseAssets = { + [USDT_PRIME_CONVERTER]: USDT, + [USDC_PRIME_CONVERTER]: USDC, + [WBTC_PRIME_CONVERTER]: WBTC, + [WETH_PRIME_CONVERTER]: WETH, + [XVS_VAULT_CONVERTER]: XVS, +}; + +export const vip408 = () => { + const meta = { + version: "v2", + title: "VIP-408 [Ethereum] New Ethena pool (Part-II)", + description: `#### Summary`, + forDescription: "Process to configure and launch the new pool", + againstDescription: "Defer configuration and launch of the new pool", + abstainDescription: "No opinion on the matter", + }; + return makeProposal( + [ + { + target: ethereum.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [sUSDe, parseUnits("10000", 18), ethereum.NORMAL_TIMELOCK], + dstChainId: LzChainId.ethereum, + }, + { + target: sUSDe, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, 0], + dstChainId: LzChainId.ethereum, + }, + { + target: sUSDe, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, parseUnits("10000", 18)], + dstChainId: LzChainId.ethereum, + }, + { + target: VsUSDe_Ethena, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VsUSDe_Ethena, + parseUnits("0.9", 18), + parseUnits("0.92", 18), + parseUnits("10000", 18), + ethereum.VTREASURY, + parseUnits("50000000", 18), + parseUnits("0", 18), + ], + ], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [USDC, parseUnits("10000", 6), ethereum.NORMAL_TIMELOCK], + dstChainId: LzChainId.ethereum, + }, + { + target: USDC, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, 0], + dstChainId: LzChainId.ethereum, + }, + { + target: USDC, + signature: "approve(address,uint256)", + params: [ethereum.POOL_REGISTRY, parseUnits("10000", 6)], + dstChainId: LzChainId.ethereum, + }, + { + target: VUSDC_Ethena, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["7200"], + dstChainId: LzChainId.ethereum, + }, + { + target: ethereum.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VUSDC_Ethena, + parseUnits("0", 18), + parseUnits("0", 18), + parseUnits("10000", 6), + ethereum.VTREASURY, + parseUnits("50000000", 6), + parseUnits("46000000", 6), + ], + ], + dstChainId: LzChainId.ethereum, + }, + { + target: VsUSDe_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.010", 18)], + dstChainId: LzChainId.ethereum, + }, + + { + target: VUSDC_Ethena, + signature: "setProtocolSeizeShare(uint256)", + params: [parseUnits("0.020", 18)], + dstChainId: LzChainId.ethereum, + }, + + { + target: COMPTROLLER_ETHENA, + signature: "setActionsPaused(address[],uint8[],bool)", + params: [[VsUSDe_Ethena, VUSDC_Ethena], [2, 7], true], + dstChainId: LzChainId.ethereum, + }, + + // Configure converters + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [PT_USDe_27MAR2025], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.ethereum, + })), + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [PT_sUSDE_27MAR2025], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.ethereum, + })), + + ...Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [sUSDe], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.ethereum, + })), + + ...Object.entries(converterBaseAssets) + .filter(([, baseAsset]) => baseAsset !== USDC) // Skip if base asset is USDC + .map(([converter, baseAsset]: [string, string]) => ({ + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, [USDC], [[CONVERSION_INCENTIVE, ConversionAccessibility.ALL]]], + dstChainId: LzChainId.ethereum, + })), + ], + + meta, + ProposalType.REGULAR, + ); +}; + +export default vip408; diff --git a/vips/vip-408/bsctestnet.ts b/vips/vip-408/bsctestnet.ts index f5d0ccd39..86b6368cc 100644 --- a/vips/vip-408/bsctestnet.ts +++ b/vips/vip-408/bsctestnet.ts @@ -138,14 +138,14 @@ export const vip408 = () => { { target: VsUSDe_Ethena, signature: "setProtocolSeizeShare(uint256)", - params: [parseUnits("0.0010", 18)], + params: [parseUnits("0.010", 18)], dstChainId: LzChainId.sepolia, }, { target: VUSDC_Ethena, signature: "setProtocolSeizeShare(uint256)", - params: [parseUnits("0.0020", 18)], + params: [parseUnits("0.020", 18)], dstChainId: LzChainId.sepolia, },