diff --git a/simulations/vip-140/vip-140-testnet/abi/comptroller.json b/simulations/vip-140/vip-140-testnet/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-140/vip-140-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-140/vip-140-testnet/abi/erc20.json b/simulations/vip-140/vip-140-testnet/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-140/vip-140-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-140/vip-140-testnet/abi/rewardsDistributor.json b/simulations/vip-140/vip-140-testnet/abi/rewardsDistributor.json new file mode 100644 index 000000000..7035bb9a5 --- /dev/null +++ b/simulations/vip-140/vip-140-testnet/abi/rewardsDistributor.json @@ -0,0 +1,1129 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newBlock", + "type": "uint32" + } + ], + "name": "BorrowLastRewardingBlockUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "ContributorRewardTokenSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardAccrued", + "type": "uint256" + } + ], + "name": "ContributorRewardsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenTotal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerRewardToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenTotal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierRewardToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "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": "vToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "RewardTokenBorrowIndexUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "RewardTokenBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardTokenGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "RewardTokenSupplyIndexUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "RewardTokenSupplySpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newBlock", + "type": "uint32" + } + ], + "name": "SupplyLastRewardingBlockUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "INITIAL_INDEX", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "distributeBorrowerRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "distributeSupplierRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "grantRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Comptroller", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "rewardToken_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "loopsLimit_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "initializeMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastContributorBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lastRewardingBlock", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenContributorSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lastRewardingBlock", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rewardTokenSpeed", + "type": "uint256" + } + ], + "name": "setContributorRewardTokenSpeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint32[]", + "name": "supplyLastRewardingBlocks", + "type": "uint32[]" + }, + { + "internalType": "uint32[]", + "name": "borrowLastRewardingBlocks", + "type": "uint32[]" + } + ], + "name": "setLastRewardingBlocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "setRewardTokenSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contributor", + "type": "address" + } + ], + "name": "updateContributorRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "updateRewardTokenBorrowIndex", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "updateRewardTokenSupplyIndex", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/simulations/vip-140/vip-140-testnet/simulations.ts b/simulations/vip-140/vip-140-testnet/simulations.ts new file mode 100644 index 000000000..11a830dd5 --- /dev/null +++ b/simulations/vip-140/vip-140-testnet/simulations.ts @@ -0,0 +1,280 @@ +import { expect } from "chai"; +import { BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; + +import { forking, testVip } from "../../../src/vip-framework"; +import { vip140Testnet } from "../../../vips/vip-140/vip-140-testnet"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import REWARDS_DISTRIBUTOR_ABI from "./abi/rewardsDistributor.json"; + +const NORMAL_TIMELOCK = "0xce10739590001705F7FF231611ba4A48B2820327"; + +type PoolId = "Stablecoins" | "DeFi" | "GameFi" | "LiquidStakedBNB" | "Tron"; + +const pools: { [key in PoolId]: string } = { + Stablecoins: "0x10b57706AD2345e590c2eA4DC02faef0d9f5b08B", + DeFi: "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", + GameFi: "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", + LiquidStakedBNB: "0x596B11acAACF03217287939f88d63b51d3771704", + Tron: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", +}; + +type TokenSymbol = + | "HAY" + | "USDD" + | "BSW" + | "RACA" + | "FLOKI" + | "ankrBNB" + | "stkBNB" + | "BTT" + | "WIN" + | "TRX" + | "SD" + | "BNBx"; + +const tokens: { [key in TokenSymbol]: string } = { + HAY: "0xe73774DfCD551BF75650772dC2cC56a2B6323453", + USDD: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + BSW: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + RACA: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + FLOKI: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + BNBx: "0x327d6E6FAC0228070884e913263CFF9eFed4a2C8", + ankrBNB: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + stkBNB: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + BTT: "0xE98344A7c691B200EF47c9b8829110087D832C64", + WIN: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + TRX: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + SD: "0xac7D6B77EBD1DB8C5a9f0896e5eB5d485CB677b3", +}; + +type VTokenSymbol = + | "vHAY_Stablecoins" + | "vBSW_DeFi" + | "vFLOKI_GameFi" + | "vRACA_GameFi" + | "vBNBx_LiquidStakedBNB" + | "vankrBNB_LiquidStakedBNB" + | "vstkBNB_LiquidStakedBNB" + | "vBTT_Tron" + | "vTRX_Tron" + | "vUSDD_Tron" + | "vWIN_Tron"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vHAY_Stablecoins: "0x170d3b2da05cc2124334240fB34ad1359e34C562", + vBSW_DeFi: "0x5e68913fbbfb91af30366ab1B21324410b49a308", + vFLOKI_GameFi: "0xef470AbC365F88e4582D8027172a392C473A5B53", + vRACA_GameFi: "0x1958035231E125830bA5d17D168cEa07Bb42184a", + vBNBx_LiquidStakedBNB: "0x644A149853E5507AdF3e682218b8AC86cdD62951", + vankrBNB_LiquidStakedBNB: "0x57a664Dd7f1dE19545fEE9c86C949e3BF43d6D47", + vstkBNB_LiquidStakedBNB: "0x75aa42c832a8911B77219DbeBABBB40040d16987", + vBTT_Tron: "0x47793540757c6E6D84155B33cd8D9535CFdb9334", + vTRX_Tron: "0x410286c43a525E1DCC7468a9B091C111C8324cd1", + vUSDD_Tron: "0xD804F74fe21290d213c46610ab171f7c2EeEBDE7", + vWIN_Tron: "0xEe543D5de2Dbb5b07675Fc72831A2f1812428393", +}; + +interface RewardsDistributorConfig { + pool: string; + address: string; + token: string; + vToken: string; + borrowSpeed: BigNumberish; + supplySpeed: BigNumberish; + totalRewardsToDistribute: BigNumberish; +} + +type RewardsDistributorId = + | "RewardsDistributor_BSW_DeFi" + | "RewardsDistributor_FLOKI_GameFi" + | "RewardsDistributor_HAY_Stablecoins" + | "RewardsDistributor_RACA_GameFi" + | "RewardsDistributor_BTT_Tron" + | "RewardsDistributor_TRX_Tron" + | "RewardsDistributor_USDD_Tron" + | "RewardsDistributor_WIN_Tron" + | "RewardsDistributor_ankrBNB_LiquidStakedBNB" + | "RewardsDistributor_stkBNB_LiquidStakedBNB" + | "RewardsDistributor_ST_LiquidStakedBNB"; + +const rewardsDistributors: { [key in RewardsDistributorId]: RewardsDistributorConfig } = { + RewardsDistributor_BSW_DeFi: { + pool: pools.DeFi, + address: "0x2b67Cfaf28a1aBbBf71fb814Ad384d0C5a98e0F9", + token: tokens.BSW, + vToken: vTokens.vBSW_DeFi, + borrowSpeed: parseUnits("28950", 18).div(2).div(864000), + supplySpeed: parseUnits("28950", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("48250", 18), + }, + RewardsDistributor_FLOKI_GameFi: { + pool: pools.GameFi, + address: "0x5651866bcC4650d6fe5178E5ED7a8Be2cf3F70D0", + token: tokens.FLOKI, + vToken: vTokens.vFLOKI_GameFi, + borrowSpeed: parseUnits("397968025.47", 18).div(2).div(864000), // note 18 decimals on testnet + supplySpeed: parseUnits("397968025.47", 18).div(2).div(864000), // note 18 decimals on testnet + totalRewardsToDistribute: parseUnits("397968025.47", 18), // note 18 decimals on testnet + }, + RewardsDistributor_HAY_Stablecoins: { + pool: pools.Stablecoins, + address: "0xb0269d68CfdCc30Cb7Cd2E0b52b08Fa7Ffd3079b", + token: tokens.HAY, + vToken: vTokens.vHAY_Stablecoins, + borrowSpeed: parseUnits("3000", 18).div(2).div(806400), // 28 days + supplySpeed: parseUnits("3000", 18).div(2).div(806400), // 28 days + totalRewardsToDistribute: parseUnits("3000", 18), + }, + RewardsDistributor_RACA_GameFi: { + pool: pools.GameFi, + address: "0x66E213a4b8ba1c8D62cAa4649C7177E29321E262", + token: tokens.RACA, + vToken: vTokens.vRACA_GameFi, + borrowSpeed: parseUnits("10500000", 18).div(2).div(864000), + supplySpeed: parseUnits("10500000", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("10500000", 18), + }, + RewardsDistributor_BTT_Tron: { + pool: pools.Tron, + address: "0x095902273F06eEAC825c3F52dEF44f67a86B31cD", + token: tokens.BTT, + vToken: vTokens.vBTT_Tron, + borrowSpeed: parseUnits("34506556246", 18).div(2).div(864000), + supplySpeed: parseUnits("34506556246", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("34506556246", 18), + }, + RewardsDistributor_TRX_Tron: { + pool: pools.Tron, + address: "0x507401883C2a874D919e78a73dD0cB56f2e7eaD7", + token: tokens.TRX, + vToken: vTokens.vTRX_Tron, + borrowSpeed: parseUnits("78557", 6).div(2).div(864000), // note 6 decimals + supplySpeed: parseUnits("78557", 6).div(2).div(864000), // note 6 decimals + totalRewardsToDistribute: parseUnits("78557", 6), // note 6 decimals + }, + RewardsDistributor_USDD_Tron: { + pool: pools.Tron, + address: "0x1c50672f4752cc0Ae532D9b93b936C21121Ff08b", + token: tokens.USDD, + vToken: vTokens.vUSDD_Tron, + borrowSpeed: parseUnits("25000", 18).div(2).div(864000), + supplySpeed: parseUnits("25000", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("25000", 18), + }, + RewardsDistributor_WIN_Tron: { + pool: pools.Tron, + address: "0x9A73Ba89f6a95611B46b68241aBEcAF2cD0bd78A", + token: tokens.WIN, + vToken: vTokens.vWIN_Tron, + borrowSpeed: parseUnits("42863267", 18).div(2).div(864000), + supplySpeed: parseUnits("42863267", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("42863267", 18), + }, + RewardsDistributor_ankrBNB_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x7df11563c6b6b8027aE619FD9644A647dED5893B", + token: tokens.ankrBNB, + vToken: vTokens.vankrBNB_LiquidStakedBNB, + borrowSpeed: parseUnits("46", 18).div(2).div(864000), + supplySpeed: parseUnits("46", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("46", 18), + }, + RewardsDistributor_stkBNB_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x72c770A1E73Ad9ccD5249fC5536346f95345Fe2c", + token: tokens.stkBNB, + vToken: vTokens.vstkBNB_LiquidStakedBNB, + borrowSpeed: parseUnits("1.3", 18).div(864000), + supplySpeed: parseUnits("4", 18).div(864000), + totalRewardsToDistribute: parseUnits("5.3", 18), + }, + RewardsDistributor_ST_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x8Ad2Ad29e4e2C0606644Be51c853A7A4a3078F85", + token: tokens.SD, + vToken: vTokens.vBNBx_LiquidStakedBNB, + borrowSpeed: parseUnits("6400", 18).div(2).div(864000), + supplySpeed: parseUnits("6400", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("6400", 18), + }, +}; + +forking(31463725, () => { + testVip("VIP-140", vip140Testnet()); + + describe("Rewards distributors configuration", () => { + const checkRewardsDistributor = (id: RewardsDistributorId, reward: RewardsDistributorConfig) => { + describe(id, () => { + let rewardsDistributor: Contract; + + before(async () => { + rewardsDistributor = await ethers.getContractAt(REWARDS_DISTRIBUTOR_ABI, reward.address); + }); + + it(`should have rewardToken = "${reward.token}"`, async () => { + expect(await rewardsDistributor.rewardToken()).to.equal(reward.token); + }); + + it(`should have owner = Normal Timelock`, async () => { + expect(await rewardsDistributor.owner()).to.equal(NORMAL_TIMELOCK); + }); + + it(`should have borrowSpeed = ${reward.borrowSpeed.toString()}`, async () => { + expect(await rewardsDistributor.rewardTokenBorrowSpeeds(reward.vToken)).to.equal(reward.borrowSpeed); + }); + + it(`should have supplySpeed = ${reward.supplySpeed.toString()}`, async () => { + expect(await rewardsDistributor.rewardTokenSupplySpeeds(reward.vToken)).to.equal(reward.supplySpeed); + }); + + it(`should have balance = ${reward.totalRewardsToDistribute.toString()}`, async () => { + const token = await ethers.getContractAt(ERC20_ABI, reward.token); + expect(await token.balanceOf(rewardsDistributor.address)).to.equal(reward.totalRewardsToDistribute); + }); + + it(`should be registered in Comptroller`, async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, reward.pool); + expect(await comptroller.getRewardDistributors()).to.contain(rewardsDistributor.address); + }); + }); + }; + + for (const [id, reward] of Object.entries(rewardsDistributors) as [ + RewardsDistributorId, + RewardsDistributorConfig, + ][]) { + checkRewardsDistributor(id, reward); + } + }); + + describe("Pools configuration", () => { + it("should have 1 rewards distributor in Stablecoins pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Stablecoins); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(1); + }); + + it("should have 1 rewards distributor in DeFi pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.DeFi); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(1); + }); + + it("should have 2 rewards distributors in GameFi pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.GameFi); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(2); + }); + + it("should have 3 rewards distributors in LiquidStakedBNB pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.LiquidStakedBNB); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(3); + }); + + it("should have 4 rewards distributors in Tron pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Tron); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(4); + }); + }); +}); diff --git a/simulations/vip-140/vip-140/abi/comptroller.json b/simulations/vip-140/vip-140/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-140/vip-140/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-140/vip-140/abi/erc20.json b/simulations/vip-140/vip-140/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/simulations/vip-140/vip-140/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-140/vip-140/abi/rewardsDistributor.json b/simulations/vip-140/vip-140/abi/rewardsDistributor.json new file mode 100644 index 000000000..7035bb9a5 --- /dev/null +++ b/simulations/vip-140/vip-140/abi/rewardsDistributor.json @@ -0,0 +1,1129 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newBlock", + "type": "uint32" + } + ], + "name": "BorrowLastRewardingBlockUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "ContributorRewardTokenSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardAccrued", + "type": "uint256" + } + ], + "name": "ContributorRewardsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenTotal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerRewardToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenTotal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardTokenSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierRewardToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "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": "vToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "RewardTokenBorrowIndexUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "RewardTokenBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardTokenGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "RewardTokenSupplyIndexUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "RewardTokenSupplySpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newBlock", + "type": "uint32" + } + ], + "name": "SupplyLastRewardingBlockUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "INITIAL_INDEX", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "distributeBorrowerRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "distributeSupplierRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "grantRewardToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Comptroller", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "rewardToken_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "loopsLimit_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "initializeMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "lastContributorBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lastRewardingBlock", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenContributorSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewardTokenSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "lastRewardingBlock", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contributor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "rewardTokenSpeed", + "type": "uint256" + } + ], + "name": "setContributorRewardTokenSpeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint32[]", + "name": "supplyLastRewardingBlocks", + "type": "uint32[]" + }, + { + "internalType": "uint32[]", + "name": "borrowLastRewardingBlocks", + "type": "uint32[]" + } + ], + "name": "setLastRewardingBlocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "setRewardTokenSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contributor", + "type": "address" + } + ], + "name": "updateContributorRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "mantissa", + "type": "uint256" + } + ], + "internalType": "struct ExponentialNoError.Exp", + "name": "marketBorrowIndex", + "type": "tuple" + } + ], + "name": "updateRewardTokenBorrowIndex", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "updateRewardTokenSupplyIndex", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/simulations/vip-140/vip-140/simulations.ts b/simulations/vip-140/vip-140/simulations.ts new file mode 100644 index 000000000..e50e0682c --- /dev/null +++ b/simulations/vip-140/vip-140/simulations.ts @@ -0,0 +1,280 @@ +import { expect } from "chai"; +import { BigNumberish } from "ethers"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; + +import { forking, testVip } from "../../../src/vip-framework"; +import { vip140 } from "../../../vips/vip-140/vip-140"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import REWARDS_DISTRIBUTOR_ABI from "./abi/rewardsDistributor.json"; + +const NORMAL_TIMELOCK = "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396"; + +type PoolId = "Stablecoins" | "DeFi" | "GameFi" | "LiquidStakedBNB" | "Tron"; + +const pools: { [key in PoolId]: string } = { + Stablecoins: "0x94c1495cD4c557f1560Cbd68EAB0d197e6291571", + DeFi: "0x3344417c9360b963ca93A4e8305361AEde340Ab9", + GameFi: "0x1b43ea8622e76627B81665B1eCeBB4867566B963", + LiquidStakedBNB: "0xd933909A4a2b7A4638903028f44D1d38ce27c352", + Tron: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", +}; + +type TokenSymbol = + | "HAY" + | "USDD" + | "BSW" + | "RACA" + | "FLOKI" + | "ankrBNB" + | "stkBNB" + | "BTT" + | "WIN" + | "TRX" + | "SD" + | "BNBx"; + +const tokens: { [key in TokenSymbol]: string } = { + HAY: "0x0782b6d8c4551B9760e74c0545a9bCD90bdc41E5", + USDD: "0xd17479997F34dd9156Deef8F95A52D81D265be9c", + BSW: "0x965F527D9159dCe6288a2219DB51fc6Eef120dD1", + RACA: "0x12BB890508c125661E03b09EC06E404bc9289040", + FLOKI: "0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", + BNBx: "0x1bdd3Cf7F79cfB8EdbB955f20ad99211551BA275", + ankrBNB: "0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", + stkBNB: "0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", + BTT: "0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", + WIN: "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + TRX: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + SD: "0x3BC5AC0dFdC871B365d159f728dd1B9A0B5481E8", +}; + +type VTokenSymbol = + | "vHAY_Stablecoins" + | "vBSW_DeFi" + | "vFLOKI_GameFi" + | "vRACA_GameFi" + | "vBNBx_LiquidStakedBNB" + | "vankrBNB_LiquidStakedBNB" + | "vstkBNB_LiquidStakedBNB" + | "vBTT_Tron" + | "vTRX_Tron" + | "vUSDD_Tron" + | "vWIN_Tron"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vHAY_Stablecoins: "0xCa2D81AA7C09A1a025De797600A7081146dceEd9", + vBSW_DeFi: "0x8f657dFD3a1354DEB4545765fE6840cc54AFd379", + vFLOKI_GameFi: "0xc353B7a1E13dDba393B5E120D4169Da7185aA2cb", + vRACA_GameFi: "0xE5FE5527A5b76C75eedE77FdFA6B80D52444A465", + vBNBx_LiquidStakedBNB: "0x5E21bF67a6af41c74C1773E4b473ca5ce8fd3791", + vankrBNB_LiquidStakedBNB: "0xBfe25459BA784e70E2D7a718Be99a1f3521cA17f", + vstkBNB_LiquidStakedBNB: "0xcc5D9e502574cda17215E70bC0B4546663785227", + vBTT_Tron: "0x49c26e12959345472E2Fd95E5f79F8381058d3Ee", + vTRX_Tron: "0x836beb2cB723C498136e1119248436A645845F4E", + vUSDD_Tron: "0xf1da185CCe5BeD1BeBbb3007Ef738Ea4224025F7", + vWIN_Tron: "0xb114cfA615c828D88021a41bFc524B800E64a9D5", +}; + +interface RewardsDistributorConfig { + pool: string; + address: string; + token: string; + vToken: string; + borrowSpeed: BigNumberish; + supplySpeed: BigNumberish; + totalRewardsToDistribute: BigNumberish; +} + +type RewardsDistributorId = + | "RewardsDistributor_BSW_DeFi" + | "RewardsDistributor_FLOKI_GameFi" + | "RewardsDistributor_HAY_Stablecoins" + | "RewardsDistributor_RACA_GameFi" + | "RewardsDistributor_BTT_Tron" + | "RewardsDistributor_TRX_Tron" + | "RewardsDistributor_USDD_Tron" + | "RewardsDistributor_WIN_Tron" + | "RewardsDistributor_ankrBNB_LiquidStakedBNB" + | "RewardsDistributor_stkBNB_LiquidStakedBNB" + | "RewardsDistributor_ST_LiquidStakedBNB"; + +const rewardsDistributors: { [key in RewardsDistributorId]: RewardsDistributorConfig } = { + RewardsDistributor_BSW_DeFi: { + pool: pools.DeFi, + address: "0x7524116CEC937ef17B5998436F16d1306c4F7EF8", + token: tokens.BSW, + vToken: vTokens.vBSW_DeFi, + borrowSpeed: parseUnits("28950", 18).div(2).div(864000), + supplySpeed: parseUnits("28950", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("48250", 18), + }, + RewardsDistributor_FLOKI_GameFi: { + pool: pools.GameFi, + address: "0x501a91b995Bd41177503A1A4144F3D25BFF869e1", + token: tokens.FLOKI, + vToken: vTokens.vFLOKI_GameFi, + borrowSpeed: parseUnits("397968025.47", 9).div(2).div(864000), // note 9 decimals on mainnet + supplySpeed: parseUnits("397968025.47", 9).div(2).div(864000), // note 9 decimals on mainnet + totalRewardsToDistribute: parseUnits("397968025.47", 9), // note 9 decimals on mainnet + }, + RewardsDistributor_HAY_Stablecoins: { + pool: pools.Stablecoins, + address: "0xBA711976CdF8CF3288bF721f758fB764503Eb1f6", + token: tokens.HAY, + vToken: vTokens.vHAY_Stablecoins, + borrowSpeed: parseUnits("3000", 18).div(2).div(806400), // 28 days + supplySpeed: parseUnits("3000", 18).div(2).div(806400), // 28 days + totalRewardsToDistribute: parseUnits("3000", 18), + }, + RewardsDistributor_RACA_GameFi: { + pool: pools.GameFi, + address: "0x2517A3bEe42EA8f628926849B04870260164b555", + token: tokens.RACA, + vToken: vTokens.vRACA_GameFi, + borrowSpeed: parseUnits("10500000", 18).div(2).div(864000), + supplySpeed: parseUnits("10500000", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("10500000", 18), + }, + RewardsDistributor_BTT_Tron: { + pool: pools.Tron, + address: "0x804F3893d3c1C3EFFDf778eDDa7C199129235882", + token: tokens.BTT, + vToken: vTokens.vBTT_Tron, + borrowSpeed: parseUnits("34506556246", 18).div(2).div(864000), + supplySpeed: parseUnits("34506556246", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("34506556246", 18), + }, + RewardsDistributor_TRX_Tron: { + pool: pools.Tron, + address: "0x22af8a65639a351a9D5d77d5a25ea5e1Cf5e9E6b", + token: tokens.TRX, + vToken: vTokens.vTRX_Tron, + borrowSpeed: parseUnits("78557", 6).div(2).div(864000), // note 6 decimals + supplySpeed: parseUnits("78557", 6).div(2).div(864000), // note 6 decimals + totalRewardsToDistribute: parseUnits("78557", 6), // note 6 decimals + }, + RewardsDistributor_USDD_Tron: { + pool: pools.Tron, + address: "0x08e4AFd80A5849FDBa4bBeea86ed470D697e4C54", + token: tokens.USDD, + vToken: vTokens.vUSDD_Tron, + borrowSpeed: parseUnits("25000", 18).div(2).div(864000), + supplySpeed: parseUnits("25000", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("25000", 18), + }, + RewardsDistributor_WIN_Tron: { + pool: pools.Tron, + address: "0x6536123503DF76BDfF8207e4Fb0C594Bc5eFD00A", + token: tokens.WIN, + vToken: vTokens.vWIN_Tron, + borrowSpeed: parseUnits("42863267", 18).div(2).div(864000), + supplySpeed: parseUnits("42863267", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("42863267", 18), + }, + RewardsDistributor_ankrBNB_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x63aFCe42086c8302659CA0E21F4Eade27Ad85ded", + token: tokens.ankrBNB, + vToken: vTokens.vankrBNB_LiquidStakedBNB, + borrowSpeed: parseUnits("46", 18).div(2).div(864000), + supplySpeed: parseUnits("46", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("46", 18), + }, + RewardsDistributor_stkBNB_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x79397BAc982718347406Ebb7A6a8845896fdD8dE", + token: tokens.stkBNB, + vToken: vTokens.vstkBNB_LiquidStakedBNB, + borrowSpeed: parseUnits("1.3", 18).div(864000), + supplySpeed: parseUnits("4", 18).div(864000), + totalRewardsToDistribute: parseUnits("5.3", 18), + }, + RewardsDistributor_ST_LiquidStakedBNB: { + pool: pools.LiquidStakedBNB, + address: "0x6a7b50EccC721f0Fa9FD7879A7dF082cdA60Db78", + token: tokens.SD, + vToken: vTokens.vBNBx_LiquidStakedBNB, + borrowSpeed: parseUnits("6400", 18).div(2).div(864000), + supplySpeed: parseUnits("6400", 18).div(2).div(864000), + totalRewardsToDistribute: parseUnits("6400", 18), + }, +}; + +forking(29871800, () => { + testVip("VIP-140", vip140()); + + describe("Rewards distributors configuration", () => { + const checkRewardsDistributor = (id: RewardsDistributorId, reward: RewardsDistributorConfig) => { + describe(id, () => { + let rewardsDistributor: Contract; + + before(async () => { + rewardsDistributor = await ethers.getContractAt(REWARDS_DISTRIBUTOR_ABI, reward.address); + }); + + it(`should have rewardToken = "${reward.token}"`, async () => { + expect(await rewardsDistributor.rewardToken()).to.equal(reward.token); + }); + + it(`should have owner = Normal Timelock`, async () => { + expect(await rewardsDistributor.owner()).to.equal(NORMAL_TIMELOCK); + }); + + it(`should have borrowSpeed = ${reward.borrowSpeed.toString()}`, async () => { + expect(await rewardsDistributor.rewardTokenBorrowSpeeds(reward.vToken)).to.equal(reward.borrowSpeed); + }); + + it(`should have supplySpeed = ${reward.supplySpeed.toString()}`, async () => { + expect(await rewardsDistributor.rewardTokenSupplySpeeds(reward.vToken)).to.equal(reward.supplySpeed); + }); + + it(`should have balance = ${reward.totalRewardsToDistribute.toString()}`, async () => { + const token = await ethers.getContractAt(ERC20_ABI, reward.token); + expect(await token.balanceOf(rewardsDistributor.address)).to.equal(reward.totalRewardsToDistribute); + }); + + it(`should be registered in Comptroller`, async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, reward.pool); + expect(await comptroller.getRewardDistributors()).to.contain(rewardsDistributor.address); + }); + }); + }; + + for (const [id, reward] of Object.entries(rewardsDistributors) as [ + RewardsDistributorId, + RewardsDistributorConfig, + ][]) { + checkRewardsDistributor(id, reward); + } + }); + + describe("Pools configuration", () => { + it("should have 1 rewards distributor in Stablecoins pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Stablecoins); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(1); + }); + + it("should have 1 rewards distributor in DeFi pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.DeFi); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(1); + }); + + it("should have 2 rewards distributors in GameFi pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.GameFi); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(2); + }); + + it("should have 3 rewards distributors in LiquidStakedBNB pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.LiquidStakedBNB); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(3); + }); + + it("should have 4 rewards distributors in Tron pool", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, pools.Tron); + expect(await comptroller.getRewardDistributors()).to.have.lengthOf(4); + }); + }); +}); diff --git a/vips/vip-140/vip-140-testnet.ts b/vips/vip-140/vip-140-testnet.ts new file mode 100644 index 000000000..60a723340 --- /dev/null +++ b/vips/vip-140/vip-140-testnet.ts @@ -0,0 +1,263 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const DEPLOYER = "0x2Ce1d0ffD7E869D9DF33e28552b12DdDed326706"; + +const commands = [ + { + target: "0xe73774DfCD551BF75650772dC2cC56a2B6323453", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0xb0269d68CfdCc30Cb7Cd2E0b52b08Fa7Ffd3079b", parseUnits("3000", 18)], + }, + { + target: "0xE98344A7c691B200EF47c9b8829110087D832C64", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x095902273F06eEAC825c3F52dEF44f67a86B31cD", parseUnits("34506556246", 18)], + }, + { + target: "0x2E6Af3f3F059F43D764060968658c9F3c8f9479D", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x9A73Ba89f6a95611B46b68241aBEcAF2cD0bd78A", parseUnits("42863267", 18)], + }, + { + target: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x507401883C2a874D919e78a73dD0cB56f2e7eaD7", parseUnits("78557", 6)], + }, + { + target: "0x2E2466e22FcbE0732Be385ee2FBb9C59a1098382", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x1c50672f4752cc0Ae532D9b93b936C21121Ff08b", parseUnits("25000", 18)], + }, + { + target: "0xD60cC803d888A3e743F21D0bdE4bF2cAfdEA1F26", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x66E213a4b8ba1c8D62cAa4649C7177E29321E262", parseUnits("10500000", 18)], + }, + { + target: "0xb22cF15FBc089d470f8e532aeAd2baB76bE87c88", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x5651866bcC4650d6fe5178E5ED7a8Be2cf3F70D0", parseUnits("397968025.47", 18)], + }, + { + target: "0x167F1F9EF531b3576201aa3146b13c57dbEda514", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x7df11563c6b6b8027aE619FD9644A647dED5893B", parseUnits("46", 18)], + }, + { + target: "0x7FCC76fc1F573d8Eb445c236Cc282246bC562bCE", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x2b67Cfaf28a1aBbBf71fb814Ad384d0C5a98e0F9", parseUnits("48250", 18)], + }, + { + target: "0x2999C176eBf66ecda3a646E70CeB5FF4d5fCFb8C", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x72c770A1E73Ad9ccD5249fC5536346f95345Fe2c", parseUnits("5.3", 18)], + }, + { + target: "0xac7D6B77EBD1DB8C5a9f0896e5eB5d485CB677b3", + signature: "transferFrom(address,address,uint256)", + params: [DEPLOYER, "0x8Ad2Ad29e4e2C0606644Be51c853A7A4a3078F85", parseUnits("6400", 18)], + }, + { + target: "0xb0269d68CfdCc30Cb7Cd2E0b52b08Fa7Ffd3079b", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x170d3b2da05cc2124334240fB34ad1359e34C562"], ["1860119047619047"], ["1860119047619047"]], + value: "0", + }, + { + target: "0x2b67Cfaf28a1aBbBf71fb814Ad384d0C5a98e0F9", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD", + signature: "addRewardsDistributor(address)", + params: ["0x2b67Cfaf28a1aBbBf71fb814Ad384d0C5a98e0F9"], + value: "0", + }, + { + target: "0x2b67Cfaf28a1aBbBf71fb814Ad384d0C5a98e0F9", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x5e68913fbbfb91af30366ab1B21324410b49a308"], ["16753472222222222"], ["16753472222222222"]], + value: "0", + }, + { + target: "0x5651866bcC4650d6fe5178E5ED7a8Be2cf3F70D0", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", + signature: "addRewardsDistributor(address)", + params: ["0x5651866bcC4650d6fe5178E5ED7a8Be2cf3F70D0"], + value: "0", + }, + { + target: "0x5651866bcC4650d6fe5178E5ED7a8Be2cf3F70D0", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xef470AbC365F88e4582D8027172a392C473A5B53"], ["230305570295138888888"], ["230305570295138888888"]], + value: "0", + }, + { + target: "0x66E213a4b8ba1c8D62cAa4649C7177E29321E262", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", + signature: "addRewardsDistributor(address)", + params: ["0x66E213a4b8ba1c8D62cAa4649C7177E29321E262"], + value: "0", + }, + { + target: "0x66E213a4b8ba1c8D62cAa4649C7177E29321E262", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x1958035231E125830bA5d17D168cEa07Bb42184a"], ["6076388888888888888"], ["6076388888888888888"]], + value: "0", + }, + { + target: "0x7df11563c6b6b8027aE619FD9644A647dED5893B", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x596B11acAACF03217287939f88d63b51d3771704", + signature: "addRewardsDistributor(address)", + params: ["0x7df11563c6b6b8027aE619FD9644A647dED5893B"], + value: "0", + }, + { + target: "0x7df11563c6b6b8027aE619FD9644A647dED5893B", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x57a664Dd7f1dE19545fEE9c86C949e3BF43d6D47"], ["26620370370370"], ["26620370370370"]], + value: "0", + }, + { + target: "0x72c770A1E73Ad9ccD5249fC5536346f95345Fe2c", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x596B11acAACF03217287939f88d63b51d3771704", + signature: "addRewardsDistributor(address)", + params: ["0x72c770A1E73Ad9ccD5249fC5536346f95345Fe2c"], + value: "0", + }, + { + target: "0x72c770A1E73Ad9ccD5249fC5536346f95345Fe2c", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x75aa42c832a8911B77219DbeBABBB40040d16987"], ["4629629629629"], ["1504629629629"]], + value: "0", + }, + { + target: "0x095902273F06eEAC825c3F52dEF44f67a86B31cD", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", + signature: "addRewardsDistributor(address)", + params: ["0x095902273F06eEAC825c3F52dEF44f67a86B31cD"], + value: "0", + }, + { + target: "0x095902273F06eEAC825c3F52dEF44f67a86B31cD", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x47793540757c6E6D84155B33cd8D9535CFdb9334"], ["19969071901620370370370"], ["19969071901620370370370"]], + value: "0", + }, + { + target: "0x9A73Ba89f6a95611B46b68241aBEcAF2cD0bd78A", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", + signature: "addRewardsDistributor(address)", + params: ["0x9A73Ba89f6a95611B46b68241aBEcAF2cD0bd78A"], + value: "0", + }, + { + target: "0x9A73Ba89f6a95611B46b68241aBEcAF2cD0bd78A", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xEe543D5de2Dbb5b07675Fc72831A2f1812428393"], ["24805131365740740740"], ["24805131365740740740"]], + value: "0", + }, + { + target: "0x507401883C2a874D919e78a73dD0cB56f2e7eaD7", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", + signature: "addRewardsDistributor(address)", + params: ["0x507401883C2a874D919e78a73dD0cB56f2e7eaD7"], + value: "0", + }, + { + target: "0x507401883C2a874D919e78a73dD0cB56f2e7eaD7", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x410286c43a525E1DCC7468a9B091C111C8324cd1"], ["45461"], ["45461"]], + value: "0", + }, + { + target: "0x1c50672f4752cc0Ae532D9b93b936C21121Ff08b", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x11537D023f489E4EF0C7157cc729C7B69CbE0c97", + signature: "addRewardsDistributor(address)", + params: ["0x1c50672f4752cc0Ae532D9b93b936C21121Ff08b"], + value: "0", + }, + { + target: "0x1c50672f4752cc0Ae532D9b93b936C21121Ff08b", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xD804F74fe21290d213c46610ab171f7c2EeEBDE7"], ["14467592592592592"], ["14467592592592592"]], + value: "0", + }, + { + target: "0x8Ad2Ad29e4e2C0606644Be51c853A7A4a3078F85", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x596B11acAACF03217287939f88d63b51d3771704", + signature: "addRewardsDistributor(address)", + params: ["0x8Ad2Ad29e4e2C0606644Be51c853A7A4a3078F85"], + value: "0", + }, + { + target: "0x8Ad2Ad29e4e2C0606644Be51c853A7A4a3078F85", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x644A149853E5507AdF3e682218b8AC86cdD62951"], ["3703703703703703"], ["3703703703703703"]], + value: "0", + }, +]; + +export const vip140Testnet = () => { + const meta = { + version: "v2", + title: "IL Rewards", + description: ``, + forDescription: "I agree that Venus Protocol should proceed with IL Rewards", + againstDescription: "I do not think that Venus Protocol should proceed with IL Rewards", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with IL Rewards", + }; + + return makeProposal(commands, meta, ProposalType.REGULAR); +}; diff --git a/vips/vip-140/vip-140.ts b/vips/vip-140/vip-140.ts new file mode 100644 index 000000000..5e8a94f19 --- /dev/null +++ b/vips/vip-140/vip-140.ts @@ -0,0 +1,330 @@ +import { parseUnits } from "ethers/lib/utils"; + +import { ProposalType } from "../../src/types"; +import { makeProposal } from "../../src/utils"; + +const TREASURY = "0xF322942f644A996A617BD29c16bd7d231d9F35E9"; + +const commands = [ + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x352Cb5E19b12FC216548a2677bD0fce83BaE434B", + parseUnits("34506556246", 18), + "0x804F3893d3c1C3EFFDf778eDDa7C199129235882", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0xaeF0d72a118ce24feE3cD1d43d383897D05B4e99", + parseUnits("42863267", 18), + "0x6536123503DF76BDfF8207e4Fb0C594Bc5eFD00A", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + parseUnits("78557", 6), + "0x22af8a65639a351a9D5d77d5a25ea5e1Cf5e9E6b", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0xd17479997F34dd9156Deef8F95A52D81D265be9c", + parseUnits("25000", 18), + "0x08e4AFd80A5849FDBa4bBeea86ed470D697e4C54", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x12BB890508c125661E03b09EC06E404bc9289040", + parseUnits("10500000", 18), + "0x2517A3bEe42EA8f628926849B04870260164b555", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0xfb5B838b6cfEEdC2873aB27866079AC55363D37E", + parseUnits("397968025.47", 9), + "0x501a91b995Bd41177503A1A4144F3D25BFF869e1", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x52F24a5e03aee338Da5fd9Df68D2b6FAe1178827", + parseUnits("46", 18), + "0x63aFCe42086c8302659CA0E21F4Eade27Ad85ded", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x965f527d9159dce6288a2219db51fc6eef120dd1", + parseUnits("48250", 18), + "0x7524116CEC937ef17B5998436F16d1306c4F7EF8", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x0782b6d8c4551B9760e74c0545a9bCD90bdc41E5", + parseUnits("3000", 18), + "0xBA711976CdF8CF3288bF721f758fB764503Eb1f6", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0xc2E9d07F66A89c44062459A47a0D2Dc038E4fb16", + parseUnits("5.3", 18), + "0x79397BAc982718347406Ebb7A6a8845896fdD8dE", + ], + value: "0", + }, + { + target: TREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [ + "0x3BC5AC0dFdC871B365d159f728dd1B9A0B5481E8", + parseUnits("6400", 18), + "0x6a7b50EccC721f0Fa9FD7879A7dF082cdA60Db78", + ], + value: "0", + }, + { + target: "0xBA711976CdF8CF3288bF721f758fB764503Eb1f6", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x94c1495cD4c557f1560Cbd68EAB0d197e6291571", + signature: "addRewardsDistributor(address)", + params: ["0xBA711976CdF8CF3288bF721f758fB764503Eb1f6"], + value: "0", + }, + { + target: "0xBA711976CdF8CF3288bF721f758fB764503Eb1f6", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xCa2D81AA7C09A1a025De797600A7081146dceEd9"], ["1860119047619047"], ["1860119047619047"]], + value: "0", + }, + { + target: "0x7524116CEC937ef17B5998436F16d1306c4F7EF8", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x3344417c9360b963ca93A4e8305361AEde340Ab9", + signature: "addRewardsDistributor(address)", + params: ["0x7524116CEC937ef17B5998436F16d1306c4F7EF8"], + value: "0", + }, + { + target: "0x7524116CEC937ef17B5998436F16d1306c4F7EF8", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x8f657dFD3a1354DEB4545765fE6840cc54AFd379"], ["16753472222222222"], ["16753472222222222"]], + value: "0", + }, + { + target: "0x501a91b995Bd41177503A1A4144F3D25BFF869e1", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x1b43ea8622e76627B81665B1eCeBB4867566B963", + signature: "addRewardsDistributor(address)", + params: ["0x501a91b995Bd41177503A1A4144F3D25BFF869e1"], + value: "0", + }, + { + target: "0x501a91b995Bd41177503A1A4144F3D25BFF869e1", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xc353B7a1E13dDba393B5E120D4169Da7185aA2cb"], ["230305570295"], ["230305570295"]], + value: "0", + }, + { + target: "0x2517A3bEe42EA8f628926849B04870260164b555", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x1b43ea8622e76627B81665B1eCeBB4867566B963", + signature: "addRewardsDistributor(address)", + params: ["0x2517A3bEe42EA8f628926849B04870260164b555"], + value: "0", + }, + { + target: "0x2517A3bEe42EA8f628926849B04870260164b555", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xE5FE5527A5b76C75eedE77FdFA6B80D52444A465"], ["6076388888888888888"], ["6076388888888888888"]], + value: "0", + }, + { + target: "0x63aFCe42086c8302659CA0E21F4Eade27Ad85ded", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0xd933909A4a2b7A4638903028f44D1d38ce27c352", + signature: "addRewardsDistributor(address)", + params: ["0x63aFCe42086c8302659CA0E21F4Eade27Ad85ded"], + value: "0", + }, + { + target: "0x63aFCe42086c8302659CA0E21F4Eade27Ad85ded", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xBfe25459BA784e70E2D7a718Be99a1f3521cA17f"], ["26620370370370"], ["26620370370370"]], + value: "0", + }, + { + target: "0x79397BAc982718347406Ebb7A6a8845896fdD8dE", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0xd933909A4a2b7A4638903028f44D1d38ce27c352", + signature: "addRewardsDistributor(address)", + params: ["0x79397BAc982718347406Ebb7A6a8845896fdD8dE"], + value: "0", + }, + { + target: "0x79397BAc982718347406Ebb7A6a8845896fdD8dE", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xcc5D9e502574cda17215E70bC0B4546663785227"], ["4629629629629"], ["1504629629629"]], + value: "0", + }, + { + target: "0x804F3893d3c1C3EFFDf778eDDa7C199129235882", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", + signature: "addRewardsDistributor(address)", + params: ["0x804F3893d3c1C3EFFDf778eDDa7C199129235882"], + value: "0", + }, + { + target: "0x804F3893d3c1C3EFFDf778eDDa7C199129235882", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x49c26e12959345472E2Fd95E5f79F8381058d3Ee"], ["19969071901620370370370"], ["19969071901620370370370"]], + value: "0", + }, + { + target: "0x6536123503DF76BDfF8207e4Fb0C594Bc5eFD00A", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", + signature: "addRewardsDistributor(address)", + params: ["0x6536123503DF76BDfF8207e4Fb0C594Bc5eFD00A"], + value: "0", + }, + { + target: "0x6536123503DF76BDfF8207e4Fb0C594Bc5eFD00A", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xb114cfA615c828D88021a41bFc524B800E64a9D5"], ["24805131365740740740"], ["24805131365740740740"]], + value: "0", + }, + { + target: "0x22af8a65639a351a9D5d77d5a25ea5e1Cf5e9E6b", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", + signature: "addRewardsDistributor(address)", + params: ["0x22af8a65639a351a9D5d77d5a25ea5e1Cf5e9E6b"], + value: "0", + }, + { + target: "0x22af8a65639a351a9D5d77d5a25ea5e1Cf5e9E6b", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x836beb2cB723C498136e1119248436A645845F4E"], ["45461"], ["45461"]], + value: "0", + }, + { + target: "0x08e4AFd80A5849FDBa4bBeea86ed470D697e4C54", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0x23b4404E4E5eC5FF5a6FFb70B7d14E3FabF237B0", + signature: "addRewardsDistributor(address)", + params: ["0x08e4AFd80A5849FDBa4bBeea86ed470D697e4C54"], + value: "0", + }, + { + target: "0x08e4AFd80A5849FDBa4bBeea86ed470D697e4C54", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0xf1da185CCe5BeD1BeBbb3007Ef738Ea4224025F7"], ["14467592592592592"], ["14467592592592592"]], + value: "0", + }, + { + target: "0x6a7b50EccC721f0Fa9FD7879A7dF082cdA60Db78", + signature: "acceptOwnership()", + params: [], + value: "0", + }, + { + target: "0xd933909A4a2b7A4638903028f44D1d38ce27c352", + signature: "addRewardsDistributor(address)", + params: ["0x6a7b50EccC721f0Fa9FD7879A7dF082cdA60Db78"], + value: "0", + }, + { + target: "0x6a7b50EccC721f0Fa9FD7879A7dF082cdA60Db78", + signature: "setRewardTokenSpeeds(address[],uint256[],uint256[])", + params: [["0x5E21bF67a6af41c74C1773E4b473ca5ce8fd3791"], ["3703703703703703"], ["3703703703703703"]], + value: "0", + }, +]; + +export const vip140 = () => { + const meta = { + version: "v2", + title: "IL Rewards", + description: ``, + forDescription: "I agree that Venus Protocol should proceed with IL Rewards", + againstDescription: "I do not think that Venus Protocol should proceed with IL Rewards", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds with IL Rewards", + }; + + return makeProposal(commands, meta, ProposalType.REGULAR); +};