diff --git a/simulations/vip-371/abi/comptroller.json b/simulations/vip-371/abi/comptroller.json new file mode 100644 index 000000000..56890d9b3 --- /dev/null +++ b/simulations/vip-371/abi/comptroller.json @@ -0,0 +1,929 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "poolRegistry_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" } + ], + "name": "ActionPaused", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedLessThanOrEqualTo", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { "inputs": [], "name": "ComptrollerMismatch", "type": "error" }, + { "inputs": [], "name": "DelegationStatusUnchanged", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "collateralToSeize", "type": "uint256" }, + { "internalType": "uint256", "name": "availableCollateral", "type": "uint256" } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { "inputs": [], "name": "InsufficientLiquidity", "type": "error" }, + { "inputs": [], "name": "InsufficientShortfall", "type": "error" }, + { "inputs": [], "name": "InvalidCollateralFactor", "type": "error" }, + { "inputs": [], "name": "InvalidLiquidationThreshold", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "MarketNotCollateral", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopsLimit", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredLoops", "type": "uint256" } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedGreaterThan", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { "inputs": [], "name": "NonzeroBorrowBalance", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "PriceError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "TooMuchRepay", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "expectedSender", "type": "address" }, + { "internalType": "address", "name": "actualSender", "type": "address" } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" }, + { "indexed": false, "internalType": "bool", "name": "pauseState", "type": "bool" } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "approver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLoopsLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newmaxLoopsLimit", "type": "uint256" } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldCloseFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldCollateralFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationIncentiveMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationThresholdMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableCollateral", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IPrime", "name": "oldPrimeToken", "type": "address" }, + { "indexed": false, "internalType": "contract IPrime", "name": "newPrimeToken", "type": "address" } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "accountAssets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum ComptrollerStorage.Action", "name": "action", "type": "uint8" } + ], + "name": "actionPaused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract RewardsDistributor", "name": "_rewardsDistributor", "type": "address" }], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "allMarkets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "approvedDelegates", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "borrowCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "contract VToken", "name": "vToken", "type": "address" } + ], + "name": "checkMembership", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "vTokens", "type": "address[]" }], + "name": "enterMarkets", + "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vTokenAddress", "type": "address" }], + "name": "exitMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAssetsIn", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getBorrowingPower", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "vTokenModify", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [{ "internalType": "contract RewardsDistributor[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "supplySpeed", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowSpeed", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopLimit", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isForcedLiquidationEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "isMarketListed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { + "components": [ + { "internalType": "contract VToken", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "contract VToken", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "tokensToSeize", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "markets", + "outputs": [ + { "internalType": "bool", "name": "isListed", "type": "bool" }, + { "internalType": "uint256", "name": "collateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThresholdMantissa", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "actualMintAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "seizerContract", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [{ "internalType": "contract IPrime", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowerIndex", "type": "uint256" } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "marketsList", "type": "address[]" }, + { "internalType": "enum ComptrollerStorage.Action[]", "name": "actionsList", "type": "uint8[]" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" }], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" }], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newBorrowCaps", "type": "uint256[]" } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newSupplyCaps", "type": "uint256[]" } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" }], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ResilientOracleInterface", "name": "newOracle", "type": "address" }], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IPrime", "name": "_prime", "type": "address" }], + "name": "setPrimeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "supplyCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "updatePrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-371/bscmainnet.ts b/simulations/vip-371/bscmainnet.ts new file mode 100644 index 000000000..5accbc43e --- /dev/null +++ b/simulations/vip-371/bscmainnet.ts @@ -0,0 +1,90 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { expectEvents, setMaxStaleCoreAssets } from "src/utils"; +import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; + +import vip370 from "../../vips/vip-370/bscmainnet"; +import vip371, { COMPTROLLER, vETH, vweETH, vwstETH } from "../../vips/vip-371/bscmainnet"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; + +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; +const CHAINLINK = "0x1B2103441A0A108daD8848D8F5d790e4D402921F"; + +const previousCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("450", 18), + borrowCap: parseUnits("400", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("400", 18), + borrowCap: parseUnits("200", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("50", 18), + borrowCap: parseUnits("5", 18), + }, +}; + +const newCaps = { + ETH: { + vToken: vETH, + supplyCap: parseUnits("3600", 18), + borrowCap: parseUnits("3250", 18), + }, + weETH: { + vToken: vweETH, + supplyCap: parseUnits("120", 18), + borrowCap: parseUnits("60", 18), + }, + wstETH: { + vToken: vwstETH, + supplyCap: parseUnits("3200", 18), + borrowCap: parseUnits("320", 18), + }, +}; + +forking(42511365, async () => { + let comptrollerContract: Contract; + + before(async () => { + await pretendExecutingVip(await vip370({}), NORMAL_TIMELOCK); + comptrollerContract = new ethers.Contract(COMPTROLLER, COMPTROLLER_ABI, await ethers.getSigner(NORMAL_TIMELOCK)); + + await setMaxStaleCoreAssets(CHAINLINK, NORMAL_TIMELOCK); + }); + + describe("Pre-VIP behavior", async () => { + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(previousCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); + + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } + }); + + testVip("VIP-371", await vip371(), { + callbackAfterExecution: async txResponse => { + await expectEvents(txResponse, [COMPTROLLER_ABI], ["NewSupplyCap", "NewBorrowCap"], [3, 3]); + }, + }); + + describe("Post-VIP behavior", async () => { + for (const [market, { vToken, supplyCap, borrowCap }] of Object.entries(newCaps)) { + it(`check supply and borrow cap on ${market}`, async () => { + const currentSupplyCap = await comptrollerContract.supplyCaps(vToken); + expect(currentSupplyCap).to.be.equal(supplyCap); + + const currentBorrowCap = await comptrollerContract.borrowCaps(vToken); + expect(currentBorrowCap).to.be.equal(borrowCap); + }); + } + }); +}); diff --git a/vips/vip-371/bscmainnet.ts b/vips/vip-371/bscmainnet.ts new file mode 100644 index 000000000..f028b9009 --- /dev/null +++ b/vips/vip-371/bscmainnet.ts @@ -0,0 +1,69 @@ +import { parseUnits } from "ethers/lib/utils"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +export const vETH = "0xeCCACF760FEA7943C5b0285BD09F601505A29c05"; +export const vweETH = "0xc5b24f347254bD8cF8988913d1fd0F795274900F"; +export const vwstETH = "0x94180a3948296530024Ef7d60f60B85cfe0422c8"; +export const COMPTROLLER = "0xBE609449Eb4D76AD8545f957bBE04b596E8fC529"; +export const ETH_SUPPLY_CAP = parseUnits("3600", 18); +export const ETH_BORROW_CAP = parseUnits("3250", 18); +export const weETH_SUPPLY_CAP = parseUnits("120", 18); +export const weETH_BORROW_CAP = parseUnits("60", 18); +export const wstETH_SUPPLY_CAP = parseUnits("3200", 18); +export const wstETH_BORROW_CAP = parseUnits("320", 18); + +const vip371 = () => { + const meta = { + version: "v2", + title: "VIP-371 [BNB] Risk Parameters Adjustments (ETH, wstETH, weETH)", + description: `This VIP will perform the following Risk Parameter actions as per Chaos Labs’ latest recommendations in this Venus community forum publication: [Chaos Labs - Risk Parameter Updates - 09/23/24](https://community.venus.io/t/support-lido-wsteth-token-in-a-new-venus-protocol-bnbchain-lst-eth-pool/4526/8). + +- [ETH (Liquid Staked ETH)](https://bscscan.com/address/0xeCCACF760FEA7943C5b0285BD09F601505A29c05) + - Increase supply cap from 450 ETH to 3,600 ETH + - Increase borrow cap from 400 ETH to 3,250 ETH +- [wstETH (Liquid Staked ETH)](https://bscscan.com/address/0x94180a3948296530024Ef7d60f60B85cfe0422c8) + - Increase supply cap from 50 wstETH to 3,200 wstETH + - Increase borrow cap from 5 wstETH to 320 wstETH +- [weETH (Liquid Staked ETH)](https://bscscan.com/address/0xc5b24f347254bD8cF8988913d1fd0F795274900F) + - Decrease supply cap from 400 weETH to 120 weETH + - Decrease borrow cap from 200 weETH to 60 weETH + +This VIP should be executed after executing the [VIP-370](https://app.venus.io/#/governance/proposal/370?chainId=56), where the affected markets will be enabled. + +Complete analysis and details of these recommendations are available in the above publication. + +#### References + +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/356) +- [VIP-370: Add Liquid Staked ETH pool to BNB chain](https://app.venus.io/#/governance/proposal/370?chainId=56)`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: COMPTROLLER, + signature: "setMarketSupplyCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_SUPPLY_CAP, weETH_SUPPLY_CAP, wstETH_SUPPLY_CAP], + ], + }, + { + target: COMPTROLLER, + signature: "setMarketBorrowCaps(address[],uint256[])", + params: [ + [vETH, vweETH, vwstETH], + [ETH_BORROW_CAP, weETH_BORROW_CAP, wstETH_BORROW_CAP], + ], + }, + ], + meta, + ProposalType.FAST_TRACK, + ); +}; + +export default vip371;