diff --git a/simulations/vip-136/vip-136-testnet/abi/comptroller.json b/simulations/vip-136/vip-136-testnet/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/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-136/vip-136-testnet/abi/erc20.json b/simulations/vip-136/vip-136-testnet/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/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-136/vip-136-testnet/abi/poolRegistry.json b/simulations/vip-136/vip-136-testnet/abi/poolRegistry.json new file mode 100644 index 000000000..2d0268aeb --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/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-136/vip-136-testnet/abi/rateModel.json b/simulations/vip-136/vip-136-testnet/abi/rateModel.json new file mode 100644 index 000000000..8c04a8527 --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/abi/rateModel.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [ + { "internalType": "uint256", "name": "baseRatePerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "multiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "jumpMultiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "kink_", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "baseRatePerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "multiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "jumpMultiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "kink", "type": "uint256" } + ], + "name": "NewInterestParams", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "baseRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "blocksPerYear", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "getBorrowRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" }, + { "internalType": "uint256", "name": "reserveFactorMantissa", "type": "uint256" } + ], + "name": "getSupplyRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isInterestRateModel", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "jumpMultiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kink", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "multiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "utilizationRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "pure", + "type": "function" + } +] diff --git a/simulations/vip-136/vip-136-testnet/abi/swapRouter.json b/simulations/vip-136/vip-136-testnet/abi/swapRouter.json new file mode 100644 index 000000000..17c9e5362 --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/abi/swapRouter.json @@ -0,0 +1,1697 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "WBNB_", + "type": "address" + }, + { + "internalType": "address", + "name": "factory_", + "type": "address" + }, + { + "internalType": "address", + "name": "_comptrollerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vBNBAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountMax", + "type": "uint256" + } + ], + "name": "ExcessiveInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "IdenticalAddresses", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountIntMax", + "type": "uint256" + } + ], + "name": "InputAmountAboveMaximum", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sweepAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPath", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + } + ], + "name": "OutputAmountBelowMinimum", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCheck", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "RepayError", + "type": "error" + }, + { + "inputs": [], + "name": "SafeApproveFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferBNBFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferFromFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "SupplyError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + } + ], + "name": "SwapAmountLessThanAmountOutMin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestemp", + "type": "uint256" + } + ], + "name": "SwapDeadlineExpire", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "VTokenNotListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying", + "type": "address" + } + ], + "name": "VTokenUnderlyingInvalid", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedAdddress", + "type": "address" + }, + { + "internalType": "address", + "name": "passedAddress", + "type": "address" + } + ], + "name": "WrongAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapBnbForTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapBnbForTokensAtSupportingFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapTokensForBnb", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapTokensForBnbAtSupportingFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapTokensForTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapTokensForTokensAtSupportingFee", + "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": "sweepAmount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "VBNBAddressUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "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": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveB", + "type": "uint256" + } + ], + "name": "quote", + "outputs": [ + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vBNBAddress", + "type": "address" + } + ], + "name": "setVBNBAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokensAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokensAndSupply", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForFullTokenDebtAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndSupply", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNB", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNB", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNBAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNBAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokensAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokensAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForFullBNBDebtAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForFullTokenDebtAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sweepAmount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNBAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/simulations/vip-136/vip-136-testnet/abi/vToken.json b/simulations/vip-136/vip-136-testnet/abi/vToken.json new file mode 100644 index 000000000..a413ca84d --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/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-136/vip-136-testnet/simulations.ts b/simulations/vip-136/vip-136-testnet/simulations.ts new file mode 100644 index 000000000..4b3bd39e7 --- /dev/null +++ b/simulations/vip-136/vip-136-testnet/simulations.ts @@ -0,0 +1,928 @@ +import { expect } from "chai"; +import { BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; + +import { setMaxStalePeriodInBinanceOracle, setMaxStalePeriodInChainlinkOracle } from "../../../src/utils"; +import { forking, testVip } from "../../../src/vip-framework"; +import { vip136Testnet } from "../../../vips/vip-136/vip-136-testnet"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import RATE_MODEL_ABI from "./abi/rateModel.json"; +import SWAP_ROUTER_ABI from "./abi/swapRouter.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const RESILIENT_ORACLE = "0x3cD69251D04A28d887Ac14cbe2E14c52F3D57823"; +const CHAINLINK_ORACLE = "0xCeA29f1266e880A1482c06eD656cD08C148BaA32"; +const BINANCE_ORACLE = "0xB58BFDCE610042311Dc0e034a80Cc7776c1D68f5"; +const NORMAL_TIMELOCK = "0xce10739590001705F7FF231611ba4A48B2820327"; +const POOL_REGISTRY = "0xC85491616Fa949E048F3aAc39fbf5b0703800667"; +const TREASURY = "0x8b293600c50d6fbdc6ed4251cc75ece29880276f"; + +const VBNB_CORE_POOL = "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c"; + +type PoolId = "DeFi" | "GameFi" | "LiquidStakedBNB" | "Tron"; + +interface PoolContracts { + comptroller: string; + swapRouter: string; +} + +const pools: { [key in PoolId]: PoolContracts } = { + DeFi: { + comptroller: "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", + swapRouter: "0x89Bc8dFe0Af08b60ec285071d133FCdfa9B3C08e", + }, + GameFi: { + comptroller: "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", + swapRouter: "0x5D254Bc7c7f2670395B9E0716C21249083D41a4f", + }, + LiquidStakedBNB: { + comptroller: "0x596B11acAACF03217287939f88d63b51d3771704", + swapRouter: "0xb16792E90d6478DaBbd0144e13f41CeA21ACE116", + }, + Tron: { + comptroller: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", + swapRouter: "0x1D8cA5AFB88F07489786A3d2E0FF50F3F9314d97", + }, +}; + +type UnderlyingSymbol = + | "USDT" + | "USDD" + | "BIFI" + | "BSW" + | "ALPACA" + | "ANKR" + | "RACA" + | "FLOKI" + | "ankrBNB" + | "BNBx" + | "stkBNB" + | "WBNB" + | "BTT" + | "WIN" + | "TRX"; + +type VTokenSymbol = + | "vALPACA_DeFi" + | "vANKR_DeFi" + | "vBIFI_DeFi" + | "vUSDT_DeFi" + | "vBSW_DeFi" + | "vUSDD_DeFi" + | "vFLOKI_GameFi" + | "vRACA_GameFi" + | "vUSDD_GameFi" + | "vUSDT_GameFi" + | "vBNBx_LiquidStakedBNB" + | "vUSDD_LiquidStakedBNB" + | "vUSDT_LiquidStakedBNB" + | "vWBNB_LiquidStakedBNB" + | "vankrBNB_LiquidStakedBNB" + | "vstkBNB_LiquidStakedBNB" + | "vBTT_Tron" + | "vTRX_Tron" + | "vUSDD_Tron" + | "vUSDT_Tron" + | "vWIN_Tron"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vALPACA_DeFi: "0xb7caC5Ef82cb7f9197ee184779bdc52c5490C02a", + vANKR_DeFi: "0xb677e080148368EeeE70fA3865d07E92c6500174", + vBIFI_DeFi: "0xEF949287834Be010C1A5EDd757c385FB9b644E4A", + vUSDT_DeFi: "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750", + vBSW_DeFi: "0x5e68913fbbfb91af30366ab1B21324410b49a308", + vUSDD_DeFi: "0xa109DE0abaeefC521Ec29D89eA42E64F37A6882E", + + vFLOKI_GameFi: "0xef470AbC365F88e4582D8027172a392C473A5B53", + vRACA_GameFi: "0x1958035231E125830bA5d17D168cEa07Bb42184a", + vUSDD_GameFi: "0xdeDf3B2bcF25d0023115fd71a0F8221C91C92B1a", + vUSDT_GameFi: "0x0bFE4e0B8A2a096A27e5B18b078d25be57C08634", + + vBNBx_LiquidStakedBNB: "0x644A149853E5507AdF3e682218b8AC86cdD62951", + vUSDD_LiquidStakedBNB: "0xD5b20708d8f0FcA52cb609938D0594C4e32E5DaD", + vUSDT_LiquidStakedBNB: "0x2197d02cC9cd1ad51317A0a85A656a0c82383A7c", + vWBNB_LiquidStakedBNB: "0x231dED0Dfc99634e52EE1a1329586bc970d773b3", + vankrBNB_LiquidStakedBNB: "0x57a664Dd7f1dE19545fEE9c86C949e3BF43d6D47", + vstkBNB_LiquidStakedBNB: "0x75aa42c832a8911B77219DbeBABBB40040d16987", + + vBTT_Tron: "0x47793540757c6E6D84155B33cd8D9535CFdb9334", + vTRX_Tron: "0x410286c43a525E1DCC7468a9B091C111C8324cd1", + vUSDD_Tron: "0xD804F74fe21290d213c46610ab171f7c2EeEBDE7", + vUSDT_Tron: "0x712774CBFFCBD60e9825871CcEFF2F917442b2c3", + vWIN_Tron: "0xEe543D5de2Dbb5b07675Fc72831A2f1812428393", +}; + +const tokens = { + USDT: "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", + USDD: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + + BIFI: "0x5B662703775171c4212F2FBAdb7F92e64116c154", + BSW: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + ALPACA: "0x6923189d91fdF62dBAe623a55273F1d20306D9f2", + ANKR: "0xe4a90EB942CF2DA7238e8F6cC9EF510c49FC8B4B", + + RACA: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + FLOKI: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + + ankrBNB: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + BNBx: "0x327d6E6FAC0228070884e913263CFF9eFed4a2C8", + stkBNB: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + WBNB: "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + + BTT: "0xE98344A7c691B200EF47c9b8829110087D832C64", + WIN: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + TRX: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: BigNumberish; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + // DeFi pool + vALPACA_DeFi: { + name: "Venus ALPACA (DeFi)", + symbol: "vALPACA_DeFi", + decimals: 8, + underlying: tokens.ALPACA, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vANKR_DeFi: { + name: "Venus ANKR (DeFi)", + symbol: "vANKR_DeFi", + decimals: 8, + underlying: tokens.ANKR, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vBIFI_DeFi: { + name: "Venus BIFI (DeFi)", + symbol: "vBIFI_DeFi", + decimals: 8, + underlying: tokens.BIFI, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vUSDT_DeFi: { + name: "Venus USDT (DeFi)", + symbol: "vUSDT_DeFi", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.DeFi.comptroller, + }, + vBSW_DeFi: { + name: "Venus BSW (DeFi)", + symbol: "vBSW_DeFi", + decimals: 8, + underlying: tokens.BSW, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vUSDD_DeFi: { + name: "Venus USDD (DeFi)", + symbol: "vUSDD_DeFi", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + + // GameFi pool + vFLOKI_GameFi: { + name: "Venus FLOKI (GameFi)", + symbol: "vFLOKI_GameFi", + decimals: 8, + underlying: tokens.FLOKI, + exchangeRate: parseUnits("1", 28), // FLOKI has 18 decimals on testnet + comptroller: pools.GameFi.comptroller, + }, + vRACA_GameFi: { + name: "Venus RACA (GameFi)", + symbol: "vRACA_GameFi", + decimals: 8, + underlying: tokens.RACA, + exchangeRate: parseUnits("1", 28), + comptroller: pools.GameFi.comptroller, + }, + vUSDT_GameFi: { + name: "Venus USDT (GameFi)", + symbol: "vUSDT_GameFi", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.GameFi.comptroller, + }, + vUSDD_GameFi: { + name: "Venus USDD (GameFi)", + symbol: "vUSDD_GameFi", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.GameFi.comptroller, + }, + + // Liquid Staked BNB pool + vBNBx_LiquidStakedBNB: { + name: "Venus BNBx (Liquid Staked BNB)", + symbol: "vBNBx_LiquidStakedBNB", + decimals: 8, + underlying: tokens.BNBx, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vUSDD_LiquidStakedBNB: { + name: "Venus USDD (Liquid Staked BNB)", + symbol: "vUSDD_LiquidStakedBNB", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vUSDT_LiquidStakedBNB: { + name: "Venus USDT (Liquid Staked BNB)", + symbol: "vUSDT_LiquidStakedBNB", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vWBNB_LiquidStakedBNB: { + name: "Venus WBNB (Liquid Staked BNB)", + symbol: "vWBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.WBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vankrBNB_LiquidStakedBNB: { + name: "Venus ankrBNB (Liquid Staked BNB)", + symbol: "vankrBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.ankrBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vstkBNB_LiquidStakedBNB: { + name: "Venus stkBNB (Liquid Staked BNB)", + symbol: "vstkBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.stkBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + + // Tron pool + vBTT_Tron: { + name: "Venus BTT (Tron)", + symbol: "vBTT_Tron", + decimals: 8, + underlying: tokens.BTT, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, + vTRX_Tron: { + name: "Venus TRX (Tron)", + symbol: "vTRX_Tron", + decimals: 8, + underlying: tokens.TRX, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.Tron.comptroller, + }, + vUSDT_Tron: { + name: "Venus USDT (Tron)", + symbol: "vUSDT_Tron", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.Tron.comptroller, + }, + vUSDD_Tron: { + name: "Venus USDD (Tron)", + symbol: "vUSDD_Tron", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, + vWIN_Tron: { + name: "Venus WIN (Tron)", + symbol: "vWIN_Tron", + decimals: 8, + underlying: tokens.WIN, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, +}; + +const binanceFeeds: UnderlyingSymbol[] = ["USDD", "ANKR", "RACA", "FLOKI", "BTT", "stkBNB", "ankrBNB"]; + +const chainlinkFeeds: { [key in UnderlyingSymbol]?: string } = { + WBNB: "0x2514895c72f50D8bd4B4F9b1110F0D6bD2c97526", + TRX: "0x135deD16bFFEB51E01afab45362D3C4be31AA2B0", + USDT: "0xEca2605f0BCF2BA5966372C99837b1F182d3D620", +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + // DeFi + vBIFI_DeFi: { + borrowCap: "266", + supplyCap: "379", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "50", + vTokenReceiver: TREASURY, + }, + vBSW_DeFi: { + borrowCap: "10500000", + supplyCap: "15000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "475750", + vTokenReceiver: TREASURY, + }, + vALPACA_DeFi: { + borrowCap: "1750000", + supplyCap: "2500000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "5189", + vTokenReceiver: TREASURY, + }, + vUSDT_DeFi: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + vUSDD_DeFi: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + vANKR_DeFi: { + borrowCap: "6656161", + supplyCap: "9508802", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "500000", + vTokenReceiver: TREASURY, + }, + + // Pool GameFi + vRACA_GameFi: { + borrowCap: "2800000000", + supplyCap: "4000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "175000000", + vTokenReceiver: TREASURY, + }, + vFLOKI_GameFi: { + borrowCap: "28000000000", + supplyCap: "40000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "1512860000", + vTokenReceiver: TREASURY, + }, + vUSDT_GameFi: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + vUSDD_GameFi: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + + //Pool Liquid Staked BNB + vankrBNB_LiquidStakedBNB: { + borrowCap: "5600", + supplyCap: "8000", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "40", + vTokenReceiver: TREASURY, + }, + vBNBx_LiquidStakedBNB: { + borrowCap: "1272", + supplyCap: "1818", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "39.36", + vTokenReceiver: TREASURY, + }, + vstkBNB_LiquidStakedBNB: { + borrowCap: "378", + supplyCap: "540", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "40", + vTokenReceiver: TREASURY, + }, + vWBNB_LiquidStakedBNB: { + borrowCap: "56000", + supplyCap: "80000", + collateralFactor: "0.45", + liquidationThreshold: "0.5", + reserveFactor: "0.25", + initialSupply: "0.1", + vTokenReceiver: TREASURY, + }, + vUSDT_LiquidStakedBNB: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + vUSDD_LiquidStakedBNB: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + + // Pool Tron + vBTT_Tron: { + borrowCap: "1050000000000", + supplyCap: "1500000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "16753000000", + vTokenReceiver: TREASURY, + }, + vWIN_Tron: { + borrowCap: "2100000000", + supplyCap: "3000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "134000000", + vTokenReceiver: TREASURY, + }, + vTRX_Tron: { + borrowCap: "7700000", + supplyCap: "11000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "129000", + vTokenReceiver: TREASURY, + }, + vUSDT_Tron: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, + vUSDD_Tron: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: TREASURY, + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: [ + "vBIFI_DeFi", + "vBSW_DeFi", + "vALPACA_DeFi", + "vANKR_DeFi", + "vRACA_GameFi", + "vFLOKI_GameFi", + "vankrBNB_LiquidStakedBNB", + "vBNBx_LiquidStakedBNB", + "vstkBNB_LiquidStakedBNB", + "vWBNB_LiquidStakedBNB", + "vBTT_Tron", + "vWIN_Tron", + "vTRX_Tron", + ], + kink: "0.5", + base: "0.02", + multiplier: "0.2", + jump: "3", + }, + { + vTokens: [ + "vUSDT_DeFi", + "vUSDD_DeFi", + "vUSDT_GameFi", + "vUSDD_GameFi", + "vUSDT_LiquidStakedBNB", + "vUSDD_LiquidStakedBNB", + "vUSDT_Tron", + "vUSDD_Tron", + ], + kink: "0.6", + base: "0.03", + multiplier: "0.1", + jump: "2.5", + }, +]; + +forking(31152370, () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, POOL_REGISTRY); + for (const [symbol, feed] of Object.entries(chainlinkFeeds) as [UnderlyingSymbol, string][]) { + await setMaxStalePeriodInChainlinkOracle(CHAINLINK_ORACLE, tokens[symbol], feed, NORMAL_TIMELOCK); + } + for (const symbol of binanceFeeds) { + await setMaxStalePeriodInBinanceOracle(BINANCE_ORACLE, symbol); + } + }); + + describe("Contracts setup", () => { + const checkVToken = ( + vTokenAddress: string, + { name, symbol, decimals, underlying, exchangeRate, comptroller }: VTokenState, + ) => { + describe(symbol, () => { + let vToken: Contract; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokenAddress); + }); + + it(`should have name = "${name}"`, async () => { + expect(await vToken.name()).to.equal(name); + }); + + it(`should have symbol = "${symbol}"`, async () => { + expect(await vToken.symbol()).to.equal(symbol); + }); + + it(`should have ${decimals.toString()} decimals`, async () => { + expect(await vToken.decimals()).to.equal(decimals); + }); + + it(`should have underlying = "${underlying}"`, async () => { + expect(await vToken.underlying()).to.equal(underlying); + }); + + it(`should have initial exchange rate of ${exchangeRate.toString()}`, async () => { + expect(await vToken.exchangeRateStored()).to.equal(exchangeRate); + }); + + it("should have the correct Comptroller", async () => { + expect(await vToken.comptroller()).to.equal(comptroller); + }); + }); + }; + + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testVip("VIP-136 IL phase 2", vip136Testnet()); + + describe("Post-VIP state", () => { + 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 DeFi pool in PoolRegistry", async () => { + const pool = registeredPools[1]; + expect(pool.name).to.equal("DeFi"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.DeFi.comptroller); + }); + + it("should register GameFi pool in PoolRegistry", async () => { + const pool = registeredPools[2]; + expect(pool.name).to.equal("GameFi"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.GameFi.comptroller); + }); + + it("should register Liquid Staked BNB pool in PoolRegistry", async () => { + const pool = registeredPools[3]; + expect(pool.name).to.equal("Liquid Staked BNB"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.LiquidStakedBNB.comptroller); + }); + + it("should register Tron pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Tron"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.Tron.comptroller); + }); + + it("should register DeFi pool vTokens in DeFi pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.DeFi.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(6); + expect(poolVTokens).to.include(vTokens.vALPACA_DeFi); + expect(poolVTokens).to.include(vTokens.vANKR_DeFi); + expect(poolVTokens).to.include(vTokens.vBIFI_DeFi); + expect(poolVTokens).to.include(vTokens.vUSDT_DeFi); + expect(poolVTokens).to.include(vTokens.vBSW_DeFi); + expect(poolVTokens).to.include(vTokens.vUSDD_DeFi); + }); + + it("should register GameFi pool vTokens in GameFi pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.GameFi.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(4); + expect(poolVTokens).to.include(vTokens.vFLOKI_GameFi); + expect(poolVTokens).to.include(vTokens.vRACA_GameFi); + expect(poolVTokens).to.include(vTokens.vUSDD_GameFi); + expect(poolVTokens).to.include(vTokens.vUSDT_GameFi); + }); + + it("should register Liquid Staked BNB pool vTokens in Liquid Staked BNB pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.LiquidStakedBNB.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(6); + expect(poolVTokens).to.include(vTokens.vBNBx_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vUSDD_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vUSDT_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vWBNB_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vankrBNB_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vstkBNB_LiquidStakedBNB); + }); + + it("should register Tron pool vTokens in Tron pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Tron.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(5); + expect(poolVTokens).to.include(vTokens.vBTT_Tron); + expect(poolVTokens).to.include(vTokens.vTRX_Tron); + expect(poolVTokens).to.include(vTokens.vUSDD_Tron); + expect(poolVTokens).to.include(vTokens.vUSDT_Tron); + expect(poolVTokens).to.include(vTokens.vWIN_Tron); + }); + + 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 Timelock`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(NORMAL_TIMELOCK); + }); + } + }); + + 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 to 0.05`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal(parseUnits("0.05", 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("Pool configuration", () => { + for (const [name, pool] of Object.entries(pools) as [PoolId, PoolContracts][]) { + describe(`${name} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pool.comptroller); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(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.1", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.1", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = NormalTimelock", async () => { + expect(await comptroller.owner()).to.equal(NORMAL_TIMELOCK); + }); + }); + + describe(`${name} SwapRouter`, () => { + let swapRouter: Contract; + + before(async () => { + swapRouter = await ethers.getContractAt(SWAP_ROUTER_ABI, pool.swapRouter); + }); + + it(`should have WBNB = ${tokens.WBNB}`, async () => { + expect(await swapRouter.WBNB()).to.equal(tokens.WBNB); + }); + + it(`should have vBNB = core pool vBNB (${VBNB_CORE_POOL})`, async () => { + expect(await swapRouter.vBNBAddress()).to.equal(VBNB_CORE_POOL); + }); + + it(`should have comptroller = Comptroller_${name}`, async () => { + expect(await swapRouter.comptrollerAddress()).to.equal(pool.comptroller); + }); + + it("should have owner = NormalTimelock", async () => { + expect(await swapRouter.owner()).to.equal(NORMAL_TIMELOCK); + }); + }); + } + }); + }); + + describe("Interest rate models", () => { + const checkInterestRate = ( + vTokenAddress: string, + symbol: string, + { + base, + multiplier, + jump, + kink, + }: { + base: string; + multiplier: string; + jump: string; + kink: string; + }, + ) => { + describe(`${symbol} interest rate model`, () => { + const BLOCKS_PER_YEAR = 10512000; + let rateModel: Contract; + + before(async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokenAddress); + rateModel = await ethers.getContractAt(RATE_MODEL_ABI, await vToken.interestRateModel()); + }); + + it(`should have base = ${base}`, async () => { + const basePerBlock = parseUnits(base, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.baseRatePerBlock()).to.equal(basePerBlock); + }); + + it(`should have jump = ${jump}`, async () => { + const jumpPerBlock = parseUnits(jump, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.jumpMultiplierPerBlock()).to.equal(jumpPerBlock); + }); + + it(`should have multiplier = ${multiplier}`, async () => { + const multiplierPerBlock = parseUnits(multiplier, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.multiplierPerBlock()).to.equal(multiplierPerBlock); + }); + + it(`should have kink = ${kink}`, async () => { + expect(await rateModel.kink()).to.equal(parseUnits(kink, 18)); + }); + }); + }; + + describe("Interest rate models", () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate(vTokens[symbol], symbol, { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }); + } + } + }); + }); +}); diff --git a/simulations/vip-136/vip-136/abi/comptroller.json b/simulations/vip-136/vip-136/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-136/vip-136/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-136/vip-136/abi/erc20.json b/simulations/vip-136/vip-136/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-136/vip-136/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-136/vip-136/abi/poolRegistry.json b/simulations/vip-136/vip-136/abi/poolRegistry.json new file mode 100644 index 000000000..2d0268aeb --- /dev/null +++ b/simulations/vip-136/vip-136/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-136/vip-136/abi/rateModel.json b/simulations/vip-136/vip-136/abi/rateModel.json new file mode 100644 index 000000000..8c04a8527 --- /dev/null +++ b/simulations/vip-136/vip-136/abi/rateModel.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [ + { "internalType": "uint256", "name": "baseRatePerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "multiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "jumpMultiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "kink_", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "baseRatePerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "multiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "jumpMultiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "kink", "type": "uint256" } + ], + "name": "NewInterestParams", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "baseRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "blocksPerYear", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "getBorrowRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" }, + { "internalType": "uint256", "name": "reserveFactorMantissa", "type": "uint256" } + ], + "name": "getSupplyRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isInterestRateModel", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "jumpMultiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kink", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "multiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "utilizationRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "pure", + "type": "function" + } +] diff --git a/simulations/vip-136/vip-136/abi/swapRouter.json b/simulations/vip-136/vip-136/abi/swapRouter.json new file mode 100644 index 000000000..17c9e5362 --- /dev/null +++ b/simulations/vip-136/vip-136/abi/swapRouter.json @@ -0,0 +1,1697 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "WBNB_", + "type": "address" + }, + { + "internalType": "address", + "name": "factory_", + "type": "address" + }, + { + "internalType": "address", + "name": "_comptrollerAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_vBNBAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountMax", + "type": "uint256" + } + ], + "name": "ExcessiveInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "IdenticalAddresses", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountIntMax", + "type": "uint256" + } + ], + "name": "InputAmountAboveMaximum", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sweepAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidPath", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + } + ], + "name": "OutputAmountBelowMinimum", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrantCheck", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "RepayError", + "type": "error" + }, + { + "inputs": [], + "name": "SafeApproveFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferBNBFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferFailed", + "type": "error" + }, + { + "inputs": [], + "name": "SafeTransferFromFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "SupplyError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + } + ], + "name": "SwapAmountLessThanAmountOutMin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestemp", + "type": "uint256" + } + ], + "name": "SwapDeadlineExpire", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "VTokenNotListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying", + "type": "address" + } + ], + "name": "VTokenUnderlyingInvalid", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedAdddress", + "type": "address" + }, + { + "internalType": "address", + "name": "passedAddress", + "type": "address" + } + ], + "name": "WrongAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapBnbForTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapBnbForTokensAtSupportingFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapTokensForBnb", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapTokensForBnbAtSupportingFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "indexed": true, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "SwapTokensForTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "swapper", + "type": "address" + }, + { + "indexed": true, + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "SwapTokensForTokensAtSupportingFee", + "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": "sweepAmount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "VBNBAddressUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveOut", + "type": "uint256" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsIn", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + } + ], + "name": "getAmountsOut", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "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": [ + { + "internalType": "uint256", + "name": "amountA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveA", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "reserveB", + "type": "uint256" + } + ], + "name": "quote", + "outputs": [ + { + "internalType": "uint256", + "name": "amountB", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vBNBAddress", + "type": "address" + } + ], + "name": "setVBNBAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokensAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForExactTokensAndSupply", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapBNBForFullTokenDebtAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndRepay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndSupply", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactBNBForTokensAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNB", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForBNBAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndRepayAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAndSupplyAtSupportingFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMin", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapExactTokensForTokensAtSupportingFee", + "outputs": [ + { + "internalType": "uint256", + "name": "swapAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNB", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNBAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactBNBAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokens", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokensAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForExactTokensAndSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForFullBNBDebtAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountInMax", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "path", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swapTokensForFullTokenDebtAndRepay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sweepAmount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNBAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/simulations/vip-136/vip-136/abi/vToken.json b/simulations/vip-136/vip-136/abi/vToken.json new file mode 100644 index 000000000..a413ca84d --- /dev/null +++ b/simulations/vip-136/vip-136/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-136/vip-136/simulations.ts b/simulations/vip-136/vip-136/simulations.ts new file mode 100644 index 000000000..78d8466c6 --- /dev/null +++ b/simulations/vip-136/vip-136/simulations.ts @@ -0,0 +1,910 @@ +import { expect } from "chai"; +import { BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseEther, parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; + +import { + initMainnetUser, + setMaxStalePeriodInBinanceOracle, + setMaxStalePeriodInChainlinkOracle, +} from "../../../src/utils"; +import { forking, testVip } from "../../../src/vip-framework"; +import { vip136 } from "../../../vips/vip-136/vip-136"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import RATE_MODEL_ABI from "./abi/rateModel.json"; +import SWAP_ROUTER_ABI from "./abi/swapRouter.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const RESILIENT_ORACLE = "0x6592b5DE802159F3E74B2486b091D11a8256ab8A"; +const CHAINLINK_ORACLE = "0x1B2103441A0A108daD8848D8F5d790e4D402921F"; +const BINANCE_ORACLE = "0x594810b741d136f1960141C0d8Fb4a91bE78A820"; +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; +const POOL_REGISTRY = "0x9F7b01A536aFA00EF10310A162877fd792cD0666"; +const SWAP_ROUTER_STABLECOINS = "0xBBd8E2b5d69fcE9Aaa599c50F0f0960AA58B32aA"; + +const VBNB_CORE_POOL = "0xA07c5b74C9B40447a954e1466938b865b6BBea36"; + +type PoolId = "DeFi" | "GameFi" | "LiquidStakedBNB" | "Tron"; + +interface PoolContracts { + comptroller: string; + swapRouter: string; +} + +const pools: { [key in PoolId]: PoolContracts } = { + DeFi: { + comptroller: "0x3344417c9360b963ca93A4e8305361AEde340Ab9", + swapRouter: "0x47bEe99BD8Cf5D8d7e815e2D2a3E2985CBCcC04b", + }, + GameFi: { + comptroller: "0x1b43ea8622e76627B81665B1eCeBB4867566B963", + swapRouter: "0x9B15462a79D0948BdDF679E0E5a9841C44aAFB7A", + }, + LiquidStakedBNB: { + comptroller: "0xd933909A4a2b7A4638903028f44D1d38ce27c352", + swapRouter: "0x5f0ce69Aa564468492e860e8083BB001e4eb8d56", + }, + Tron: { + comptroller: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", + swapRouter: "0xacD270Ed7DFd4466Bd931d84fe5B904080E28Bfc", + }, +}; + +type UnderlyingSymbol = + | "USDT" + | "USDD" + | "BIFI" + | "BSW" + | "ALPACA" + | "ANKR" + | "RACA" + | "FLOKI" + | "ankrBNB" + | "BNBx" + | "stkBNB" + | "WBNB" + | "BTT" + | "WIN" + | "TRX"; + +type VTokenSymbol = + | "vALPACA_DeFi" + | "vANKR_DeFi" + | "vBIFI_DeFi" + | "vUSDT_DeFi" + | "vBSW_DeFi" + | "vUSDD_DeFi" + | "vFLOKI_GameFi" + | "vRACA_GameFi" + | "vUSDD_GameFi" + | "vUSDT_GameFi" + | "vBNBx_LiquidStakedBNB" + | "vWBNB_LiquidStakedBNB" + | "vankrBNB_LiquidStakedBNB" + | "vstkBNB_LiquidStakedBNB" + | "vBTT_Tron" + | "vTRX_Tron" + | "vUSDD_Tron" + | "vUSDT_Tron" + | "vWIN_Tron"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vALPACA_DeFi: "0x02c5Fb0F26761093D297165e902e96D08576D344", + vANKR_DeFi: "0x19CE11C8817a1828D1d357DFBF62dCf5b0B2A362", + vBIFI_DeFi: "0xC718c51958d3fd44f5F9580c9fFAC2F89815C909", + vUSDT_DeFi: "0x1D8bBDE12B6b34140604E18e9f9c6e14deC16854", + vBSW_DeFi: "0x8f657dFD3a1354DEB4545765fE6840cc54AFd379", + vUSDD_DeFi: "0xA615467caE6B9E0bb98BC04B4411d9296fd1dFa0", + + vFLOKI_GameFi: "0xc353B7a1E13dDba393B5E120D4169Da7185aA2cb", + vRACA_GameFi: "0xE5FE5527A5b76C75eedE77FdFA6B80D52444A465", + vUSDD_GameFi: "0x9f2FD23bd0A5E08C5f2b9DD6CF9C96Bfb5fA515C", + vUSDT_GameFi: "0x4978591f17670A846137d9d613e333C38dc68A37", + + vBNBx_LiquidStakedBNB: "0x5E21bF67a6af41c74C1773E4b473ca5ce8fd3791", + vWBNB_LiquidStakedBNB: "0xe10E80B7FD3a29fE46E16C30CC8F4dd938B742e2", + vankrBNB_LiquidStakedBNB: "0xBfe25459BA784e70E2D7a718Be99a1f3521cA17f", + vstkBNB_LiquidStakedBNB: "0xcc5D9e502574cda17215E70bC0B4546663785227", + + vBTT_Tron: "0x49c26e12959345472E2Fd95E5f79F8381058d3Ee", + vTRX_Tron: "0x836beb2cB723C498136e1119248436A645845F4E", + vUSDD_Tron: "0xf1da185CCe5BeD1BeBbb3007Ef738Ea4224025F7", + vUSDT_Tron: "0x281E5378f99A4bc55b295ABc0A3E7eD32Deba059", + vWIN_Tron: "0xb114cfA615c828D88021a41bFc524B800E64a9D5", +}; + +const tokens = { + USDT: "0x55d398326f99059fF775485246999027B3197955", + USDD: "0xd17479997F34dd9156Deef8F95A52D81D265be9c", + + BIFI: "0xCa3F508B8e4Dd382eE878A314789373D80A5190A", + BSW: "0x965F527D9159dCe6288a2219DB51fc6Eef120dD1", + ALPACA: "0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F", + ANKR: "0xf307910A4c7bbc79691fD374889b36d8531B08e3", + + RACA: "0x12BB890508c125661E03b09EC06E404bc9289040", + FLOKI: "0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", + + ankrBNB: "0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", + BNBx: "0x1bdd3Cf7F79cfB8EdbB955f20ad99211551BA275", + stkBNB: "0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", + WBNB: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + + BTT: "0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", + WIN: "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + TRX: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: BigNumberish; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + // DeFi pool + vALPACA_DeFi: { + name: "Venus ALPACA (DeFi)", + symbol: "vALPACA_DeFi", + decimals: 8, + underlying: tokens.ALPACA, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vANKR_DeFi: { + name: "Venus ANKR (DeFi)", + symbol: "vANKR_DeFi", + decimals: 8, + underlying: tokens.ANKR, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vBIFI_DeFi: { + name: "Venus BIFI (DeFi)", + symbol: "vBIFI_DeFi", + decimals: 8, + underlying: tokens.BIFI, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vUSDT_DeFi: { + name: "Venus USDT (DeFi)", + symbol: "vUSDT_DeFi", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vBSW_DeFi: { + name: "Venus BSW (DeFi)", + symbol: "vBSW_DeFi", + decimals: 8, + underlying: tokens.BSW, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + vUSDD_DeFi: { + name: "Venus USDD (DeFi)", + symbol: "vUSDD_DeFi", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.DeFi.comptroller, + }, + + // GameFi pool + vFLOKI_GameFi: { + name: "Venus FLOKI (GameFi)", + symbol: "vFLOKI_GameFi", + decimals: 8, + underlying: tokens.FLOKI, + exchangeRate: parseUnits("1", 19), // 1e8 * 1e19 / 1e18 = 1e9 (9 decimals) + comptroller: pools.GameFi.comptroller, + }, + vRACA_GameFi: { + name: "Venus RACA (GameFi)", + symbol: "vRACA_GameFi", + decimals: 8, + underlying: tokens.RACA, + exchangeRate: parseUnits("1", 28), + comptroller: pools.GameFi.comptroller, + }, + vUSDT_GameFi: { + name: "Venus USDT (GameFi)", + symbol: "vUSDT_GameFi", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 28), + comptroller: pools.GameFi.comptroller, + }, + vUSDD_GameFi: { + name: "Venus USDD (GameFi)", + symbol: "vUSDD_GameFi", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.GameFi.comptroller, + }, + + // Liquid Staked BNB pool + vBNBx_LiquidStakedBNB: { + name: "Venus BNBx (Liquid Staked BNB)", + symbol: "vBNBx_LiquidStakedBNB", + decimals: 8, + underlying: tokens.BNBx, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vWBNB_LiquidStakedBNB: { + name: "Venus WBNB (Liquid Staked BNB)", + symbol: "vWBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.WBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vankrBNB_LiquidStakedBNB: { + name: "Venus ankrBNB (Liquid Staked BNB)", + symbol: "vankrBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.ankrBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + vstkBNB_LiquidStakedBNB: { + name: "Venus stkBNB (Liquid Staked BNB)", + symbol: "vstkBNB_LiquidStakedBNB", + decimals: 8, + underlying: tokens.stkBNB, + exchangeRate: parseUnits("1", 28), + comptroller: pools.LiquidStakedBNB.comptroller, + }, + + // Tron pool + vBTT_Tron: { + name: "Venus BTT (Tron)", + symbol: "vBTT_Tron", + decimals: 8, + underlying: tokens.BTT, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, + vTRX_Tron: { + name: "Venus TRX (Tron)", + symbol: "vTRX_Tron", + decimals: 8, + underlying: tokens.TRX, + exchangeRate: parseUnits("1", 16), // 1e8 * 1e16 / 1e18 = 1e6 (6 decimals) + comptroller: pools.Tron.comptroller, + }, + vUSDT_Tron: { + name: "Venus USDT (Tron)", + symbol: "vUSDT_Tron", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, + vUSDD_Tron: { + name: "Venus USDD (Tron)", + symbol: "vUSDD_Tron", + decimals: 8, + underlying: tokens.USDD, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, + vWIN_Tron: { + name: "Venus WIN (Tron)", + symbol: "vWIN_Tron", + decimals: 8, + underlying: tokens.WIN, + exchangeRate: parseUnits("1", 28), + comptroller: pools.Tron.comptroller, + }, +}; + +const binanceFeeds: UnderlyingSymbol[] = ["USDD", "ANKR", "RACA", "FLOKI", "BTT", "stkBNB", "ankrBNB"]; + +const chainlinkFeeds: { [key in UnderlyingSymbol]?: string } = { + BIFI: "0xab827b69dacd586a37e80a7d552a4395d576e645", + BSW: "0x08e70777b982a58d23d05e3d7714f44837c06a21", + ALPACA: "0xe0073b60833249ffd1bb2af809112c2fbf221df6", + BNBx: "0xc4429B539397a3166eF3ef132c29e34715a3ABb4", + WBNB: "0x0567f2323251f0aab15c8dfb1967e4e8a7d42aee", + WIN: "0x9e7377e194e41d63795907c92c3eb351a2eb0233", + TRX: "0xf4c5e535756d11994fcbb12ba8add0192d9b88be", + USDT: "0xb97ad0e74fa7d920791e90258a6e2085088b4320", +}; + +const treasuries = { + "Beefy DAO Treasury": "0x7C780b8A63eE9B7d0F985E8a922Be38a1F7B2141", + "Biswap Team": "0x109E8083a64c7DedE513e8b580c5b08B96f9cE73", + "Alpaca Team": "0xAD9CADe20100B8b945da48e1bCbd805C38d8bE77", + "Venus Treasury": "0xf322942f644a996a617bd29c16bd7d231d9f35e9", + "Tron Ecosystem": "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "ANKR Team": "0xAE1c38847Fb90A13a2a1D7E5552cCD80c62C6508", + "RACA Team": "0x6Ee74536B3Ff10Ff639aa781B7220121287F6Fa5", + "FLOKI Treasury": "0x17e98a24f992BB7bcd62d6722d714A3C74814B94", + "Stader Treasury": "0xF0348E1748FCD45020151C097D234DbbD5730BE7", + "pStake Treasury": "0xccc022502d6c65e1166fd34147040f05880f7972", +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + // DeFi + vBIFI_DeFi: { + borrowCap: "266", + supplyCap: "379", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "50", + vTokenReceiver: treasuries["Beefy DAO Treasury"], + }, + vBSW_DeFi: { + borrowCap: "10500000", + supplyCap: "15000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "475750", + vTokenReceiver: treasuries["Biswap Team"], + }, + vALPACA_DeFi: { + borrowCap: "1750000", + supplyCap: "2500000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "5189", + vTokenReceiver: treasuries["Alpaca Team"], + }, + vUSDT_DeFi: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: treasuries["Venus Treasury"], + }, + vUSDD_DeFi: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, + vANKR_DeFi: { + borrowCap: "6656161", + supplyCap: "9508802", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "500000", + vTokenReceiver: treasuries["ANKR Team"], + }, + + // Pool GameFi + vRACA_GameFi: { + borrowCap: "2800000000", + supplyCap: "4000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "175000000", + vTokenReceiver: treasuries["RACA Team"], + }, + vFLOKI_GameFi: { + borrowCap: "28000000000", + supplyCap: "40000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "1512860000", + vTokenReceiver: treasuries["FLOKI Treasury"], + }, + vUSDT_GameFi: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: treasuries["Venus Treasury"], + }, + vUSDD_GameFi: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, + + //Pool Liquid Staked BNB + vankrBNB_LiquidStakedBNB: { + borrowCap: "5600", + supplyCap: "8000", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "40", + vTokenReceiver: treasuries["ANKR Team"], + }, + vBNBx_LiquidStakedBNB: { + borrowCap: "1272", + supplyCap: "1818", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "39.36", + vTokenReceiver: treasuries["Stader Treasury"], + }, + vstkBNB_LiquidStakedBNB: { + borrowCap: "378", + supplyCap: "540", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "40", + vTokenReceiver: treasuries["pStake Treasury"], + }, + vWBNB_LiquidStakedBNB: { + borrowCap: "56000", + supplyCap: "80000", + collateralFactor: "0.45", + liquidationThreshold: "0.5", + reserveFactor: "0.25", + initialSupply: "35", + vTokenReceiver: treasuries["Venus Treasury"], + }, + + // Pool Tron + vBTT_Tron: { + borrowCap: "1050000000000", + supplyCap: "1500000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "16753000000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, + vWIN_Tron: { + borrowCap: "2100000000", + supplyCap: "3000000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "134000000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, + vTRX_Tron: { + borrowCap: "7700000", + supplyCap: "11000000", + collateralFactor: "0.25", + liquidationThreshold: "0.3", + reserveFactor: "0.25", + initialSupply: "129000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, + vUSDT_Tron: { + borrowCap: "14880000", + supplyCap: "18600000", + collateralFactor: "0.8", + liquidationThreshold: "0.88", + reserveFactor: "0.1", + initialSupply: "10000", + vTokenReceiver: treasuries["Venus Treasury"], + }, + vUSDD_Tron: { + borrowCap: "1600000", + supplyCap: "2000000", + collateralFactor: "0.65", + liquidationThreshold: "0.7", + reserveFactor: "0.1", + initialSupply: "20000", + vTokenReceiver: treasuries["Tron Ecosystem"], + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: [ + "vBIFI_DeFi", + "vBSW_DeFi", + "vALPACA_DeFi", + "vANKR_DeFi", + "vRACA_GameFi", + "vFLOKI_GameFi", + "vankrBNB_LiquidStakedBNB", + "vBNBx_LiquidStakedBNB", + "vstkBNB_LiquidStakedBNB", + "vWBNB_LiquidStakedBNB", + "vBTT_Tron", + "vWIN_Tron", + "vTRX_Tron", + ], + kink: "0.5", + base: "0.02", + multiplier: "0.2", + jump: "3", + }, + { + vTokens: ["vUSDT_DeFi", "vUSDD_DeFi", "vUSDT_GameFi", "vUSDD_GameFi", "vUSDT_Tron", "vUSDD_Tron"], + kink: "0.6", + base: "0.03", + multiplier: "0.1", + jump: "2.5", + }, +]; + +forking(29562000, () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, POOL_REGISTRY); + for (const [symbol, feed] of Object.entries(chainlinkFeeds) as [UnderlyingSymbol, string][]) { + await setMaxStalePeriodInChainlinkOracle(CHAINLINK_ORACLE, tokens[symbol], feed, NORMAL_TIMELOCK); + } + for (const symbol of binanceFeeds) { + await setMaxStalePeriodInBinanceOracle(BINANCE_ORACLE, symbol); + } + const admin = await initMainnetUser("0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B", parseEther("1")); + const governorAbi = ["function _setProposalMaxOperations(uint256) external"]; + const governor = await ethers.getContractAt(governorAbi, "0x2d56dC077072B53571b8252008C60e945108c75a"); + await governor.connect(admin)._setProposalMaxOperations(200); + }); + + describe("Contracts setup", () => { + const checkVToken = ( + vTokenAddress: string, + { name, symbol, decimals, underlying, exchangeRate, comptroller }: VTokenState, + ) => { + describe(symbol, () => { + let vToken: Contract; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokenAddress); + }); + + it(`should have name = "${name}"`, async () => { + expect(await vToken.name()).to.equal(name); + }); + + it(`should have symbol = "${symbol}"`, async () => { + expect(await vToken.symbol()).to.equal(symbol); + }); + + it(`should have ${decimals.toString()} decimals`, async () => { + expect(await vToken.decimals()).to.equal(decimals); + }); + + it(`should have underlying = "${underlying}"`, async () => { + expect(await vToken.underlying()).to.equal(underlying); + }); + + it(`should have initial exchange rate of ${exchangeRate.toString()}`, async () => { + expect(await vToken.exchangeRateStored()).to.equal(exchangeRate); + }); + + it("should have the correct Comptroller", async () => { + expect(await vToken.comptroller()).to.equal(comptroller); + }); + }); + }; + + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + testVip("VIP-136 IL phase 2", vip136()); + + describe("Post-VIP state", () => { + 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 DeFi pool in PoolRegistry", async () => { + const pool = registeredPools[1]; + expect(pool.name).to.equal("DeFi"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.DeFi.comptroller); + }); + + it("should register GameFi pool in PoolRegistry", async () => { + const pool = registeredPools[2]; + expect(pool.name).to.equal("GameFi"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.GameFi.comptroller); + }); + + it("should register Liquid Staked BNB pool in PoolRegistry", async () => { + const pool = registeredPools[3]; + expect(pool.name).to.equal("Liquid Staked BNB"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.LiquidStakedBNB.comptroller); + }); + + it("should register Tron pool in PoolRegistry", async () => { + const pool = registeredPools[4]; + expect(pool.name).to.equal("Tron"); + expect(pool.creator).to.equal(NORMAL_TIMELOCK); + expect(pool.comptroller).to.equal(pools.Tron.comptroller); + }); + + it("should register DeFi pool vTokens in DeFi pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.DeFi.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(6); + expect(poolVTokens).to.include(vTokens.vALPACA_DeFi); + expect(poolVTokens).to.include(vTokens.vANKR_DeFi); + expect(poolVTokens).to.include(vTokens.vBIFI_DeFi); + expect(poolVTokens).to.include(vTokens.vUSDT_DeFi); + expect(poolVTokens).to.include(vTokens.vBSW_DeFi); + expect(poolVTokens).to.include(vTokens.vUSDD_DeFi); + }); + + it("should register GameFi pool vTokens in GameFi pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.GameFi.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(4); + expect(poolVTokens).to.include(vTokens.vFLOKI_GameFi); + expect(poolVTokens).to.include(vTokens.vRACA_GameFi); + expect(poolVTokens).to.include(vTokens.vUSDD_GameFi); + expect(poolVTokens).to.include(vTokens.vUSDT_GameFi); + }); + + it("should register Liquid Staked BNB pool vTokens in Liquid Staked BNB pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.LiquidStakedBNB.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(4); + expect(poolVTokens).to.include(vTokens.vBNBx_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vWBNB_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vankrBNB_LiquidStakedBNB); + expect(poolVTokens).to.include(vTokens.vstkBNB_LiquidStakedBNB); + }); + + it("should register Tron pool vTokens in Tron pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Tron.comptroller); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(5); + expect(poolVTokens).to.include(vTokens.vBTT_Tron); + expect(poolVTokens).to.include(vTokens.vTRX_Tron); + expect(poolVTokens).to.include(vTokens.vUSDD_Tron); + expect(poolVTokens).to.include(vTokens.vUSDT_Tron); + expect(poolVTokens).to.include(vTokens.vWIN_Tron); + }); + + 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 Timelock`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(NORMAL_TIMELOCK); + }); + } + }); + + 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 to 0.05`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal(parseUnits("0.05", 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("Pool configuration", () => { + it("should accept ownerdship over Stablecoins SwapRouter", async () => { + const swapRouter = await ethers.getContractAt(SWAP_ROUTER_ABI, SWAP_ROUTER_STABLECOINS); + expect(await swapRouter.owner()).to.equal(NORMAL_TIMELOCK); + }); + + for (const [name, pool] of Object.entries(pools) as [PoolId, PoolContracts][]) { + describe(`${name} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pool.comptroller); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(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.1", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.1", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = NormalTimelock", async () => { + expect(await comptroller.owner()).to.equal(NORMAL_TIMELOCK); + }); + }); + + describe(`${name} SwapRouter`, () => { + let swapRouter: Contract; + + before(async () => { + swapRouter = await ethers.getContractAt(SWAP_ROUTER_ABI, pool.swapRouter); + }); + + it(`should have WBNB = ${tokens.WBNB}`, async () => { + expect(await swapRouter.WBNB()).to.equal(tokens.WBNB); + }); + + it(`should have vBNB = core pool vBNB (${VBNB_CORE_POOL})`, async () => { + expect(await swapRouter.vBNBAddress()).to.equal(VBNB_CORE_POOL); + }); + + it(`should have comptroller = Comptroller_${name}`, async () => { + expect(await swapRouter.comptrollerAddress()).to.equal(pool.comptroller); + }); + + it("should have owner = NormalTimelock", async () => { + expect(await swapRouter.owner()).to.equal(NORMAL_TIMELOCK); + }); + }); + } + }); + }); + + describe("Interest rate models", () => { + const checkInterestRate = ( + vTokenAddress: string, + symbol: string, + { + base, + multiplier, + jump, + kink, + }: { + base: string; + multiplier: string; + jump: string; + kink: string; + }, + ) => { + describe(`${symbol} interest rate model`, () => { + const BLOCKS_PER_YEAR = 10512000; + let rateModel: Contract; + + before(async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokenAddress); + rateModel = await ethers.getContractAt(RATE_MODEL_ABI, await vToken.interestRateModel()); + }); + + it(`should have base = ${base}`, async () => { + const basePerBlock = parseUnits(base, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.baseRatePerBlock()).to.equal(basePerBlock); + }); + + it(`should have jump = ${jump}`, async () => { + const jumpPerBlock = parseUnits(jump, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.jumpMultiplierPerBlock()).to.equal(jumpPerBlock); + }); + + it(`should have multiplier = ${multiplier}`, async () => { + const multiplierPerBlock = parseUnits(multiplier, 18).div(BLOCKS_PER_YEAR); + expect(await rateModel.multiplierPerBlock()).to.equal(multiplierPerBlock); + }); + + it(`should have kink = ${kink}`, async () => { + expect(await rateModel.kink()).to.equal(parseUnits(kink, 18)); + }); + }); + }; + + describe("Interest rate models", () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate(vTokens[symbol], symbol, { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }); + } + } + }); + }); +}); diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index 3eb0d84e5..9e5ae716f 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -123,7 +123,7 @@ export const testVip = (description: string, proposal: Proposal, options: Testin await expect(governorProxy.connect(supporter).castVote(proposalId, 1)).to.emit(governorProxy, "VoteCast"); }); - it("should be queued sucessfully", async () => { + it("should be queued successfully", async () => { await mineUpTo((await ethers.provider.getBlockNumber()) + VOTING_PERIOD + 1); const tx = await governorProxy.connect(proposer).queue(proposalId); await tx.wait(); diff --git a/vips/vip-136/vip-136-testnet.ts b/vips/vip-136/vip-136-testnet.ts new file mode 100644 index 000000000..7ee465b2e --- /dev/null +++ b/vips/vip-136/vip-136-testnet.ts @@ -0,0 +1,785 @@ +import { ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const ANY_TARGET_CONTRACT = "0x0000000000000000000000000000000000000000"; + +const ACCESS_CONTROL_MANAGER = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; +const NORMAL_TIMELOCK = "0xce10739590001705F7FF231611ba4A48B2820327"; +const FAST_TRACK_TIMELOCK = "0x3CFf21b7AF8390fE68799D58727d3b4C25a83cb6"; +const CRITICAL_TIMELOCK = "0x23B893a7C45a5Eb8c8C062b9F32d0D2e43eD286D"; + +const RESILIENT_ORACLE = "0x3cD69251D04A28d887Ac14cbe2E14c52F3D57823"; +const POOL_REGISTRY = "0xC85491616Fa949E048F3aAc39fbf5b0703800667"; +const TREASURY = "0x8b293600c50d6fbdc6ed4251cc75ece29880276f"; + +const COMPTROLLER_DEFI = "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD"; +const COMPTROLLER_GAMEFI = "0x1F4f0989C51f12DAcacD4025018176711f3Bf289"; +const COMPTROLLER_LIQUID_STAKED_BNB = "0x596B11acAACF03217287939f88d63b51d3771704"; +const COMPTROLLER_TRON = "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97"; + +const SWAP_ROUTER_DEFI = "0x89Bc8dFe0Af08b60ec285071d133FCdfa9B3C08e"; +const SWAP_ROUTER_GAMEFI = "0x5D254Bc7c7f2670395B9E0716C21249083D41a4f"; +const SWAP_ROUTER_LIQUID_STAKED_BNB = "0xb16792E90d6478DaBbd0144e13f41CeA21ACE116"; +const SWAP_ROUTER_TRON = "0x1D8cA5AFB88F07489786A3d2E0FF50F3F9314d97"; + +const WBNB = "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd"; + +const commands = [ + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setReserveFactor(uint256)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setInterestRateModel(address)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "updateJumpRateModel(uint256,uint256,uint256,uint256)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setReserveFactor(uint256)", CRITICAL_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setInterestRateModel(address)", CRITICAL_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "updateJumpRateModel(uint256,uint256,uint256,uint256)", CRITICAL_TIMELOCK], + }, + { + target: COMPTROLLER_DEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_DEFI, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["DeFi", COMPTROLLER_DEFI, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_DEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_GAMEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_GAMEFI, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["GameFi", COMPTROLLER_GAMEFI, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_GAMEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_LIQUID_STAKED_BNB, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_LIQUID_STAKED_BNB, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: [ + "Liquid Staked BNB", + COMPTROLLER_LIQUID_STAKED_BNB, + "500000000000000000", + "1100000000000000000", + "100000000000000000000", + ], + value: "0", + }, + { + target: SWAP_ROUTER_LIQUID_STAKED_BNB, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_TRON, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_TRON, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["Tron", COMPTROLLER_TRON, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_TRON, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x5B662703775171c4212F2FBAdb7F92e64116c154", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "50000000000000000000"], + value: "0", + }, + { + target: "0x5B662703775171c4212F2FBAdb7F92e64116c154", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x5B662703775171c4212F2FBAdb7F92e64116c154", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "50000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xEF949287834Be010C1A5EDd757c385FB9b644E4A", + "250000000000000000", + "300000000000000000", + "50000000000000000000", + TREASURY, + "379000000000000000000", + "266000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "475750000000000000000000"], + value: "0", + }, + { + target: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "475750000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x5e68913fbbfb91af30366ab1B21324410b49a308", + "250000000000000000", + "300000000000000000", + "475750000000000000000000", + TREASURY, + "15000000000000000000000000", + "10500000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x6923189d91fdF62dBAe623a55273F1d20306D9f2", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "5189000000000000000000"], + value: "0", + }, + { + target: "0x6923189d91fdF62dBAe623a55273F1d20306D9f2", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x6923189d91fdF62dBAe623a55273F1d20306D9f2", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "5189000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xb7caC5Ef82cb7f9197ee184779bdc52c5490C02a", + "250000000000000000", + "300000000000000000", + "5189000000000000000000", + TREASURY, + "2500000000000000000000000", + "1750000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "40000000000"], + value: "0", + }, + { + target: "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750", + "800000000000000000", + "880000000000000000", + "10000000000", + TREASURY, + "18600000000000", + "14880000000000", + ], + ], + value: "0", + }, + { + target: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "40000000000000000000000"], + value: "0", + }, + { + target: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xa109DE0abaeefC521Ec29D89eA42E64F37A6882E", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + TREASURY, + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xe4a90EB942CF2DA7238e8F6cC9EF510c49FC8B4B", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "500000000000000000000000"], + value: "0", + }, + { + target: "0xe4a90EB942CF2DA7238e8F6cC9EF510c49FC8B4B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xe4a90EB942CF2DA7238e8F6cC9EF510c49FC8B4B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "500000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xb677e080148368EeeE70fA3865d07E92c6500174", + "250000000000000000", + "300000000000000000", + "500000000000000000000000", + TREASURY, + "9508802000000000000000000", + "6656161000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "175000000000000000000000000"], + value: "0", + }, + { + target: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "175000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x1958035231E125830bA5d17D168cEa07Bb42184a", + "250000000000000000", + "300000000000000000", + "175000000000000000000000000", + TREASURY, + "4000000000000000000000000000", + "2800000000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "1512860000000000000000000000"], + value: "0", + }, + { + target: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "1512860000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xef470AbC365F88e4582D8027172a392C473A5B53", + "250000000000000000", + "300000000000000000", + "1512860000000000000000000000", + TREASURY, + "40000000000000000000000000000", + "28000000000000000000000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x0bFE4e0B8A2a096A27e5B18b078d25be57C08634", + "800000000000000000", + "880000000000000000", + "10000000000", + TREASURY, + "18600000000000", + "14880000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xdeDf3B2bcF25d0023115fd71a0F8221C91C92B1a", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + TREASURY, + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "40000000000000000000"], + value: "0", + }, + { + target: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x57a664Dd7f1dE19545fEE9c86C949e3BF43d6D47", + "350000000000000000", + "400000000000000000", + "40000000000000000000", + TREASURY, + "8000000000000000000000", + "5600000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x327d6E6FAC0228070884e913263CFF9eFed4a2C8", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "39360000000000000000"], + value: "0", + }, + { + target: "0x327d6E6FAC0228070884e913263CFF9eFed4a2C8", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x327d6E6FAC0228070884e913263CFF9eFed4a2C8", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "39360000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x644A149853E5507AdF3e682218b8AC86cdD62951", + "350000000000000000", + "400000000000000000", + "39360000000000000000", + TREASURY, + "1818000000000000000000", + "1272000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "40000000000000000000"], + value: "0", + }, + { + target: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x75aa42c832a8911B77219DbeBABBB40040d16987", + "350000000000000000", + "400000000000000000", + "40000000000000000000", + TREASURY, + "540000000000000000000", + "378000000000000000000", + ], + ], + value: "0", + }, + { + target: WBNB, + signature: "deposit()", + params: [], + value: "100000000000000000", + }, + { + target: WBNB, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: WBNB, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "100000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x231dED0Dfc99634e52EE1a1329586bc970d773b3", + "450000000000000000", + "500000000000000000", + "100000000000000000", + TREASURY, + "80000000000000000000000", + "56000000000000000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x2197d02cC9cd1ad51317A0a85A656a0c82383A7c", + "800000000000000000", + "880000000000000000", + "10000000000", + TREASURY, + "18600000000000", + "14880000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xD5b20708d8f0FcA52cb609938D0594C4e32E5DaD", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + TREASURY, + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xE98344A7c691B200EF47c9b8829110087D832C64", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "16753000000000000000000000000"], + value: "0", + }, + { + target: "0xE98344A7c691B200EF47c9b8829110087D832C64", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xE98344A7c691B200EF47c9b8829110087D832C64", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "16753000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x47793540757c6E6D84155B33cd8D9535CFdb9334", + "250000000000000000", + "300000000000000000", + "16753000000000000000000000000", + TREASURY, + "1500000000000000000000000000000", + "1050000000000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "134000000000000000000000000"], + value: "0", + }, + { + target: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "134000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xEe543D5de2Dbb5b07675Fc72831A2f1812428393", + "250000000000000000", + "300000000000000000", + "134000000000000000000000000", + TREASURY, + "3000000000000000000000000000", + "2100000000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + signature: "transferFrom(address,address,uint256)", + params: ["0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706", NORMAL_TIMELOCK, "129000000000"], + value: "0", + }, + { + target: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "129000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x410286c43a525E1DCC7468a9B091C111C8324cd1", + "250000000000000000", + "300000000000000000", + "129000000000", + TREASURY, + "11000000000000", + "7700000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x712774CBFFCBD60e9825871CcEFF2F917442b2c3", + "800000000000000000", + "880000000000000000", + "10000000000", + TREASURY, + "18600000000000", + "14880000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xD804F74fe21290d213c46610ab171f7c2EeEBDE7", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + TREASURY, + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: "0xb0269d68CfdCc30Cb7Cd2E0b52b08Fa7Ffd3079b", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x170d3b2da05cc2124334240fB34ad1359e34C562"], ["1736111111111111"], ["1736111111111111"]], + value: "0", + }, +]; + +export const vip136Testnet = () => { + const meta = { + version: "v2", + title: "Isolated lending, phase 2", + description: ``, + forDescription: "I agree that Venus Protocol should proceed with IL Phase 2", + againstDescription: "I do not think that Venus Protocol should proceed with IL Phase 2", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with IL Phase 2", + }; + + return makeProposal(commands, meta, ProposalType.REGULAR); +}; diff --git a/vips/vip-136/vip-136.ts b/vips/vip-136/vip-136.ts new file mode 100644 index 000000000..7760568c3 --- /dev/null +++ b/vips/vip-136/vip-136.ts @@ -0,0 +1,763 @@ +import { ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const ANY_TARGET_CONTRACT = "0x0000000000000000000000000000000000000000"; + +const ACCESS_CONTROL_MANAGER = "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555"; +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; +const FAST_TRACK_TIMELOCK = "0x555ba73dB1b006F3f2C7dB7126d6e4343aDBce02"; +const CRITICAL_TIMELOCK = "0x213c446ec11e45b15a6E29C1C1b402B8897f606d"; + +const RESILIENT_ORACLE = "0x6592b5DE802159F3E74B2486b091D11a8256ab8A"; +const POOL_REGISTRY = "0x9F7b01A536aFA00EF10310A162877fd792cD0666"; +const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; + +const COMPTROLLER_DEFI = "0x3344417c9360b963ca93A4e8305361AEde340Ab9"; +const COMPTROLLER_GAMEFI = "0x1b43ea8622e76627B81665B1eCeBB4867566B963"; +const COMPTROLLER_LIQUID_STAKED_BNB = "0xd933909A4a2b7A4638903028f44D1d38ce27c352"; +const COMPTROLLER_TRON = "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0"; + +const SWAP_ROUTER_STABLECOINS = "0xBBd8E2b5d69fcE9Aaa599c50F0f0960AA58B32aA"; +const SWAP_ROUTER_DEFI = "0x47bEe99BD8Cf5D8d7e815e2D2a3E2985CBCcC04b"; +const SWAP_ROUTER_GAMEFI = "0x9B15462a79D0948BdDF679E0E5a9841C44aAFB7A"; +const SWAP_ROUTER_LIQUID_STAKED_BNB = "0x5f0ce69Aa564468492e860e8083BB001e4eb8d56"; +const SWAP_ROUTER_TRON = "0xacD270Ed7DFd4466Bd931d84fe5B904080E28Bfc"; + +const WBNB = "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"; +const USDT = "0x55d398326f99059fF775485246999027B3197955"; +const USDD = "0xd17479997F34dd9156Deef8F95A52D81D265be9c"; + +const commands = [ + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setReserveFactor(uint256)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setInterestRateModel(address)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "updateJumpRateModel(uint256,uint256,uint256,uint256)", FAST_TRACK_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setReserveFactor(uint256)", CRITICAL_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setInterestRateModel(address)", CRITICAL_TIMELOCK], + }, + { + target: ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "updateJumpRateModel(uint256,uint256,uint256,uint256)", CRITICAL_TIMELOCK], + }, + { + target: SWAP_ROUTER_STABLECOINS, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_DEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_DEFI, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["DeFi", COMPTROLLER_DEFI, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_DEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_GAMEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_GAMEFI, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["GameFi", COMPTROLLER_GAMEFI, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_GAMEFI, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_LIQUID_STAKED_BNB, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_LIQUID_STAKED_BNB, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: [ + "Liquid Staked BNB", + COMPTROLLER_LIQUID_STAKED_BNB, + "500000000000000000", + "1100000000000000000", + "100000000000000000000", + ], + value: "0", + }, + { + target: SWAP_ROUTER_LIQUID_STAKED_BNB, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_TRON, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: COMPTROLLER_TRON, + signature: "setPriceOracle(address)", + params: [RESILIENT_ORACLE], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["Tron", COMPTROLLER_TRON, "500000000000000000", "1100000000000000000", "100000000000000000000"], + value: "0", + }, + { + target: SWAP_ROUTER_TRON, + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xCa3F508B8e4Dd382eE878A314789373D80A5190A", "50000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xCa3F508B8e4Dd382eE878A314789373D80A5190A", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xCa3F508B8e4Dd382eE878A314789373D80A5190A", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "50000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xC718c51958d3fd44f5F9580c9fFAC2F89815C909", + "250000000000000000", + "300000000000000000", + "50000000000000000000", + "0x7C780b8A63eE9B7d0F985E8a922Be38a1F7B2141", + "379000000000000000000", + "266000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x965f527d9159dce6288a2219db51fc6eef120dd1", "475750000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x965f527d9159dce6288a2219db51fc6eef120dd1", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x965f527d9159dce6288a2219db51fc6eef120dd1", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "475750000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x8f657dFD3a1354DEB4545765fE6840cc54AFd379", + "250000000000000000", + "300000000000000000", + "475750000000000000000000", + "0x109E8083a64c7DedE513e8b580c5b08B96f9cE73", + "15000000000000000000000000", + "10500000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x8f0528ce5ef7b51152a59745befdd91d97091d2f", "5189000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x8f0528ce5ef7b51152a59745befdd91d97091d2f", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x8f0528ce5ef7b51152a59745befdd91d97091d2f", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "5189000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x02c5Fb0F26761093D297165e902e96D08576D344", + "250000000000000000", + "300000000000000000", + "5189000000000000000000", + "0xAD9CADe20100B8b945da48e1bCbd805C38d8bE77", + "2500000000000000000000000", + "1750000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDT, "30000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: USDT, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: USDT, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "30000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x1D8bBDE12B6b34140604E18e9f9c6e14deC16854", + "800000000000000000", + "880000000000000000", + "10000000000000000000000", + TREASURY, + "18600000000000000000000000", + "14880000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [USDD, "40000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: USDD, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: USDD, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000000"], + value: "0", + }, + + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xA615467caE6B9E0bb98BC04B4411d9296fd1dFa0", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xf307910A4c7bbc79691fD374889b36d8531B08e3", "500000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xf307910A4c7bbc79691fD374889b36d8531B08e3", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xf307910A4c7bbc79691fD374889b36d8531B08e3", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "500000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x19CE11C8817a1828D1d357DFBF62dCf5b0B2A362", + "250000000000000000", + "300000000000000000", + "500000000000000000000000", + "0xAE1c38847Fb90A13a2a1D7E5552cCD80c62C6508", + "9508802000000000000000000", + "6656161000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x12BB890508c125661E03b09EC06E404bc9289040", "175000000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x12BB890508c125661E03b09EC06E404bc9289040", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x12BB890508c125661E03b09EC06E404bc9289040", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "175000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xE5FE5527A5b76C75eedE77FdFA6B80D52444A465", + "250000000000000000", + "300000000000000000", + "175000000000000000000000000", + "0x6Ee74536B3Ff10Ff639aa781B7220121287F6Fa5", + "4000000000000000000000000000", + "2800000000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", "1512860000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "1512860000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xc353B7a1E13dDba393B5E120D4169Da7185aA2cb", + "250000000000000000", + "300000000000000000", + "1512860000000000000", + "0x17e98a24f992BB7bcd62d6722d714A3C74814B94", + "40000000000000000000", + "28000000000000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x4978591f17670A846137d9d613e333C38dc68A37", + "800000000000000000", + "880000000000000000", + "10000000000000000000000", + TREASURY, + "18600000000000000000000000", + "14880000000000000000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x9f2FD23bd0A5E08C5f2b9DD6CF9C96Bfb5fA515C", + "650000000000000000", + "700000000000000000", + "10000000000000000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", "40000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xBfe25459BA784e70E2D7a718Be99a1f3521cA17f", + "350000000000000000", + "400000000000000000", + "40000000000000000000", + "0xAE1c38847Fb90A13a2a1D7E5552cCD80c62C6508", + "8000000000000000000000", + "5600000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x1bdd3cf7f79cfb8edbb955f20ad99211551ba275", "39360000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x1bdd3cf7f79cfb8edbb955f20ad99211551ba275", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x1bdd3cf7f79cfb8edbb955f20ad99211551ba275", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "39360000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x5E21bF67a6af41c74C1773E4b473ca5ce8fd3791", + "350000000000000000", + "400000000000000000", + "39360000000000000000", + "0xF0348E1748FCD45020151C097D234DbbD5730BE7", + "1818000000000000000000", + "1272000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", "40000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "40000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xcc5D9e502574cda17215E70bC0B4546663785227", + "350000000000000000", + "400000000000000000", + "40000000000000000000", + "0xccc022502d6c65e1166fd34147040f05880f7972", + "540000000000000000000", + "378000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBNB(uint256,address)", + params: ["35000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: WBNB, + signature: "deposit()", + params: [], + value: "35000000000000000000", + }, + { + target: WBNB, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: WBNB, + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "35000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xe10E80B7FD3a29fE46E16C30CC8F4dd938B742e2", + "450000000000000000", + "500000000000000000", + "35000000000000000000", + TREASURY, + "80000000000000000000000", + "56000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", "16753000000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "16753000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x49c26e12959345472E2Fd95E5f79F8381058d3Ee", + "250000000000000000", + "300000000000000000", + "16753000000000000000000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "1500000000000000000000000000000", + "1050000000000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", "134000000000000000000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "134000000000000000000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xb114cfA615c828D88021a41bFc524B800E64a9D5", + "250000000000000000", + "300000000000000000", + "134000000000000000000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "3000000000000000000000000000", + "2100000000000000000000000000", + ], + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: ["0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", "129000000000", NORMAL_TIMELOCK], + value: "0", + }, + { + target: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, 0], + value: "0", + }, + { + target: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + signature: "approve(address,uint256)", + params: [POOL_REGISTRY, "129000000000"], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x836beb2cB723C498136e1119248436A645845F4E", + "250000000000000000", + "300000000000000000", + "129000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "11000000000000", + "7700000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0x281E5378f99A4bc55b295ABc0A3E7eD32Deba059", + "800000000000000000", + "880000000000000000", + "10000000000000000000000", + TREASURY, + "18600000000000000000000000", + "14880000000000000000000000", + ], + ], + value: "0", + }, + { + target: POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + "0xf1da185CCe5BeD1BeBbb3007Ef738Ea4224025F7", + "650000000000000000", + "700000000000000000", + "20000000000000000000000", + "0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296", + "2000000000000000000000000", + "1600000000000000000000000", + ], + ], + value: "0", + }, +]; + +export const vip136 = () => { + const meta = { + version: "v2", + title: "Isolated lending, phase 2", + description: ``, + forDescription: "I agree that Venus Protocol should proceed with IL Phase 2", + againstDescription: "I do not think that Venus Protocol should proceed with IL Phase 2", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with IL Phase 2", + }; + + return makeProposal(commands, meta, ProposalType.REGULAR); +};