From 5d3beaca5b9e5c0edbc0c7296af813848ef9aad0 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 5 Jan 2026 17:36:46 +0530 Subject: [PATCH 01/14] feat: add vip and simulations for bsctestnet --- simulations/vip-790/abi/Comptroller.json | 4145 +++++++++++++++++ simulations/vip-790/abi/ERC20.json | 134 + simulations/vip-790/abi/RedstoneOracle.json | 187 + simulations/vip-790/abi/ResilientOracle.json | 320 ++ .../vip-790/abi/SingleTokenConverter.json | 1622 +++++++ simulations/vip-790/abi/VToken.json | 1747 +++++++ simulations/vip-790/abi/VTreasury.json | 83 + simulations/vip-790/bsctestnet.ts | 224 + src/vip-framework/checks/interestRateModel.ts | 2 +- vips/vip-790/bsctestnet.ts | 269 ++ 10 files changed, 8732 insertions(+), 1 deletion(-) create mode 100644 simulations/vip-790/abi/Comptroller.json create mode 100644 simulations/vip-790/abi/ERC20.json create mode 100644 simulations/vip-790/abi/RedstoneOracle.json create mode 100644 simulations/vip-790/abi/ResilientOracle.json create mode 100644 simulations/vip-790/abi/SingleTokenConverter.json create mode 100644 simulations/vip-790/abi/VToken.json create mode 100644 simulations/vip-790/abi/VTreasury.json create mode 100644 simulations/vip-790/bsctestnet.ts create mode 100644 vips/vip-790/bsctestnet.ts diff --git a/simulations/vip-790/abi/Comptroller.json b/simulations/vip-790/abi/Comptroller.json new file mode 100644 index 000000000..5ca3a7000 --- /dev/null +++ b/simulations/vip-790/abi/Comptroller.json @@ -0,0 +1,4145 @@ +[ + { + "inputs": [], + "name": "AlreadyInSelectedPool", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowNotAllowedInPool", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPoolLabel", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "InactivePool", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleBorrowedAssets", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOperationForCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum WeightFunction", + "name": "strategy", + "type": "uint8" + } + ], + "name": "InvalidWeightingStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "name": "LiquidityCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [], + "name": "MarketConfigNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "MarketNotListedInCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "PoolDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "ActionProtocolPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "BorrowAllowedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "approver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + } + ], + "name": "DiamondCut", + "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": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerVenus", + "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": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DistributedVAIVaultVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledForUserUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "NewAccessControl", + "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": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "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": "address", + "name": "oldComptrollerLens", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newComptrollerLens", + "type": "address" + } + ], + "name": "NewComptrollerLens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "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": "address", + "name": "oldLiquidatorContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLiquidatorContract", + "type": "address" + } + ], + "name": "NewLiquidatorContract", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IPrime", + "name": "oldPrimeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IPrime", + "name": "newPrimeToken", + "type": "address" + } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + } + ], + "name": "NewTreasuryAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + } + ], + "name": "NewTreasuryGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldTreasuryPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "NewTreasuryPercent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "oldVAIController", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "newVAIController", + "type": "address" + } + ], + "name": "NewVAIController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVAIMintRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "NewVAIMintRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseInterval_", + "type": "uint256" + } + ], + "name": "NewVAIVaultInfo", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVenusVAIVaultRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVenusVAIVaultRate", + "type": "uint256" + } + ], + "name": "NewVenusVAIVaultRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVS", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVS", + "type": "address" + } + ], + "name": "NewXVSToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVToken", + "type": "address" + } + ], + "name": "NewXVSVToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolActiveStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolFallbackStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "oldLabel", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "PoolLabelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "PoolMarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "previousPoolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "newPoolId", + "type": "uint96" + } + ], + "name": "PoolSelected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusSeized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusSupplySpeedUpdated", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_grantXVS", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "_setAccessControl", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "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": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptrollerLens_", + "type": "address" + } + ], + "name": "_setComptrollerLens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidationForUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLiquidatorContract_", + "type": "address" + } + ], + "name": "_setLiquidatorContract", + "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": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "_setPauseGuardian", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "_setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "_setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "_setProtocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + }, + { + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "_setTreasuryData", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "vaiController_", + "type": "address" + } + ], + "name": "_setVAIController", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "_setVAIMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReleaseAmount_", + "type": "uint256" + } + ], + "name": "_setVAIVaultInfo", + "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": "_setVenusSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "venusVAIVaultRate_", + "type": "uint256" + } + ], + "name": "_setVenusVAIVaultRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvs_", + "type": "address" + } + ], + "name": "_setXVSToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVToken_", + "type": "address" + } + ], + "name": "_setXVSVToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "_supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96[]", + "name": "poolIds", + "type": "uint96[]" + }, + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "addPoolMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "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": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "collateral", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenusAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "corePoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "diamondCut_", + "type": "tuple[]" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "enterPool", + "outputs": [], + "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": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "functionSelectorPosition", + "type": "uint96" + } + ], + "internalType": "struct ComptrollerV13Storage.FacetAddressAndPosition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBorrowingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getEffectiveLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "enum WeightFunction", + "name": "weightingStrategy", + "type": "uint8" + } + ], + "name": "getEffectiveLtvFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getPoolMarketIndex", + "outputs": [ + { + "internalType": "PoolMarketId", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "getPoolVTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSVTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "targetPoolId", + "type": "uint96" + } + ], + "name": "hasValidPoolBorrows", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "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": [], + "name": "lastPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "liquidateBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "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": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateVAICalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualMintAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "poolMarkets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "allowCorePoolFallback", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "removePoolMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowerIndex", + "type": "uint256" + } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "seizeVenus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "allowFallback", + "type": "bool" + } + ], + "name": "setAllowCorePoolFallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "borrowAllowed", + "type": "bool" + } + ], + "name": "setIsBorrowAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setMintedVAIOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setPoolActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "setPoolLabel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": "transferAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "unlistMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusInitialIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-790/abi/ERC20.json b/simulations/vip-790/abi/ERC20.json new file mode 100644 index 000000000..3a509c9c4 --- /dev/null +++ b/simulations/vip-790/abi/ERC20.json @@ -0,0 +1,134 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" }, + { "internalType": "uint8", "name": "decimals_", "type": "uint8" } + ], + "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": 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": [ + { "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": "uint256", "name": "amount", "type": "uint256" }], + "name": "faucet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "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": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "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-790/abi/RedstoneOracle.json b/simulations/vip-790/abi/RedstoneOracle.json new file mode 100644 index 000000000..7dd5f6f5f --- /dev/null +++ b/simulations/vip-790/abi/RedstoneOracle.json @@ -0,0 +1,187 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "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": "asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "previousPriceMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newPriceMantissa", "type": "uint256" } + ], + "name": "PricePosted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "feed", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "prices", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "price", "type": "uint256" } + ], + "name": "setDirectPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "feed", "type": "address" }, + { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } + ], + "internalType": "struct ChainlinkOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "feed", "type": "address" }, + { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } + ], + "internalType": "struct ChainlinkOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "tokenConfigs", + "outputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "feed", "type": "address" }, + { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-790/abi/ResilientOracle.json b/simulations/vip-790/abi/ResilientOracle.json new file mode 100644 index 000000000..373eb14e9 --- /dev/null +++ b/simulations/vip-790/abi/ResilientOracle.json @@ -0,0 +1,320 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "nativeMarketAddress", "type": "address" }, + { "internalType": "address", "name": "vaiAddress", "type": "address" }, + { "internalType": "contract BoundValidatorInterface", "name": "_boundValidator", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "CachedEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" }, + { "indexed": true, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "OracleEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "oracle", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" } + ], + "name": "OracleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "mainOracle", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "pivotOracle", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "CACHE_SLOT", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INVALID_PRICE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "boundValidator", + "outputs": [{ "internalType": "contract BoundValidatorInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "enableOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "getOracle", + "outputs": [ + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getTokenConfig", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getUnderlyingPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nativeMarket", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "setOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "updateAssetPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "updatePrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vai", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-790/abi/SingleTokenConverter.json b/simulations/vip-790/abi/SingleTokenConverter.json new file mode 100644 index 000000000..3b50af1a6 --- /dev/null +++ b/simulations/vip-790/abi/SingleTokenConverter.json @@ -0,0 +1,1622 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "corePoolComptroller_", + "type": "address" + }, + { + "internalType": "address", + "name": "vBNB_", + "type": "address" + }, + { + "internalType": "address", + "name": "nativeWrapped_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidArguments", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "MarketNotExistInPool", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [], + "name": "ReentrancyGuardError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferredToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "value", + "type": "bool" + } + ], + "name": "PoolAssetsDirectTransferUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NATIVE_WRAPPED", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "VBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "conversionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "converterNetwork", + "outputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "destinationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getPoolAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "reserves", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "getPools", + "outputs": [ + { + "internalType": "address[]", + "name": "poolsWithCore", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + }, + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + }, + { + "internalType": "address", + "name": "poolRegistry_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "comptrollers", + "type": "address[]" + }, + { + "internalType": "address[][]", + "name": "assets", + "type": "address[][]" + }, + { + "internalType": "bool[][]", + "name": "values", + "type": "bool[][]" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "poolsAssetsDirectTransfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ + { + "internalType": "contract ResilientOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" + } + ], + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" + } + ], + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + } + ], + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "poolRegistry_", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "comptrollers", + "type": "address[]" + }, + { + "internalType": "address[][]", + "name": "assets", + "type": "address[][]" + }, + { + "internalType": "bool[][]", + "name": "values", + "type": "bool[][]" + } + ], + "name": "setPoolsAssetsDirectTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-790/abi/VToken.json b/simulations/vip-790/abi/VToken.json new file mode 100644 index 000000000..61a618463 --- /dev/null +++ b/simulations/vip-790/abi/VToken.json @@ -0,0 +1,1747 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "cashPrior", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "interestAccumulated", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "AccrueInterest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "LiquidateBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + } + ], + "name": "MintBehalf", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ComptrollerInterface", + "name": "oldComptroller", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ComptrollerInterface", + "name": "newComptroller", + "type": "address" + } + ], + "name": "NewComptroller", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract InterestRateModel", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "NewMarketInterestRateModel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldProtocolShareReserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newProtocolShareReserve", + "type": "address" + } + ], + "name": "NewProtocolShareReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldReduceReservesBlockDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReduceReservesBlockDelta", + "type": "uint256" + } + ], + "name": "NewReduceReservesBlockDelta", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactorMantissa", + "type": "uint256" + } + ], + "name": "NewReserveFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "RedeemFee", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "RepayBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "benefactor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "ReservesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "protocolShareReserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "ReservesReduced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [], + "name": "_acceptAdmin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + } + ], + "name": "_addReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "reduceAmount_", + "type": "uint256" + } + ], + "name": "_reduceReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "newComptroller", + "type": "address" + } + ], + "name": "_setComptroller", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel_", + "type": "address" + } + ], + "name": "_setInterestRateModel", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address payable", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "_setPendingAdmin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "newReserveFactorMantissa_", + "type": "uint256" + } + ], + "name": "_setReserveFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "accrueInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOfUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptroller", + "outputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "exchangeRateStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract ComptrollerInterface", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract InterestRateModel", + "name": "interestRateModel_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialExchangeRateMantissa_", + "type": "uint256" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract InterestRateModel", + "name": "interestRateModel_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialExchangeRateMantissa_", + "type": "uint256" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "interestRateModel", + "outputs": [ + { + "internalType": "contract InterestRateModel", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isVToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "contract VTokenInterface", + "name": "vTokenCollateral", + "type": "address" + } + ], + "name": "liquidateBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "protocolShareReserve", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + } + ], + "name": "redeemUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + } + ], + "name": "redeemUnderlyingBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "reduceReservesBlockDelta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "reduceReservesBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlManagerAddress", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address payable", + "name": "protcolShareReserve_", + "type": "address" + } + ], + "name": "setProtocolShareReserve", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "newReduceReservesBlockDelta_", + "type": "uint256" + } + ], + "name": "setReduceReservesBlockDelta", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalBorrows", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-790/abi/VTreasury.json b/simulations/vip-790/abi/VTreasury.json new file mode 100644 index 000000000..df5a655ee --- /dev/null +++ b/simulations/vip-790/abi/VTreasury.json @@ -0,0 +1,83 @@ +[ + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "tokenAddress", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "WithdrawTreasuryBEP20", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "WithdrawTreasuryBNB", + "type": "event" + }, + { "payable": true, "stateMutability": "payable", "type": "fallback" }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "tokenAddress", "type": "address" }, + { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "internalType": "address", "name": "withdrawAddress", "type": "address" } + ], + "name": "withdrawTreasuryBEP20", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, + { "internalType": "address payable", "name": "withdrawAddress", "type": "address" } + ], + "name": "withdrawTreasuryBNB", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + } +] diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-790/bsctestnet.ts new file mode 100644 index 000000000..b479d6946 --- /dev/null +++ b/simulations/vip-790/bsctestnet.ts @@ -0,0 +1,224 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents, initMainnetUser } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; +import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameters"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { + CONVERSION_INCENTIVE, + EMODE_POOL, + PROTOCOL_SHARE_RESERVE, + RATE_MODEL, + convertAmountToVTokens, + converterBaseAssets, + marketSpecs, + vip790, +} from "../../vips/vip-790/bsctestnet"; +import COMPTROLLER_ABI from "./abi/Comptroller.json"; +import ERC20_ABI from "./abi/ERC20.json"; +import REDSTONE_ORACLE_ABI from "./abi/RedstoneOracle.json"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; +import VTOKEN_ABI from "./abi/VToken.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +forking(82651485, async () => { + let comptroller: Contract; + let resilientOracle: Contract; + let PT_slisBNBx_24JUN2026: Contract; + let vPT_slisBNBx_24JUN2026: Contract; + + before(async () => { + const provider = ethers.provider; + comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); + PT_slisBNBx_24JUN2026 = new ethers.Contract(marketSpecs.vToken.underlying.address, ERC20_ABI, provider); + vPT_slisBNBx_24JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); + resilientOracle = new ethers.Contract(bsctestnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + // set maxStalePeriod + const asBNB = "0xc625f060ad25f4A6c2d9eBF30C133dB61B7AF072"; + const slisbnb = "0xd2aF6A916Bc77764dc63742BC30f71AF4cF423F4"; + const PT_slisBNBx_24JUN2026_address = "0x0560Ec87515eeF5E971CE41198529627DAB72094"; + const impersonatedTimelock = await initMainnetUser(bsctestnet.NORMAL_TIMELOCK, ethers.utils.parseEther("2")); + const redstoneOracle = new ethers.Contract(bsctestnet.REDSTONE_ORACLE, REDSTONE_ORACLE_ABI, ethers.provider); + await resilientOracle + .connect(impersonatedTimelock) + .setTokenConfig([ + asBNB, + [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ]); + await redstoneOracle.connect(impersonatedTimelock).setDirectPrice(asBNB, parseUnits("1", 18)); + await resilientOracle + .connect(impersonatedTimelock) + .setTokenConfig([ + slisbnb, + [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ]); + await redstoneOracle.connect(impersonatedTimelock).setDirectPrice(slisbnb, parseUnits("1", 18)); + await resilientOracle + .connect(impersonatedTimelock) + .setTokenConfig([ + PT_slisBNBx_24JUN2026_address, + [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ]); + await redstoneOracle + .connect(impersonatedTimelock) + .setDirectPrice(PT_slisBNBx_24JUN2026_address, parseUnits("1", 18)); + }); + + describe("Pre-VIP behavior", async () => { + it("check PT_slisBNBx_24JUN2026 market not listed", async () => { + const market = await comptroller.markets(marketSpecs.vToken.address); + expect(market.isListed).to.equal(false); + }); + + it("check BNB Emode PoolId exist", async () => { + expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); + }); + }); + + testVip("VIP-790", await vip790(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [COMPTROLLER_ABI, VTOKEN_ABI], + [ + "MarketListed", + "NewSupplyCap", + "NewBorrowCap", + "NewAccessControlManager", + "NewProtocolShareReserve", + "NewReduceReservesBlockDelta", + "NewReserveFactor", + "NewCollateralFactor", + "NewLiquidationThreshold", + "NewLiquidationIncentive", + "PoolMarketInitialized", + ], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], + ); + }, + }); + + describe("Post-VIP behavior", async () => { + it("check new IRM", async () => { + expect(await vPT_slisBNBx_24JUN2026.interestRateModel()).to.equal(RATE_MODEL); + }); + + checkInterestRate(RATE_MODEL, "vPT_slisBNBx_24JUN2026", { + base: marketSpecs.interestRateModel.baseRatePerYear, + multiplier: marketSpecs.interestRateModel.multiplierPerYear, + jump: marketSpecs.interestRateModel.jumpMultiplierPerYear, + kink: marketSpecs.interestRateModel.kink, + }); + + checkVToken(marketSpecs.vToken.address, { + name: marketSpecs.vToken.name, + symbol: marketSpecs.vToken.symbol, + decimals: marketSpecs.vToken.decimals, + underlying: marketSpecs.vToken.underlying.address, + exchangeRate: marketSpecs.vToken.exchangeRate, + comptroller: marketSpecs.vToken.comptroller, + }); + + checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); + + it("check price PT_slisBNBx_24JUN2026", async () => { + const expectedPrice = "1000000000000000000"; + expect(await resilientOracle.getPrice(marketSpecs.vToken.underlying.address)).to.equal(expectedPrice); + expect(await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address)).to.equal(expectedPrice); + }); + + it("market have correct owner", async () => { + expect(await vPT_slisBNBx_24JUN2026.admin()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + + it("market have correct ACM", async () => { + expect(await vPT_slisBNBx_24JUN2026.accessControlManager()).to.equal(bsctestnet.ACCESS_CONTROL_MANAGER); + }); + + it("market should have correct protocol share reserve", async () => { + expect(await vPT_slisBNBx_24JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); + }); + + it("market should have correct total supply", async () => { + const vPT_slisBNBx_24JUN2026Supply = await vPT_slisBNBx_24JUN2026.totalSupply(); + expect(vPT_slisBNBx_24JUN2026Supply).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), + ); + }); + + it("market should have balance of underlying", async () => { + const PT_slisBNBx_24JUN2026_balance = await PT_slisBNBx_24JUN2026.balanceOf(vPT_slisBNBx_24JUN2026.address); + expect(PT_slisBNBx_24JUN2026_balance).to.greaterThan(0); + }); + + it("should burn vTokens", async () => { + const vPT_slisBNBx_24JUN2026BalanceBurned = await vPT_slisBNBx_24JUN2026.balanceOf(ethers.constants.AddressZero); + expect(vPT_slisBNBx_24JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); + }); + + it("should transfer remaining vTokens to receiver", async () => { + const slisBNBReceiverBalance = await vPT_slisBNBx_24JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); + expect(slisBNBReceiverBalance).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( + marketSpecs.initialSupply.vTokensToBurn, + ), + ); + }); + + it("should not leave any vTokens in the timelock", async () => { + const vPT_slisBNBx_24JUN2026TimelockBalance = await vPT_slisBNBx_24JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); + expect(vPT_slisBNBx_24JUN2026TimelockBalance).to.equal(0); + }); + + it("should pause vPT_slisBNBx_24JUN2026 market", async () => { + expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); + }); + + it("should set borrowAllowed to False for vPT_slisBNBx_24JUN2026 market", async () => { + const vPT_slisBNBx_24JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); + expect(vPT_slisBNBx_24JUN2026Market.isBorrowAllowed).to.equal(false); + }); + + describe("Converters", () => { + for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { + const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_slisBNBx_24JUN2026`, async () => { + const result = await converterContract.conversionConfigurations( + baseAsset, + marketSpecs.vToken.underlying.address, + ); + expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + }); + } + }); + + describe("emode", () => { + it("should set the correct risk parameters to all pool markets", async () => { + for (const config of Object.values(EMODE_POOL.marketsConfig)) { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); + expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); + expect(marketData.isListed).to.be.equal(true); + expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); + expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); + expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); + expect(marketData.isBorrowAllowed).to.be.equal(config.borrowAllowed); + } + }); + }); + }); +}); diff --git a/src/vip-framework/checks/interestRateModel.ts b/src/vip-framework/checks/interestRateModel.ts index 21bd273e3..acf12b324 100644 --- a/src/vip-framework/checks/interestRateModel.ts +++ b/src/vip-framework/checks/interestRateModel.ts @@ -6,7 +6,7 @@ import RATE_MODEL_ABI from "../abi/il_rateModel.json"; import TWO_KINKS_RATE_MODEL_ABI from "../abi/twoKinksIRM.json"; import TWO_KINKS_RATE_MODEL_IL_ABI from "../abi/twoKinksIRMIL.json"; -const DEFAULT_BLOCKS_PER_YEAR = BigNumber.from(42048000); +const DEFAULT_BLOCKS_PER_YEAR = BigNumber.from(70080000); export function checkInterestRate( rateModelAddress: string, diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts new file mode 100644 index 000000000..9679d2c0b --- /dev/null +++ b/vips/vip-790/bsctestnet.ts @@ -0,0 +1,269 @@ +import { BigNumber, BigNumberish } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { bsctestnet } = NETWORK_ADDRESSES; +export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; +export const PROTOCOL_SHARE_RESERVE = "0x25c7c7D6Bf710949fD7f03364E9BA19a1b3c10E3"; +export const PT_slisBNBx_24JUN2026 = "0x0560Ec87515eeF5E971CE41198529627DAB72094"; +export const vPT_slisBNBx_24JUN2026 = "0xA9cD767e434A71Cb8173079b4eF7494F71D79180"; +export const RATE_MODEL = "0x274362695401Bb1B0468BfcFE448AD7021D97562"; +export const REDUCE_RESERVES_BLOCK_DELTA = "192000"; // 70080000 blocks per year + +// Converters +const ETH = "0x98f7A83361F7Ac8765CcEBAB1425da6b341958a7"; +const USDT = "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c"; +const USDC = "0x16227D60f7a0e586C66B005219dfc887D13C9531"; +const BTCB = "0xA808e341e8e723DC6BA0Bb5204Bafc2330d7B8e4"; +const XVS = "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff"; +const WBNB = "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd"; +const WBNB_BURN_CONVERTER = "0x42DBA48e7cCeB030eC73AaAe29d4A3F0cD4facba"; +const RISK_FUND_CONVERTER = "0x32Fbf7bBbd79355B86741E3181ef8c1D9bD309Bb"; +const USDT_PRIME_CONVERTER = "0xf1FA230D25fC5D6CAfe87C5A6F9e1B17Bc6F194E"; +const USDC_PRIME_CONVERTER = "0x2ecEdE6989d8646c992344fF6C97c72a3f811A13"; +const BTCB_PRIME_CONVERTER = "0x989A1993C023a45DA141928921C0dE8fD123b7d1"; +const ETH_PRIME_CONVERTER = "0xf358650A007aa12ecC8dac08CF8929Be7f72A4D9"; +const XVS_VAULT_CONVERTER = "0x258f49254C758a0E37DAb148ADDAEA851F4b02a2"; +export const CONVERSION_INCENTIVE = 1e14; + +export const converterBaseAssets = { + [RISK_FUND_CONVERTER]: USDT, + [USDT_PRIME_CONVERTER]: USDT, + [USDC_PRIME_CONVERTER]: USDC, + [BTCB_PRIME_CONVERTER]: BTCB, + [ETH_PRIME_CONVERTER]: ETH, + [XVS_VAULT_CONVERTER]: XVS, + [WBNB_BURN_CONVERTER]: WBNB, +}; + +export const marketSpecs = { + vToken: { + address: vPT_slisBNBx_24JUN2026, + name: "Venus PT-slisBNBx-24JUN2026", + symbol: "vPT-slisBNBx-24JUN2026", + underlying: { + address: PT_slisBNBx_24JUN2026, + decimals: 18, + symbol: "PT-slisBNBx-24JUN2026", + }, + decimals: 8, + exchangeRate: parseUnits("1", 28), + comptroller: bsctestnet.UNITROLLER, + isLegacyPool: true, + }, + interestRateModel: { + model: "jump", + baseRatePerYear: "0", + multiplierPerYear: "0.09", + jumpMultiplierPerYear: "2", + kink: "0.5", + }, + riskParameters: { + collateralFactor: parseUnits("0", 18), + liquidationThreshold: parseUnits("0", 18), + liquidationIncentive: parseUnits("1", 18), + reserveFactor: parseUnits("0", 18), + supplyCap: parseUnits("25000", 18), + borrowCap: parseUnits("0", 18), + }, + initialSupply: { + amount: parseUnits("0.14", 18), + vTokenReceiver: bsctestnet.VTREASURY, + vTokensToBurn: parseUnits("0.1", 8), + }, +}; + +// BNB emode group +export const EMODE_POOL = { + label: "BNB", + id: 4, + markets: [vPT_slisBNBx_24JUN2026], + allowCorePoolFallback: true, + marketsConfig: { + vPT_slisBNBx_24JUN2026: { + address: vPT_slisBNBx_24JUN2026, + collateralFactor: parseUnits("0.87", 18), + liquidationThreshold: parseUnits("0.90", 18), + liquidationIncentive: parseUnits("1.04", 18), + borrowAllowed: false, + }, + }, +}; + +export const convertAmountToVTokens = (amount: BigNumber, exchangeRate: BigNumber) => { + const EXP_SCALE = parseUnits("1", 18); + return amount.mul(EXP_SCALE).div(exchangeRate); +}; + +const vTokensMinted = convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate); +const vTokensRemaining = vTokensMinted.sub(marketSpecs.initialSupply.vTokensToBurn); + +const configureConverters = (fromAssets: string[], incentive: BigNumberish = CONVERSION_INCENTIVE) => { + enum ConversionAccessibility { + NONE = 0, + ALL = 1, + ONLY_FOR_CONVERTERS = 2, + ONLY_FOR_USERS = 3, + } + + return Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => { + const conversionConfigs = fromAssets.map(() => [incentive, ConversionAccessibility.ALL]); + return { + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, fromAssets, conversionConfigs], + }; + }); +}; + +export const vip790 = () => { + const meta = { + version: "v2", + title: "VIP-790 [BNB Chain] Add PT-slisBNBx-24JUN2026 market to the BNB emode group", + description: "VIP-790 [BNB Chain] BNB emode group", + forDescription: "I agree that Venus Protocol should proceed with this proposal", + againstDescription: "I do not think that Venus Protocol should proceed with this proposal", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", + }; + + return makeProposal( + [ + // Add Market + { + target: marketSpecs.vToken.comptroller, + signature: "_supportMarket(address)", + params: [marketSpecs.vToken.address], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setMarketSupplyCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setMarketBorrowCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.borrowCap]], + }, + { + target: marketSpecs.vToken.address, + signature: "setAccessControlManager(address)", + params: [bsctestnet.ACCESS_CONTROL_MANAGER], + }, + { + target: marketSpecs.vToken.address, + signature: "setProtocolShareReserve(address)", + params: [PROTOCOL_SHARE_RESERVE], + }, + { + target: marketSpecs.vToken.address, + signature: "setReduceReservesBlockDelta(uint256)", + params: [REDUCE_RESERVES_BLOCK_DELTA], + }, + { + target: marketSpecs.vToken.address, + signature: "_setReserveFactor(uint256)", + params: [marketSpecs.riskParameters.reserveFactor], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "setCollateralFactor(address,uint256,uint256)", + params: [ + marketSpecs.vToken.address, + marketSpecs.riskParameters.collateralFactor, + marketSpecs.riskParameters.liquidationThreshold, + ], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "setLiquidationIncentive(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], + }, + { + target: PT_slisBNBx_24JUN2026, + signature: "faucet(uint256)", + params: [marketSpecs.initialSupply.amount], + }, + { + target: marketSpecs.vToken.underlying.address, + signature: "approve(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.initialSupply.amount], + }, + { + target: marketSpecs.vToken.address, + signature: "mint(uint256)", + params: [marketSpecs.initialSupply.amount], + }, + { + target: marketSpecs.vToken.underlying.address, + signature: "approve(address,uint256)", + params: [marketSpecs.vToken.address, 0], + }, + // Burn some vTokens + { + target: marketSpecs.vToken.address, + signature: "transfer(address,uint256)", + params: [ethers.constants.AddressZero, marketSpecs.initialSupply.vTokensToBurn], + }, + // Transfer leftover vTokens to receiver + { + target: marketSpecs.vToken.address, + signature: "transfer(address,uint256)", + params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setActionsPaused(address[],uint8[],bool)", + params: [[marketSpecs.vToken.address], [2], true], // Pause Borrow actions + }, + + ...configureConverters([marketSpecs.vToken.underlying.address]), + + // BNB Emode Group + { + target: bsctestnet.UNITROLLER, + signature: "setPoolActive(uint96,bool)", + params: [EMODE_POOL.id, true], + }, + { + target: bsctestnet.UNITROLLER, + signature: "addPoolMarkets(uint96[],address[])", + params: [Array(EMODE_POOL.markets.length).fill(EMODE_POOL.id), EMODE_POOL.markets], + }, + { + target: bsctestnet.UNITROLLER, + signature: "setCollateralFactor(uint96,address,uint256,uint256)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.collateralFactor, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.liquidationThreshold, + ], + }, + { + target: bsctestnet.UNITROLLER, + signature: "setLiquidationIncentive(uint96,address,uint256)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.liquidationIncentive, + ], + }, + { + target: bsctestnet.UNITROLLER, + signature: "setIsBorrowAllowed(uint96,address,bool)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, + EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.borrowAllowed, + ], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip790; From 330fb39bdbb612e6725f4918352772a88b03fe5b Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 13 Jan 2026 20:51:48 +0530 Subject: [PATCH 02/14] feat updated PT_clisBNB_25JUN2026 VIP --- simulations/vip-790/abi/CappedOracle.json | 227 +++ simulations/vip-790/abi/VToken.json | 1555 +++++---------------- simulations/vip-790/bsctestnet.ts | 316 +++-- vips/vip-790/bsctestnet.ts | 121 +- 4 files changed, 834 insertions(+), 1385 deletions(-) create mode 100644 simulations/vip-790/abi/CappedOracle.json diff --git a/simulations/vip-790/abi/CappedOracle.json b/simulations/vip-790/abi/CappedOracle.json new file mode 100644 index 000000000..d0fd7248e --- /dev/null +++ b/simulations/vip-790/abi/CappedOracle.json @@ -0,0 +1,227 @@ +[ + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "address", "name": "ptOracle", "type": "address" }, + { "internalType": "enum PendleOracle.RateKind", "name": "rateKind", "type": "uint8" }, + { "internalType": "address", "name": "ptToken", "type": "address" }, + { "internalType": "address", "name": "underlyingToken", "type": "address" }, + { "internalType": "address", "name": "resilientOracle", "type": "address" }, + { "internalType": "uint32", "name": "twapDuration", "type": "uint32" }, + { "internalType": "uint256", "name": "annualGrowthRate", "type": "uint256" }, + { "internalType": "uint256", "name": "snapshotInterval", "type": "uint256" }, + { "internalType": "uint256", "name": "initialSnapshotMaxExchangeRate", "type": "uint256" }, + { "internalType": "uint256", "name": "initialSnapshotTimestamp", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" }, + { "internalType": "uint256", "name": "snapshotGap", "type": "uint256" } + ], + "internalType": "struct PendleOracle.ConstructorParams", + "name": "params", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "InvalidDuration", "type": "error" }, + { "inputs": [], "name": "InvalidGrowthRate", "type": "error" }, + { "inputs": [], "name": "InvalidInitialSnapshot", "type": "error" }, + { "inputs": [], "name": "InvalidSnapshotMaxExchangeRate", "type": "error" }, + { "inputs": [], "name": "InvalidTokenAddress", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { "inputs": [], "name": "ZeroValueNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "oldGrowthRatePerSecond", "type": "uint256" }, + { "indexed": true, "internalType": "uint256", "name": "newGrowthRatePerSecond", "type": "uint256" }, + { "indexed": true, "internalType": "uint256", "name": "oldSnapshotInterval", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newSnapshotInterval", "type": "uint256" } + ], + "name": "GrowthRateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "oldSnapshotGap", "type": "uint256" }, + { "indexed": true, "internalType": "uint256", "name": "newSnapshotGap", "type": "uint256" } + ], + "name": "SnapshotGapUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "maxExchangeRate", "type": "uint256" }, + { "indexed": true, "internalType": "uint256", "name": "timestamp", "type": "uint256" } + ], + "name": "SnapshotUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "ACCESS_CONTROL_MANAGER", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "CORRELATED_TOKEN", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MARKET", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PT_ORACLE", + "outputs": [{ "internalType": "contract IPendlePtOracle", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RATE_KIND", + "outputs": [{ "internalType": "enum PendleOracle.RateKind", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESILIENT_ORACLE", + "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "TWAP_DURATION", + "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_DECIMALS", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_TOKEN", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxAllowedExchangeRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUnderlyingAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "growthRatePerSecond", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isCapped", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_annualGrowthRate", "type": "uint256" }, + { "internalType": "uint256", "name": "_snapshotInterval", "type": "uint256" } + ], + "name": "setGrowthRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_snapshotMaxExchangeRate", "type": "uint256" }, + { "internalType": "uint256", "name": "_snapshotTimestamp", "type": "uint256" } + ], + "name": "setSnapshot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_snapshotGap", "type": "uint256" }], + "name": "setSnapshotGap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "snapshotGap", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "snapshotInterval", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "snapshotMaxExchangeRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "snapshotTimestamp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "updateSnapshot", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-790/abi/VToken.json b/simulations/vip-790/abi/VToken.json index 61a618463..68f428c6c 100644 --- a/simulations/vip-790/abi/VToken.json +++ b/simulations/vip-790/abi/VToken.json @@ -1,31 +1,39 @@ [ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { "inputs": [], "name": "FlashLoanAlreadyActive", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "fee", "type": "uint256" }, + { "internalType": "uint256", "name": "maxFee", "type": "uint256" } + ], + "name": "FlashLoanFeeTooHigh", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "fee", "type": "uint256" }, + { "internalType": "uint256", "name": "maxFee", "type": "uint256" } + ], + "name": "FlashLoanProtocolShareTooHigh", + "type": "error" + }, + { "inputs": [], "name": "InsufficientCash", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "actualAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredTotalFee", "type": "uint256" } + ], + "name": "InsufficientRepayment", + "type": "error" + }, + { "inputs": [], "name": "InvalidComptroller", "type": "error" }, { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "cashPrior", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "interestAccumulated", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "borrowIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - } + { "indexed": false, "internalType": "uint256", "name": "cashPrior", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "interestAccumulated", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "borrowIndex", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } ], "name": "AccrueInterest", "type": "event" @@ -33,24 +41,9 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Approval", "type": "event" @@ -58,30 +51,10 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "accountBorrows", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } ], "name": "Borrow", "type": "event" @@ -89,24 +62,9 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "error", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "info", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "detail", - "type": "uint256" - } + { "indexed": false, "internalType": "uint256", "name": "error", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "info", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "detail", "type": "uint256" } ], "name": "Failure", "type": "event" @@ -114,36 +72,31 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "vTokenCollateral", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "seizeTokens", - "type": "uint256" - } + { "indexed": false, "internalType": "uint256", "name": "oldFlashLoanFeeMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newFlashLoanFeeMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "oldFlashLoanProtocolShare", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newFlashLoanProtocolShare", "type": "uint256" } + ], + "name": "FlashLoanFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "bool", "name": "previousStatus", "type": "bool" }, + { "indexed": false, "internalType": "bool", "name": "newStatus", "type": "bool" } + ], + "name": "FlashLoanStatusChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "liquidator", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } ], "name": "LiquidateBorrow", "type": "event" @@ -151,30 +104,10 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "minter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintTokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "minter", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "mintTokens", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } ], "name": "Mint", "type": "event" @@ -182,36 +115,11 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "payer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "mintTokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "payer", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "mintTokens", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } ], "name": "MintBehalf", "type": "event" @@ -219,18 +127,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAccessControlAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAccessControlAddress", - "type": "address" - } + { "indexed": false, "internalType": "address", "name": "oldAccessControlAddress", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlAddress", "type": "address" } ], "name": "NewAccessControlManager", "type": "event" @@ -238,18 +136,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } + { "indexed": false, "internalType": "address", "name": "oldAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } ], "name": "NewAdmin", "type": "event" @@ -263,12 +151,7 @@ "name": "oldComptroller", "type": "address" }, - { - "indexed": false, - "internalType": "contract ComptrollerInterface", - "name": "newComptroller", - "type": "address" - } + { "indexed": false, "internalType": "contract ComptrollerInterface", "name": "newComptroller", "type": "address" } ], "name": "NewComptroller", "type": "event" @@ -278,13 +161,13 @@ "inputs": [ { "indexed": false, - "internalType": "contract InterestRateModel", + "internalType": "contract InterestRateModelV8", "name": "oldInterestRateModel", "type": "address" }, { "indexed": false, - "internalType": "contract InterestRateModel", + "internalType": "contract InterestRateModelV8", "name": "newInterestRateModel", "type": "address" } @@ -295,18 +178,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldPendingAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newPendingAdmin", - "type": "address" - } + { "indexed": false, "internalType": "address", "name": "oldPendingAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingAdmin", "type": "address" } ], "name": "NewPendingAdmin", "type": "event" @@ -314,18 +187,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "oldProtocolShareReserve", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newProtocolShareReserve", - "type": "address" - } + { "indexed": true, "internalType": "address", "name": "oldProtocolShareReserve", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newProtocolShareReserve", "type": "address" } ], "name": "NewProtocolShareReserve", "type": "event" @@ -333,18 +196,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldReduceReservesBlockDelta", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newReduceReservesBlockDelta", - "type": "uint256" - } + { "indexed": false, "internalType": "uint256", "name": "oldReduceReservesBlockDelta", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newReduceReservesBlockDelta", "type": "uint256" } ], "name": "NewReduceReservesBlockDelta", "type": "event" @@ -352,18 +205,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldReserveFactorMantissa", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newReserveFactorMantissa", - "type": "uint256" - } + { "indexed": false, "internalType": "uint256", "name": "oldReserveFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newReserveFactorMantissa", "type": "uint256" } ], "name": "NewReserveFactor", "type": "event" @@ -371,30 +214,10 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "redeemer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "redeemAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "redeemTokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalSupply", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "redeemer", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } ], "name": "Redeem", "type": "event" @@ -402,24 +225,9 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "redeemer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "redeemTokens", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "redeemer", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } ], "name": "RedeemFee", "type": "event" @@ -427,36 +235,11 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "payer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "accountBorrows", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "totalBorrows", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "payer", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } ], "name": "RepayBorrow", "type": "event" @@ -464,24 +247,9 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "benefactor", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "addAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newTotalReserves", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "benefactor", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "addAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } ], "name": "ReservesAdded", "type": "event" @@ -489,24 +257,9 @@ { "anonymous": false, "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "protocolShareReserve", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reduceAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newTotalReserves", - "type": "uint256" - } + { "indexed": false, "internalType": "address", "name": "protocolShareReserve", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reduceAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } ], "name": "ReservesReduced", "type": "event" @@ -514,1233 +267,603 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { - "constant": false, + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalFee", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "name": "TransferInUnderlyingFlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "TransferOutUnderlyingFlashLoan", + "type": "event" + }, + { "inputs": [], "name": "_acceptAdmin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "addAmount", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "addAmount", "type": "uint256" }], "name": "_addReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "reduceAmount_", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], + "name": "_becomeImplementation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "reduceAmount_", "type": "uint256" }], "name": "_reduceReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, + { "inputs": [], "name": "_resignImplementation", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "contract ComptrollerInterface", - "name": "newComptroller", - "type": "address" - } - ], + "inputs": [{ "internalType": "contract ComptrollerInterface", "name": "newComptroller", "type": "address" }], "name": "_setComptroller", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "contract InterestRateModel", - "name": "newInterestRateModel_", - "type": "address" - } - ], + "inputs": [{ "internalType": "contract InterestRateModelV8", "name": "newInterestRateModel_", "type": "address" }], "name": "_setInterestRateModel", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "address payable", - "name": "newPendingAdmin", - "type": "address" - } - ], + "inputs": [{ "internalType": "address payable", "name": "newPendingAdmin", "type": "address" }], "name": "_setPendingAdmin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "newReserveFactorMantissa_", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "newReserveFactorMantissa_", "type": "uint256" }], "name": "_setReserveFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "accessControlManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "accrualBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [], "name": "accrueInterest", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "admin", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } ], "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "balanceOfUnderlying", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }], "name": "borrow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "borrowBalanceCurrent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "borrowBalanceStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "uint256", - "name": "borrowAmount", - "type": "uint256" - } + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } ], "name": "borrowBehalf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "borrowIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "borrowRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], + "name": "calculateFlashLoanFee", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], - "payable": false, "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "comptroller", - "outputs": [ - { - "internalType": "contract ComptrollerInterface", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "contract ComptrollerInterface", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [], "name": "exchangeRateCurrent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "exchangeRateStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flashLoanAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } ], + "name": "flashLoanDebtPosition", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flashLoanFeeMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flashLoanProtocolShareMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "getAccountSnapshot", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } ], - "payable": false, "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], - "name": "getCash", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "name": "getCash", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "underlying_", - "type": "address" - }, - { - "internalType": "contract ComptrollerInterface", - "name": "comptroller_", - "type": "address" - }, - { - "internalType": "contract InterestRateModel", - "name": "interestRateModel_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialExchangeRateMantissa_", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name_", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol_", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - } + { "internalType": "address", "name": "underlying_", "type": "address" }, + { "internalType": "contract ComptrollerInterface", "name": "comptroller_", "type": "address" }, + { "internalType": "contract InterestRateModelV8", "name": "interestRateModel_", "type": "address" }, + { "internalType": "uint256", "name": "initialExchangeRateMantissa_", "type": "uint256" }, + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" }, + { "internalType": "uint8", "name": "decimals_", "type": "uint8" } ], "name": "initialize", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "contract ComptrollerInterface", - "name": "comptroller_", - "type": "address" - }, - { - "internalType": "contract InterestRateModel", - "name": "interestRateModel_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "initialExchangeRateMantissa_", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name_", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol_", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - } + { "internalType": "contract ComptrollerInterface", "name": "comptroller_", "type": "address" }, + { "internalType": "contract InterestRateModelV8", "name": "interestRateModel_", "type": "address" }, + { "internalType": "uint256", "name": "initialExchangeRateMantissa_", "type": "uint256" }, + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" }, + { "internalType": "uint8", "name": "decimals_", "type": "uint8" } ], "name": "initialize", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "interestRateModel", - "outputs": [ - { - "internalType": "contract InterestRateModel", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "contract InterestRateModelV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isFlashLoanEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "isVToken", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - }, - { - "internalType": "contract VTokenInterface", - "name": "vTokenCollateral", - "type": "address" - } + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "contract VTokenInterface", "name": "vTokenCollateral", "type": "address" } ], "name": "liquidateBorrow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "mintAmount", "type": "uint256" }], "name": "mint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "mintAmount", - "type": "uint256" - } + { "internalType": "address", "name": "receiver", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } ], "name": "mintBehalf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "pendingAdmin", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "protocolShareReserve", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "redeemTokens", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }], "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "redeemer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "redeemTokens", - "type": "uint256" - } + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } ], "name": "redeemBehalf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "redeemAmount", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }], "name": "redeemUnderlying", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "redeemer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "redeemAmount", - "type": "uint256" - } + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" } ], "name": "redeemUnderlyingBehalf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "reduceReservesBlockDelta", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "reduceReservesBlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "repayAmount", "type": "uint256" }], "name": "repayBorrow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "uint256", - "name": "repayAmount", - "type": "uint256" - } + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } ], "name": "repayBorrowBehalf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "reserveFactorMantissa", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "liquidator", - "type": "address" - }, - { - "internalType": "address", - "name": "borrower", - "type": "address" - }, - { - "internalType": "uint256", - "name": "seizeTokens", - "type": "uint256" - } + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } ], "name": "seize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "newAccessControlManagerAddress", - "type": "address" - } - ], + "inputs": [{ "internalType": "address", "name": "newAccessControlManagerAddress", "type": "address" }], "name": "setAccessControlManager", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "enabled", "type": "bool" }], + "name": "setFlashLoanEnabled", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address payable", - "name": "protcolShareReserve_", - "type": "address" - } + { "internalType": "uint256", "name": "flashLoanFeeMantissa_", "type": "uint256" }, + { "internalType": "uint256", "name": "flashLoanProtocolShare_", "type": "uint256" } ], + "name": "setFlashLoanFeeMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address payable", "name": "protcolShareReserve_", "type": "address" }], "name": "setProtocolShareReserve", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "newReduceReservesBlockDelta_", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "uint256", "name": "newReduceReservesBlockDelta_", "type": "uint256" }], "name": "setReduceReservesBlockDelta", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "supplyRatePerBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "payable": false, + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "totalBorrows", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [], "name": "totalBorrowsCurrent", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "totalReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": true, "inputs": [], "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, "inputs": [ - { - "internalType": "address", - "name": "src", - "type": "address" - }, - { - "internalType": "address", - "name": "dst", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address payable", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "repaymentAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "totalFee", "type": "uint256" }, + { "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "name": "transferInUnderlyingFlashLoan", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address payable", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } ], - "payable": false, + "name": "transferOutUnderlyingFlashLoan", + "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, "inputs": [], "name": "underlying", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" } diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-790/bsctestnet.ts index b479d6946..487622753 100644 --- a/simulations/vip-790/bsctestnet.ts +++ b/simulations/vip-790/bsctestnet.ts @@ -1,92 +1,104 @@ import { expect } from "chai"; -import { Contract } from "ethers"; -import { parseUnits } from "ethers/lib/utils"; +import { BigNumber } from "ethers"; +import { formatUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { expectEvents, initMainnetUser } from "src/utils"; -import { forking, testVip } from "src/vip-framework"; +import { + expectEvents, + setMaxStalePeriod, // initMainnetUser +} from "src/utils"; import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameters"; import { checkVToken } from "src/vip-framework/checks/checkVToken"; import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; +import { forking, testVip } from "src/vip-framework/index"; -import { +import vip790, { CONVERSION_INCENTIVE, EMODE_POOL, + MAIN_ORACLE_ROLE, PROTOCOL_SHARE_RESERVE, + PT_clisBNB_25JUN2026, RATE_MODEL, convertAmountToVTokens, converterBaseAssets, - marketSpecs, - vip790, + marketSpecs, // PT_clisBNB_25JUN2026_PENDLE_ORACLE, } from "../../vips/vip-790/bsctestnet"; +import CAPPED_ORACLE_ABI from "./abi/CappedOracle.json"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; import ERC20_ABI from "./abi/ERC20.json"; -import REDSTONE_ORACLE_ABI from "./abi/RedstoneOracle.json"; import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; import VTOKEN_ABI from "./abi/VToken.json"; -const { bsctestnet } = NETWORK_ADDRESSES; +const BLOCKS_PER_YEAR = BigNumber.from(10512000); + +const { RESILIENT_ORACLE, ACCESS_CONTROL_MANAGER, NORMAL_TIMELOCK, UNITROLLER } = NETWORK_ADDRESSES.bsctestnet; -forking(82651485, async () => { - let comptroller: Contract; - let resilientOracle: Contract; - let PT_slisBNBx_24JUN2026: Contract; - let vPT_slisBNBx_24JUN2026: Contract; +const format = (amount: BigNumber, spec: { decimals: number; symbol: string }) => + `${formatUnits(amount, spec.decimals)} ${spec.symbol}`; + +forking(83980292, async () => { + const resilientOracle = new ethers.Contract(RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + const comptroller = new ethers.Contract(UNITROLLER, COMPTROLLER_ABI, ethers.provider); + const vToken = marketSpecs.vToken; + const vTokenContract = new ethers.Contract(vToken.address, VTOKEN_ABI, ethers.provider); + const slisBNB = new ethers.Contract("0xd2aF6A916Bc77764dc63742BC30f71AF4cF423F4", ERC20_ABI, ethers.provider); + const WBNB = new ethers.Contract("0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", ERC20_ABI, ethers.provider); before(async () => { - const provider = ethers.provider; - comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); - PT_slisBNBx_24JUN2026 = new ethers.Contract(marketSpecs.vToken.underlying.address, ERC20_ABI, provider); - vPT_slisBNBx_24JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); - resilientOracle = new ethers.Contract(bsctestnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); - - // set maxStalePeriod - const asBNB = "0xc625f060ad25f4A6c2d9eBF30C133dB61B7AF072"; - const slisbnb = "0xd2aF6A916Bc77764dc63742BC30f71AF4cF423F4"; - const PT_slisBNBx_24JUN2026_address = "0x0560Ec87515eeF5E971CE41198529627DAB72094"; - const impersonatedTimelock = await initMainnetUser(bsctestnet.NORMAL_TIMELOCK, ethers.utils.parseEther("2")); - const redstoneOracle = new ethers.Contract(bsctestnet.REDSTONE_ORACLE, REDSTONE_ORACLE_ABI, ethers.provider); - await resilientOracle - .connect(impersonatedTimelock) - .setTokenConfig([ - asBNB, - [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], - [true, false, false], - false, - ]); - await redstoneOracle.connect(impersonatedTimelock).setDirectPrice(asBNB, parseUnits("1", 18)); - await resilientOracle - .connect(impersonatedTimelock) - .setTokenConfig([ - slisbnb, - [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], - [true, false, false], - false, - ]); - await redstoneOracle.connect(impersonatedTimelock).setDirectPrice(slisbnb, parseUnits("1", 18)); - await resilientOracle - .connect(impersonatedTimelock) - .setTokenConfig([ - PT_slisBNBx_24JUN2026_address, - [bsctestnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], - [true, false, false], - false, - ]); - await redstoneOracle - .connect(impersonatedTimelock) - .setDirectPrice(PT_slisBNBx_24JUN2026_address, parseUnits("1", 18)); + // // Note: When we are calling setTokenConfig here in the pre-VIP setup, we are able to get getOracle and getPrice + // // import initMainnetUser and PT_clisBNB_25JUN2026_PENDLE_ORACLE + // const impersonatedTimelock = await initMainnetUser(NORMAL_TIMELOCK, ethers.utils.parseEther("2")); + // await resilientOracle + // .connect(impersonatedTimelock) + // .setTokenConfig([ + // PT_clisBNB_25JUN2026, + // [PT_clisBNB_25JUN2026_PENDLE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + // [true, false, false], + // false, + // ]); + + await setMaxStalePeriod(resilientOracle, slisBNB); + + await setMaxStalePeriod(resilientOracle, WBNB); }); - describe("Pre-VIP behavior", async () => { - it("check PT_slisBNBx_24JUN2026 market not listed", async () => { - const market = await comptroller.markets(marketSpecs.vToken.address); - expect(market.isListed).to.equal(false); + describe("Pre-VIP behavior", () => { + it("should have correct number of markets in the core pool", async () => { + const markets = await comptroller.getAllMarkets(); + expect(markets).to.not.contain(vToken.address); }); - it("check BNB Emode PoolId exist", async () => { - expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); + it("should not have PT-clisBNB-25JUN2026 in BNB emode group", async () => { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); + expect(marketData.isListed).to.equal(false); }); + + it("should have zero collateral factor", async () => { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); + const coreMarketData = await comptroller.markets(vToken.address); + console.log("Collateral Factor in Emode Pool:", formatUnits(marketData.collateralFactorMantissa, 18)); + console.log("Collateral Factor in Core Pool:", formatUnits(coreMarketData.collateralFactorMantissa, 18)); + expect(marketData.collateralFactorMantissa).to.equal(0); + expect(coreMarketData.collateralFactorMantissa).to.equal(0); + }); + + it("check resilientOracle getOracle", async () => { + const oracleInfo = await resilientOracle.getOracle(PT_clisBNB_25JUN2026, MAIN_ORACLE_ROLE); + console.log("Oracle info before VIP:", oracleInfo); + }); + + it(`check price ${vToken.underlying.symbol}`, async () => { + await expect(resilientOracle.getPrice(PT_clisBNB_25JUN2026)).to.be.reverted; + }); + + // Note: When we call setTokenConfig in the pre-VIP setup, getPrice will return the price. + // it(`check price ${vToken.underlying.symbol}`, async () => { + // const price = await resilientOracle.getPrice(PT_clisBNB_25JUN2026); + // console.log("Price after VIP:", price); + // const underlyingPrice = await resilientOracle.getUnderlyingPrice(vToken.address); + // console.log("Underlying Price after VIP:", underlyingPrice.toString()); + // }); }); testVip("VIP-790", await vip790(), { @@ -102,122 +114,142 @@ forking(82651485, async () => { "NewProtocolShareReserve", "NewReduceReservesBlockDelta", "NewReserveFactor", - "NewCollateralFactor", - "NewLiquidationThreshold", + // "NewCollateralFactor", // Commented out as setCollateralFactor is commented in VIP + // "NewLiquidationThreshold", // Commented out as setCollateralFactor is commented in VIP "NewLiquidationIncentive", - "PoolMarketInitialized", ], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], + [1, 1, 1, 1, 1, 1, 1, 2], + ); + await expectEvents( + txResponse, + [CAPPED_ORACLE_ABI], + ["SnapshotUpdated", "GrowthRateUpdated", "SnapshotGapUpdated"], + [1, 1, 1], ); }, }); describe("Post-VIP behavior", async () => { - it("check new IRM", async () => { - expect(await vPT_slisBNBx_24JUN2026.interestRateModel()).to.equal(RATE_MODEL); + it("Check collateral factors", async () => { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); + const coreMarketData = await comptroller.markets(vToken.address); + console.log("Collateral Factor in Emode Pool:", formatUnits(marketData.collateralFactorMantissa, 18)); + console.log("Collateral Factor in Core Pool:", formatUnits(coreMarketData.collateralFactorMantissa, 18)); }); - checkInterestRate(RATE_MODEL, "vPT_slisBNBx_24JUN2026", { - base: marketSpecs.interestRateModel.baseRatePerYear, - multiplier: marketSpecs.interestRateModel.multiplierPerYear, - jump: marketSpecs.interestRateModel.jumpMultiplierPerYear, - kink: marketSpecs.interestRateModel.kink, + it("check resilientOracle getOracle", async () => { + const oracleInfo = await resilientOracle.getOracle(PT_clisBNB_25JUN2026, MAIN_ORACLE_ROLE); + console.log("Oracle info after VIP:", oracleInfo); }); - checkVToken(marketSpecs.vToken.address, { - name: marketSpecs.vToken.name, - symbol: marketSpecs.vToken.symbol, - decimals: marketSpecs.vToken.decimals, - underlying: marketSpecs.vToken.underlying.address, - exchangeRate: marketSpecs.vToken.exchangeRate, - comptroller: marketSpecs.vToken.comptroller, + // it(`check price ${vToken.underlying.symbol}`, async () => { + // const price = await resilientOracle.getPrice(PT_clisBNB_25JUN2026); + // console.log("Price after VIP:", price.toString()); + // const underlyingPrice = await resilientOracle.getUnderlyingPrice(vToken.address); + // console.log("Underlying Price after VIP:", underlyingPrice.toString()); + // }); + + it("should have added vToken to the core pool", async () => { + const markets = await comptroller.getAllMarkets(); + expect(markets).to.contain(vToken.address); }); - checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); + describe(`Checks for ${vToken.symbol}`, () => { + it("has correct owner", async () => { + expect(await vTokenContract.admin()).to.equal(NORMAL_TIMELOCK); + }); - it("check price PT_slisBNBx_24JUN2026", async () => { - const expectedPrice = "1000000000000000000"; - expect(await resilientOracle.getPrice(marketSpecs.vToken.underlying.address)).to.equal(expectedPrice); - expect(await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address)).to.equal(expectedPrice); - }); + it("has correct ACM", async () => { + expect(await vTokenContract.accessControlManager()).to.equal(ACCESS_CONTROL_MANAGER); + }); - it("market have correct owner", async () => { - expect(await vPT_slisBNBx_24JUN2026.admin()).to.equal(bsctestnet.NORMAL_TIMELOCK); - }); + it("has correct protocol share reserve", async () => { + expect(await vTokenContract.protocolShareReserve()).equals(PROTOCOL_SHARE_RESERVE); + }); - it("market have correct ACM", async () => { - expect(await vPT_slisBNBx_24JUN2026.accessControlManager()).to.equal(bsctestnet.ACCESS_CONTROL_MANAGER); - }); + describe("Balances", () => { + const vTokenSupply = convertAmountToVTokens(marketSpecs.initialSupply.amount, vToken.exchangeRate); + const vTokenSupplyForReceiver = vTokenSupply.sub(marketSpecs.initialSupply.vTokensToBurn); - it("market should have correct protocol share reserve", async () => { - expect(await vPT_slisBNBx_24JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); - }); + it(`should have balance of underlying = ${format( + marketSpecs.initialSupply.amount, + vToken.underlying, + )}`, async () => { + const underlying = new ethers.Contract(vToken.underlying.address, ERC20_ABI, ethers.provider); + expect(await underlying.balanceOf(vToken.address)).to.equal(marketSpecs.initialSupply.amount); + }); - it("market should have correct total supply", async () => { - const vPT_slisBNBx_24JUN2026Supply = await vPT_slisBNBx_24JUN2026.totalSupply(); - expect(vPT_slisBNBx_24JUN2026Supply).to.equal( - convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), - ); - }); + it(`should have total supply of ${format(vTokenSupply, vToken)}`, async () => { + expect(await vTokenContract.totalSupply()).to.equal(vTokenSupply); + }); - it("market should have balance of underlying", async () => { - const PT_slisBNBx_24JUN2026_balance = await PT_slisBNBx_24JUN2026.balanceOf(vPT_slisBNBx_24JUN2026.address); - expect(PT_slisBNBx_24JUN2026_balance).to.greaterThan(0); - }); + it(`should send ${format(vTokenSupplyForReceiver, vToken)} to receiver`, async () => { + const receiverBalance = await vTokenContract.balanceOf(marketSpecs.initialSupply.vTokenReceiver); + expect(receiverBalance).to.equal(vTokenSupplyForReceiver); + }); - it("should burn vTokens", async () => { - const vPT_slisBNBx_24JUN2026BalanceBurned = await vPT_slisBNBx_24JUN2026.balanceOf(ethers.constants.AddressZero); - expect(vPT_slisBNBx_24JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); - }); + it(`should burn ${format(marketSpecs.initialSupply.vTokensToBurn, vToken)}`, async () => { + const burnt = await vTokenContract.balanceOf(ethers.constants.AddressZero); + expect(burnt).to.equal(marketSpecs.initialSupply.vTokensToBurn); + }); - it("should transfer remaining vTokens to receiver", async () => { - const slisBNBReceiverBalance = await vPT_slisBNBx_24JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); - expect(slisBNBReceiverBalance).to.equal( - convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( - marketSpecs.initialSupply.vTokensToBurn, - ), - ); - }); + it(`should leave no ${vToken.symbol} in the timelock`, async () => { + const timelockBalance = await vTokenContract.balanceOf(NORMAL_TIMELOCK); + expect(timelockBalance).to.equal(0); + }); + }); - it("should not leave any vTokens in the timelock", async () => { - const vPT_slisBNBx_24JUN2026TimelockBalance = await vPT_slisBNBx_24JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); - expect(vPT_slisBNBx_24JUN2026TimelockBalance).to.equal(0); - }); + it('should have name = "Venus PT Lista collateral BNB 25JUN2026"', async () => { + expect(await vTokenContract.name()).to.equal("Venus PT Lista collateral BNB 25JUN2026"); + }); - it("should pause vPT_slisBNBx_24JUN2026 market", async () => { - expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); + checkRiskParameters(vToken.address, vToken, marketSpecs.riskParameters); + checkVToken(vToken.address, { + ...vToken, + name: "Venus PT Lista collateral BNB 25JUN2026", + }); + checkInterestRate( + RATE_MODEL, + vToken.symbol, + { + base: "0", + multiplier: "0.0135", + jump: "0.3", + kink: "0.5", + }, + BLOCKS_PER_YEAR, + ); }); - it("should set borrowAllowed to False for vPT_slisBNBx_24JUN2026 market", async () => { - const vPT_slisBNBx_24JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); - expect(vPT_slisBNBx_24JUN2026Market.isBorrowAllowed).to.equal(false); + describe("Paused markets", () => { + it("should pause borrowing on PT-clisBNB-25JUN2026", async () => { + expect(await comptroller.actionPaused(vToken.address, 2)).to.equal(true); + }); }); describe("Converters", () => { for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); - - it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_slisBNBx_24JUN2026`, async () => { - const result = await converterContract.conversionConfigurations( - baseAsset, - marketSpecs.vToken.underlying.address, - ); + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset ${vToken.underlying.symbol}`, async () => { + const result = await converterContract.conversionConfigurations(baseAsset, PT_clisBNB_25JUN2026); expect(result.incentive).to.equal(CONVERSION_INCENTIVE); }); } }); - describe("emode", () => { - it("should set the correct risk parameters to all pool markets", async () => { - for (const config of Object.values(EMODE_POOL.marketsConfig)) { - const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); - expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); - expect(marketData.isListed).to.be.equal(true); - expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); - expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); - expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); - expect(marketData.isBorrowAllowed).to.be.equal(config.borrowAllowed); - } + describe("BNB Emode Group", () => { + it("should set the correct risk parameters for PT-clisBNB-25JUN2026", async () => { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); + expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); + expect(marketData.isListed).to.be.equal(true); + // passed 0 correct value is EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor (setCollateralFactor is commented out in VIP) + expect(marketData.collateralFactorMantissa).to.be.equal(0); + // passed 0 correct value is EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold (setCollateralFactor is commented out in VIP) + expect(marketData.liquidationThresholdMantissa).to.be.equal(0); + expect(marketData.liquidationIncentiveMantissa).to.be.equal( + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, + ); + expect(marketData.isBorrowAllowed).to.be.equal(EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed); }); }); }); diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts index 9679d2c0b..4d6752a3f 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-790/bsctestnet.ts @@ -6,12 +6,14 @@ import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; const { bsctestnet } = NETWORK_ADDRESSES; -export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; export const PROTOCOL_SHARE_RESERVE = "0x25c7c7D6Bf710949fD7f03364E9BA19a1b3c10E3"; -export const PT_slisBNBx_24JUN2026 = "0x0560Ec87515eeF5E971CE41198529627DAB72094"; -export const vPT_slisBNBx_24JUN2026 = "0xA9cD767e434A71Cb8173079b4eF7494F71D79180"; +export const PT_clisBNB_25JUN2026 = "0x60825e8eBbed5C32c1DAA7eA68ceCA70BEA65040"; +export const vPT_clisBNB_25JUN2026 = "0xCd5A0037ebfC4a22A755923bB5C983947FaBdCe7"; +export const MOCK_PENDLE_PT_ORACLE = "0xa37A9127C302fEc17d456a6E1a5643a18a1779aD"; +export const PT_clisBNB_25JUN2026_PENDLE_ORACLE = "0x86EB1cE03e825CFD4516F385d7b90DE72B90BF69"; export const RATE_MODEL = "0x274362695401Bb1B0468BfcFE448AD7021D97562"; export const REDUCE_RESERVES_BLOCK_DELTA = "192000"; // 70080000 blocks per year +const TWAP_DURATION = 1800; // Converters const ETH = "0x98f7A83361F7Ac8765CcEBAB1425da6b341958a7"; @@ -29,6 +31,30 @@ const ETH_PRIME_CONVERTER = "0xf358650A007aa12ecC8dac08CF8929Be7f72A4D9"; const XVS_VAULT_CONVERTER = "0x258f49254C758a0E37DAb148ADDAEA851F4b02a2"; export const CONVERSION_INCENTIVE = 1e14; +// Capped oracles +export const DAYS_30 = 30 * 24 * 60 * 60; +export const increaseExchangeRateByPercentage = ( + exchangeRate: BigNumber, + percentage: BigNumber, // BPS value (e.g., 10000 for 100%) +) => { + const increaseAmount = exchangeRate.mul(percentage).div(10000); + return exchangeRate.add(increaseAmount).toString(); +}; +export const getSnapshotGap = ( + exchangeRate: BigNumber, + percentage: number, // BPS value (e.g., 10000 for 100%) +) => { + // snapshot gap is percentage of the exchange rate + const snapshotGap = exchangeRate.mul(percentage).div(10000); + return snapshotGap.toString(); +}; +export const SECONDS_PER_YEAR = 31536000; +export const PT_clisBNB_25JUN2026_InitialExchangeRate = parseUnits("0.944938575631117449", 18); +export const PT_clisBNB_25JUN2026_Timestamp = 1758874206; +export const PT_clisBNB_25JUN2026_GrowthRate = SECONDS_PER_YEAR; // 0% per year +export const PT_clisBNB_25JUN2026_SnapshotGap = 400; // 4.00% +export const MAIN_ORACLE_ROLE = 0; + export const converterBaseAssets = { [RISK_FUND_CONVERTER]: USDT, [USDT_PRIME_CONVERTER]: USDT, @@ -41,13 +67,13 @@ export const converterBaseAssets = { export const marketSpecs = { vToken: { - address: vPT_slisBNBx_24JUN2026, - name: "Venus PT-slisBNBx-24JUN2026", - symbol: "vPT-slisBNBx-24JUN2026", + address: vPT_clisBNB_25JUN2026, + name: "Venus PT-clisBNB-25JUN2026", + symbol: "vPT-clisBNB-25JUN2026", underlying: { - address: PT_slisBNBx_24JUN2026, + address: PT_clisBNB_25JUN2026, decimals: 18, - symbol: "PT-slisBNBx-24JUN2026", + symbol: "PT-clisBNB-25JUN2026", }, decimals: 8, exchangeRate: parseUnits("1", 28), @@ -80,11 +106,11 @@ export const marketSpecs = { export const EMODE_POOL = { label: "BNB", id: 4, - markets: [vPT_slisBNBx_24JUN2026], + markets: [vPT_clisBNB_25JUN2026], allowCorePoolFallback: true, marketsConfig: { - vPT_slisBNBx_24JUN2026: { - address: vPT_slisBNBx_24JUN2026, + vPT_clisBNB_25JUN2026: { + address: vPT_clisBNB_25JUN2026, collateralFactor: parseUnits("0.87", 18), liquidationThreshold: parseUnits("0.90", 18), liquidationIncentive: parseUnits("1.04", 18), @@ -122,7 +148,7 @@ const configureConverters = (fromAssets: string[], incentive: BigNumberish = CON export const vip790 = () => { const meta = { version: "v2", - title: "VIP-790 [BNB Chain] Add PT-slisBNBx-24JUN2026 market to the BNB emode group", + title: "VIP-790 [BNB Chain] Add PT-clisBNB-25JUN2026 market to the BNB emode group", description: "VIP-790 [BNB Chain] BNB emode group", forDescription: "I agree that Venus Protocol should proceed with this proposal", againstDescription: "I do not think that Venus Protocol should proceed with this proposal", @@ -131,6 +157,46 @@ export const vip790 = () => { return makeProposal( [ + // Configure Oracle + { + target: MOCK_PENDLE_PT_ORACLE, + signature: "setPtToSyRate(address,uint32,uint256)", + params: ["0x0000000000000000000000000000000000000004", TWAP_DURATION, parseUnits("0.944938575631117449", 18)], + }, + { + target: bsctestnet.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3],bool))", + params: [ + [ + PT_clisBNB_25JUN2026, + [PT_clisBNB_25JUN2026_PENDLE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ], + ], + }, + { + target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, + signature: "setSnapshot(uint256,uint256)", + params: [ + increaseExchangeRateByPercentage( + PT_clisBNB_25JUN2026_InitialExchangeRate, + BigNumber.from(PT_clisBNB_25JUN2026_SnapshotGap), + ), + PT_clisBNB_25JUN2026_Timestamp, + ], + }, + { + target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, + signature: "setGrowthRate(uint256,uint256)", + params: [PT_clisBNB_25JUN2026_GrowthRate, DAYS_30], + }, + { + target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, + signature: "setSnapshotGap(uint256)", + params: [getSnapshotGap(PT_clisBNB_25JUN2026_InitialExchangeRate, PT_clisBNB_25JUN2026_SnapshotGap)], + }, + // Add Market { target: marketSpecs.vToken.comptroller, @@ -182,7 +248,7 @@ export const vip790 = () => { params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], }, { - target: PT_slisBNBx_24JUN2026, + target: PT_clisBNB_25JUN2026, signature: "faucet(uint256)", params: [marketSpecs.initialSupply.amount], }, @@ -232,23 +298,24 @@ export const vip790 = () => { signature: "addPoolMarkets(uint96[],address[])", params: [Array(EMODE_POOL.markets.length).fill(EMODE_POOL.id), EMODE_POOL.markets], }, - { - target: bsctestnet.UNITROLLER, - signature: "setCollateralFactor(uint96,address,uint256,uint256)", - params: [ - EMODE_POOL.id, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.collateralFactor, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.liquidationThreshold, - ], - }, + // This call is breaking because inside setCollateralFactor getPrices called which is returning "invalid resilient oracle price", Even after setting up the oracle above setTokenConfig. + // { + // target: bsctestnet.UNITROLLER, + // signature: "setCollateralFactor(uint96,address,uint256,uint256)", + // params: [ + // EMODE_POOL.id, + // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor, + // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold, + // ], + // }, { target: bsctestnet.UNITROLLER, signature: "setLiquidationIncentive(uint96,address,uint256)", params: [ EMODE_POOL.id, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.liquidationIncentive, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, ], }, { @@ -256,8 +323,8 @@ export const vip790 = () => { signature: "setIsBorrowAllowed(uint96,address,bool)", params: [ EMODE_POOL.id, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.address, - EMODE_POOL.marketsConfig.vPT_slisBNBx_24JUN2026.borrowAllowed, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed, ], }, ], From de91396bc9b20e2671beed9386dc322e6b1eabaf Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 14 Jan 2026 13:43:52 +0530 Subject: [PATCH 03/14] fix: fix oracle issue in testnet simulation --- simulations/vip-790/bsctestnet.ts | 284 ++++++++++++------------------ vips/vip-790/bsctestnet.ts | 31 ++-- 2 files changed, 126 insertions(+), 189 deletions(-) diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-790/bsctestnet.ts index 487622753..709395c43 100644 --- a/simulations/vip-790/bsctestnet.ts +++ b/simulations/vip-790/bsctestnet.ts @@ -1,104 +1,66 @@ import { expect } from "chai"; -import { BigNumber } from "ethers"; -import { formatUnits } from "ethers/lib/utils"; +import { Contract } from "ethers"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { - expectEvents, - setMaxStalePeriod, // initMainnetUser -} from "src/utils"; +import { expectEvents, setMaxStalePeriodInChainlinkOracle } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameters"; import { checkVToken } from "src/vip-framework/checks/checkVToken"; import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; -import { forking, testVip } from "src/vip-framework/index"; -import vip790, { +import { CONVERSION_INCENTIVE, EMODE_POOL, - MAIN_ORACLE_ROLE, PROTOCOL_SHARE_RESERVE, - PT_clisBNB_25JUN2026, RATE_MODEL, convertAmountToVTokens, converterBaseAssets, - marketSpecs, // PT_clisBNB_25JUN2026_PENDLE_ORACLE, + marketSpecs, + vip790, } from "../../vips/vip-790/bsctestnet"; -import CAPPED_ORACLE_ABI from "./abi/CappedOracle.json"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; -import ERC20_ABI from "./abi/ERC20.json"; import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; import VTOKEN_ABI from "./abi/VToken.json"; -const BLOCKS_PER_YEAR = BigNumber.from(10512000); - -const { RESILIENT_ORACLE, ACCESS_CONTROL_MANAGER, NORMAL_TIMELOCK, UNITROLLER } = NETWORK_ADDRESSES.bsctestnet; +const { bsctestnet } = NETWORK_ADDRESSES; +const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; -const format = (amount: BigNumber, spec: { decimals: number; symbol: string }) => - `${formatUnits(amount, spec.decimals)} ${spec.symbol}`; - -forking(83980292, async () => { - const resilientOracle = new ethers.Contract(RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); - const comptroller = new ethers.Contract(UNITROLLER, COMPTROLLER_ABI, ethers.provider); - const vToken = marketSpecs.vToken; - const vTokenContract = new ethers.Contract(vToken.address, VTOKEN_ABI, ethers.provider); - const slisBNB = new ethers.Contract("0xd2aF6A916Bc77764dc63742BC30f71AF4cF423F4", ERC20_ABI, ethers.provider); - const WBNB = new ethers.Contract("0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", ERC20_ABI, ethers.provider); +forking(84342013, async () => { + let comptroller: Contract; + let resilientOracle: Contract; + let vPT_clisBNB_25JUN2026: Contract; before(async () => { - // // Note: When we are calling setTokenConfig here in the pre-VIP setup, we are able to get getOracle and getPrice - // // import initMainnetUser and PT_clisBNB_25JUN2026_PENDLE_ORACLE - // const impersonatedTimelock = await initMainnetUser(NORMAL_TIMELOCK, ethers.utils.parseEther("2")); - // await resilientOracle - // .connect(impersonatedTimelock) - // .setTokenConfig([ - // PT_clisBNB_25JUN2026, - // [PT_clisBNB_25JUN2026_PENDLE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], - // [true, false, false], - // false, - // ]); - - await setMaxStalePeriod(resilientOracle, slisBNB); - - await setMaxStalePeriod(resilientOracle, WBNB); + const provider = ethers.provider; + comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); + vPT_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); + resilientOracle = new ethers.Contract(bsctestnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + // set maxStalePeriod + await setMaxStalePeriodInChainlinkOracle( + bsctestnet.CHAINLINK_ORACLE, + NATIVE_TOKEN_ADDR, + ethers.constants.AddressZero, + bsctestnet.NORMAL_TIMELOCK, + 315360000, + ); }); - describe("Pre-VIP behavior", () => { - it("should have correct number of markets in the core pool", async () => { - const markets = await comptroller.getAllMarkets(); - expect(markets).to.not.contain(vToken.address); - }); - - it("should not have PT-clisBNB-25JUN2026 in BNB emode group", async () => { - const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); - expect(marketData.isListed).to.equal(false); - }); - - it("should have zero collateral factor", async () => { - const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); - const coreMarketData = await comptroller.markets(vToken.address); - console.log("Collateral Factor in Emode Pool:", formatUnits(marketData.collateralFactorMantissa, 18)); - console.log("Collateral Factor in Core Pool:", formatUnits(coreMarketData.collateralFactorMantissa, 18)); - expect(marketData.collateralFactorMantissa).to.equal(0); - expect(coreMarketData.collateralFactorMantissa).to.equal(0); + describe("Pre-VIP behavior", async () => { + it("check PT_clisBNB_25JUN2026 market not listed", async () => { + const market = await comptroller.markets(marketSpecs.vToken.address); + expect(market.isListed).to.equal(false); }); - it("check resilientOracle getOracle", async () => { - const oracleInfo = await resilientOracle.getOracle(PT_clisBNB_25JUN2026, MAIN_ORACLE_ROLE); - console.log("Oracle info before VIP:", oracleInfo); + it("check BNB Emode PoolId exist", async () => { + expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); }); - it(`check price ${vToken.underlying.symbol}`, async () => { - await expect(resilientOracle.getPrice(PT_clisBNB_25JUN2026)).to.be.reverted; + it("check BNB Emode Pool not active", async () => { + const poolData = await comptroller.pools(EMODE_POOL.id); + expect(poolData.isActive).to.equal(false); }); - - // Note: When we call setTokenConfig in the pre-VIP setup, getPrice will return the price. - // it(`check price ${vToken.underlying.symbol}`, async () => { - // const price = await resilientOracle.getPrice(PT_clisBNB_25JUN2026); - // console.log("Price after VIP:", price); - // const underlyingPrice = await resilientOracle.getUnderlyingPrice(vToken.address); - // console.log("Underlying Price after VIP:", underlyingPrice.toString()); - // }); }); testVip("VIP-790", await vip790(), { @@ -114,142 +76,116 @@ forking(83980292, async () => { "NewProtocolShareReserve", "NewReduceReservesBlockDelta", "NewReserveFactor", - // "NewCollateralFactor", // Commented out as setCollateralFactor is commented in VIP - // "NewLiquidationThreshold", // Commented out as setCollateralFactor is commented in VIP + "NewCollateralFactor", + "NewLiquidationThreshold", "NewLiquidationIncentive", + "PoolMarketInitialized", ], - [1, 1, 1, 1, 1, 1, 1, 2], - ); - await expectEvents( - txResponse, - [CAPPED_ORACLE_ABI], - ["SnapshotUpdated", "GrowthRateUpdated", "SnapshotGapUpdated"], - [1, 1, 1], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], ); }, }); describe("Post-VIP behavior", async () => { - it("Check collateral factors", async () => { - const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); - const coreMarketData = await comptroller.markets(vToken.address); - console.log("Collateral Factor in Emode Pool:", formatUnits(marketData.collateralFactorMantissa, 18)); - console.log("Collateral Factor in Core Pool:", formatUnits(coreMarketData.collateralFactorMantissa, 18)); + it("check new IRM", async () => { + expect(await vPT_clisBNB_25JUN2026.interestRateModel()).to.equal(RATE_MODEL); }); - it("check resilientOracle getOracle", async () => { - const oracleInfo = await resilientOracle.getOracle(PT_clisBNB_25JUN2026, MAIN_ORACLE_ROLE); - console.log("Oracle info after VIP:", oracleInfo); + checkInterestRate(RATE_MODEL, "vPT_clisBNB_25JUN2026", { + base: marketSpecs.interestRateModel.baseRatePerYear, + multiplier: marketSpecs.interestRateModel.multiplierPerYear, + jump: marketSpecs.interestRateModel.jumpMultiplierPerYear, + kink: marketSpecs.interestRateModel.kink, }); - // it(`check price ${vToken.underlying.symbol}`, async () => { - // const price = await resilientOracle.getPrice(PT_clisBNB_25JUN2026); - // console.log("Price after VIP:", price.toString()); - // const underlyingPrice = await resilientOracle.getUnderlyingPrice(vToken.address); - // console.log("Underlying Price after VIP:", underlyingPrice.toString()); - // }); - - it("should have added vToken to the core pool", async () => { - const markets = await comptroller.getAllMarkets(); - expect(markets).to.contain(vToken.address); + checkVToken(marketSpecs.vToken.address, { + name: marketSpecs.vToken.name, + symbol: marketSpecs.vToken.symbol, + decimals: marketSpecs.vToken.decimals, + underlying: marketSpecs.vToken.underlying.address, + exchangeRate: marketSpecs.vToken.exchangeRate, + comptroller: marketSpecs.vToken.comptroller, }); - describe(`Checks for ${vToken.symbol}`, () => { - it("has correct owner", async () => { - expect(await vTokenContract.admin()).to.equal(NORMAL_TIMELOCK); - }); - - it("has correct ACM", async () => { - expect(await vTokenContract.accessControlManager()).to.equal(ACCESS_CONTROL_MANAGER); - }); + checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); - it("has correct protocol share reserve", async () => { - expect(await vTokenContract.protocolShareReserve()).equals(PROTOCOL_SHARE_RESERVE); - }); + it("check price PT_clisBNB_25JUN2026", async () => { + const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); + expect(underlyingPrice).to.not.equal(0); + }); - describe("Balances", () => { - const vTokenSupply = convertAmountToVTokens(marketSpecs.initialSupply.amount, vToken.exchangeRate); - const vTokenSupplyForReceiver = vTokenSupply.sub(marketSpecs.initialSupply.vTokensToBurn); + it("market have correct owner", async () => { + expect(await vPT_clisBNB_25JUN2026.admin()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); - it(`should have balance of underlying = ${format( - marketSpecs.initialSupply.amount, - vToken.underlying, - )}`, async () => { - const underlying = new ethers.Contract(vToken.underlying.address, ERC20_ABI, ethers.provider); - expect(await underlying.balanceOf(vToken.address)).to.equal(marketSpecs.initialSupply.amount); - }); + it("market have correct ACM", async () => { + expect(await vPT_clisBNB_25JUN2026.accessControlManager()).to.equal(bsctestnet.ACCESS_CONTROL_MANAGER); + }); - it(`should have total supply of ${format(vTokenSupply, vToken)}`, async () => { - expect(await vTokenContract.totalSupply()).to.equal(vTokenSupply); - }); + it("market should have correct protocol share reserve", async () => { + expect(await vPT_clisBNB_25JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); + }); - it(`should send ${format(vTokenSupplyForReceiver, vToken)} to receiver`, async () => { - const receiverBalance = await vTokenContract.balanceOf(marketSpecs.initialSupply.vTokenReceiver); - expect(receiverBalance).to.equal(vTokenSupplyForReceiver); - }); + it("market should have correct total supply", async () => { + const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); + expect(vPT_clisBNB_25JUN2026Supply).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), + ); + }); - it(`should burn ${format(marketSpecs.initialSupply.vTokensToBurn, vToken)}`, async () => { - const burnt = await vTokenContract.balanceOf(ethers.constants.AddressZero); - expect(burnt).to.equal(marketSpecs.initialSupply.vTokensToBurn); - }); + it("should burn vTokens", async () => { + const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); + expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); + }); - it(`should leave no ${vToken.symbol} in the timelock`, async () => { - const timelockBalance = await vTokenContract.balanceOf(NORMAL_TIMELOCK); - expect(timelockBalance).to.equal(0); - }); - }); + it("should transfer remaining vTokens to receiver", async () => { + const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); + expect(slisBNBReceiverBalance).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( + marketSpecs.initialSupply.vTokensToBurn, + ), + ); + }); - it('should have name = "Venus PT Lista collateral BNB 25JUN2026"', async () => { - expect(await vTokenContract.name()).to.equal("Venus PT Lista collateral BNB 25JUN2026"); - }); + it("should not leave any vTokens in the timelock", async () => { + const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); + expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); + }); - checkRiskParameters(vToken.address, vToken, marketSpecs.riskParameters); - checkVToken(vToken.address, { - ...vToken, - name: "Venus PT Lista collateral BNB 25JUN2026", - }); - checkInterestRate( - RATE_MODEL, - vToken.symbol, - { - base: "0", - multiplier: "0.0135", - jump: "0.3", - kink: "0.5", - }, - BLOCKS_PER_YEAR, - ); + it("should pause vPT_clisBNB_25JUN2026 market", async () => { + expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); }); - describe("Paused markets", () => { - it("should pause borrowing on PT-clisBNB-25JUN2026", async () => { - expect(await comptroller.actionPaused(vToken.address, 2)).to.equal(true); - }); + it("should set borrowAllowed to False for vPT_clisBNB_25JUN2026 market", async () => { + const vPT_clisBNB_25JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); + expect(vPT_clisBNB_25JUN2026Market.isBorrowAllowed).to.equal(false); }); describe("Converters", () => { for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); - it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset ${vToken.underlying.symbol}`, async () => { - const result = await converterContract.conversionConfigurations(baseAsset, PT_clisBNB_25JUN2026); + + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_clisBNB_25JUN2026`, async () => { + const result = await converterContract.conversionConfigurations( + baseAsset, + marketSpecs.vToken.underlying.address, + ); expect(result.incentive).to.equal(CONVERSION_INCENTIVE); }); } }); - describe("BNB Emode Group", () => { - it("should set the correct risk parameters for PT-clisBNB-25JUN2026", async () => { - const marketData = await comptroller.poolMarkets(EMODE_POOL.id, vToken.address); - expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); - expect(marketData.isListed).to.be.equal(true); - // passed 0 correct value is EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor (setCollateralFactor is commented out in VIP) - expect(marketData.collateralFactorMantissa).to.be.equal(0); - // passed 0 correct value is EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold (setCollateralFactor is commented out in VIP) - expect(marketData.liquidationThresholdMantissa).to.be.equal(0); - expect(marketData.liquidationIncentiveMantissa).to.be.equal( - EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, - ); - expect(marketData.isBorrowAllowed).to.be.equal(EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed); + describe("emode", () => { + it("should set the correct risk parameters to all pool markets", async () => { + for (const config of Object.values(EMODE_POOL.marketsConfig)) { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); + expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); + expect(marketData.isListed).to.be.equal(true); + expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); + expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); + expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); + expect(marketData.isBorrowAllowed).to.be.equal(config.borrowAllowed); + } }); }); }); diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts index 4d6752a3f..87f968591 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-790/bsctestnet.ts @@ -12,7 +12,7 @@ export const vPT_clisBNB_25JUN2026 = "0xCd5A0037ebfC4a22A755923bB5C983947FaBdCe7 export const MOCK_PENDLE_PT_ORACLE = "0xa37A9127C302fEc17d456a6E1a5643a18a1779aD"; export const PT_clisBNB_25JUN2026_PENDLE_ORACLE = "0x86EB1cE03e825CFD4516F385d7b90DE72B90BF69"; export const RATE_MODEL = "0x274362695401Bb1B0468BfcFE448AD7021D97562"; -export const REDUCE_RESERVES_BLOCK_DELTA = "192000"; // 70080000 blocks per year +export const REDUCE_RESERVES_BLOCK_DELTA = "28800"; const TWAP_DURATION = 1800; // Converters @@ -40,6 +40,7 @@ export const increaseExchangeRateByPercentage = ( const increaseAmount = exchangeRate.mul(percentage).div(10000); return exchangeRate.add(increaseAmount).toString(); }; + export const getSnapshotGap = ( exchangeRate: BigNumber, percentage: number, // BPS value (e.g., 10000 for 100%) @@ -48,8 +49,9 @@ export const getSnapshotGap = ( const snapshotGap = exchangeRate.mul(percentage).div(10000); return snapshotGap.toString(); }; + export const SECONDS_PER_YEAR = 31536000; -export const PT_clisBNB_25JUN2026_InitialExchangeRate = parseUnits("0.944938575631117449", 18); +export const PT_clisBNB_25JUN2026_InitialExchangeRate = parseUnits("1.034169826638422493", 18); export const PT_clisBNB_25JUN2026_Timestamp = 1758874206; export const PT_clisBNB_25JUN2026_GrowthRate = SECONDS_PER_YEAR; // 0% per year export const PT_clisBNB_25JUN2026_SnapshotGap = 400; // 4.00% @@ -68,7 +70,7 @@ export const converterBaseAssets = { export const marketSpecs = { vToken: { address: vPT_clisBNB_25JUN2026, - name: "Venus PT-clisBNB-25JUN2026", + name: "Venus PT Lista collateral BNB 25JUN2026", symbol: "vPT-clisBNB-25JUN2026", underlying: { address: PT_clisBNB_25JUN2026, @@ -161,7 +163,7 @@ export const vip790 = () => { { target: MOCK_PENDLE_PT_ORACLE, signature: "setPtToSyRate(address,uint32,uint256)", - params: ["0x0000000000000000000000000000000000000004", TWAP_DURATION, parseUnits("0.944938575631117449", 18)], + params: ["0x0000000000000000000000000000000000000004", TWAP_DURATION, parseUnits("1.034169826638422493", 18)], }, { target: bsctestnet.RESILIENT_ORACLE, @@ -298,17 +300,16 @@ export const vip790 = () => { signature: "addPoolMarkets(uint96[],address[])", params: [Array(EMODE_POOL.markets.length).fill(EMODE_POOL.id), EMODE_POOL.markets], }, - // This call is breaking because inside setCollateralFactor getPrices called which is returning "invalid resilient oracle price", Even after setting up the oracle above setTokenConfig. - // { - // target: bsctestnet.UNITROLLER, - // signature: "setCollateralFactor(uint96,address,uint256,uint256)", - // params: [ - // EMODE_POOL.id, - // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, - // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor, - // EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold, - // ], - // }, + { + target: bsctestnet.UNITROLLER, + signature: "setCollateralFactor(uint96,address,uint256,uint256)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold, + ], + }, { target: bsctestnet.UNITROLLER, signature: "setLiquidationIncentive(uint96,address,uint256)", From 8407ae56112483a3e98b45daf217a0eba5d48616 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 14 Jan 2026 14:03:43 +0530 Subject: [PATCH 04/14] feat: add vip and simulations for bscmainnet --- simulations/vip-790/bscmainnet.ts | 205 +++++++++++++++++++ vips/vip-790/bscmainnet.ts | 327 ++++++++++++++++++++++++++++++ 2 files changed, 532 insertions(+) create mode 100644 simulations/vip-790/bscmainnet.ts create mode 100644 vips/vip-790/bscmainnet.ts diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-790/bscmainnet.ts new file mode 100644 index 000000000..58732cf25 --- /dev/null +++ b/simulations/vip-790/bscmainnet.ts @@ -0,0 +1,205 @@ +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents, setMaxStalePeriod, setMaxStalePeriodInChainlinkOracle } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; +import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameters"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import { + CONVERSION_INCENTIVE, + EMODE_POOL, + PROTOCOL_SHARE_RESERVE, + RATE_MODEL, + convertAmountToVTokens, + converterBaseAssets, + marketSpecs, + vip790, +} from "../../vips/vip-790/bscmainnet"; +import COMPTROLLER_ABI from "./abi/Comptroller.json"; +import ERC20_ABI from "./abi/ERC20.json"; +import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; +import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; +import VTOKEN_ABI from "./abi/VToken.json"; + +const { bscmainnet } = NETWORK_ADDRESSES; +const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; +const BNB_FEED = "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE"; + +forking(75055660, async () => { + let comptroller: Contract; + let resilientOracle: Contract; + let Pt_clisBNB_25JUN2026: Contract; + let vPT_clisBNB_25JUN2026: Contract; + let bnb: Contract; + + before(async () => { + const provider = ethers.provider; + comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); + Pt_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.underlying.address, ERC20_ABI, provider); + vPT_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); + resilientOracle = new ethers.Contract(bscmainnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + + // set maxStalePeriod + bnb = new ethers.Contract(NATIVE_TOKEN_ADDR, ERC20_ABI, ethers.provider); + + const CHAINLINK_ORACLE_BNB = "0x8455EFA4D7Ff63b8BFD96AdD889483Ea7d39B70a"; + await setMaxStalePeriodInChainlinkOracle( + CHAINLINK_ORACLE_BNB, + NATIVE_TOKEN_ADDR, + BNB_FEED, // Chainlink BNB/USD feed + bscmainnet.NORMAL_TIMELOCK, + 315360000, + ); + + await setMaxStalePeriod(resilientOracle, bnb); + await setMaxStalePeriod(resilientOracle, Pt_clisBNB_25JUN2026); + }); + + describe("Pre-VIP behavior", async () => { + it("check PT_clisBNB_25JUN2026 market not listed", async () => { + const market = await comptroller.markets(marketSpecs.vToken.address); + expect(market.isListed).to.equal(false); + }); + + it("check BNB Emode PoolId exist", async () => { + expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); + }); + }); + + testVip("VIP-790", await vip790(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [COMPTROLLER_ABI, VTOKEN_ABI], + [ + "MarketListed", + "NewSupplyCap", + "NewBorrowCap", + "NewAccessControlManager", + "NewProtocolShareReserve", + "NewReduceReservesBlockDelta", + "NewReserveFactor", + "NewCollateralFactor", + "NewLiquidationThreshold", + "NewLiquidationIncentive", + "PoolMarketInitialized", + ], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], + ); + }, + }); + + describe("Post-VIP behavior", async () => { + it("check new IRM", async () => { + expect(await vPT_clisBNB_25JUN2026.interestRateModel()).to.equal(RATE_MODEL); + }); + + checkInterestRate(RATE_MODEL, "vPT_clisBNB_25JUN2026", { + base: marketSpecs.interestRateModel.baseRatePerYear, + multiplier: marketSpecs.interestRateModel.multiplierPerYear, + jump: marketSpecs.interestRateModel.jumpMultiplierPerYear, + kink: marketSpecs.interestRateModel.kink, + }); + + checkVToken(marketSpecs.vToken.address, { + name: marketSpecs.vToken.name, + symbol: marketSpecs.vToken.symbol, + decimals: marketSpecs.vToken.decimals, + underlying: marketSpecs.vToken.underlying.address, + exchangeRate: marketSpecs.vToken.exchangeRate, + comptroller: marketSpecs.vToken.comptroller, + }); + + checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); + + it("check price PT_clisBNB_25JUN2026", async () => { + const expectedPrice = parseUnits("889.065723820186309413", 18); + const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); + expect(underlyingPrice).to.equal(expectedPrice); + }); + + it("market have correct owner", async () => { + expect(await vPT_clisBNB_25JUN2026.admin()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("market have correct ACM", async () => { + expect(await vPT_clisBNB_25JUN2026.accessControlManager()).to.equal(bscmainnet.ACCESS_CONTROL_MANAGER); + }); + + it("market should have correct protocol share reserve", async () => { + expect(await vPT_clisBNB_25JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); + }); + + // it("market should have correct total supply", async () => { + // const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); + // expect(vPT_clisBNB_25JUN2026Supply).to.equal( + // convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), + // ); + // }); + + // it("market should have balance of underlying", async () => { + // const PT_clisBNB_25JUN2026_balance = await PT_clisBNB_25JUN2026.balanceOf(vPT_clisBNB_25JUN2026.address); + // expect(PT_clisBNB_25JUN2026_balance).to.greaterThan(0); + // }); + + // it("should burn vTokens", async () => { + // const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); + // expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); + // }); + + // it("should transfer remaining vTokens to receiver", async () => { + // const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); + // expect(slisBNBReceiverBalance).to.equal( + // convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( + // marketSpecs.initialSupply.vTokensToBurn, + // ), + // ); + // }); + + // it("should not leave any vTokens in the timelock", async () => { + // const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); + // expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); + // }); + + it("should pause vPT_clisBNB_25JUN2026 market", async () => { + expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); + }); + + it("should set borrowAllowed to False for vPT_clisBNB_25JUN2026 market", async () => { + const vPT_clisBNB_25JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); + expect(vPT_clisBNB_25JUN2026Market.isBorrowAllowed).to.equal(false); + }); + + describe("Converters", () => { + for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { + const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + + it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_clisBNB_25JUN2026`, async () => { + const result = await converterContract.conversionConfigurations( + baseAsset, + marketSpecs.vToken.underlying.address, + ); + expect(result.incentive).to.equal(CONVERSION_INCENTIVE); + }); + } + }); + + describe("emode", () => { + it("should set the correct risk parameters to all pool markets", async () => { + for (const config of Object.values(EMODE_POOL.marketsConfig)) { + const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); + expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); + expect(marketData.isListed).to.be.equal(true); + expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); + expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); + expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); + expect(marketData.isBorrowAllowed).to.be.equal(config.borrowAllowed); + } + }); + }); + }); +}); diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-790/bscmainnet.ts new file mode 100644 index 000000000..088b21c46 --- /dev/null +++ b/vips/vip-790/bscmainnet.ts @@ -0,0 +1,327 @@ +import { BigNumber, BigNumberish } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { bscmainnet } = NETWORK_ADDRESSES; +export const ACM = "0x4788629abc6cfca10f9f969efdeaa1cf70c23555"; +export const PROTOCOL_SHARE_RESERVE = "0xCa01D5A9A248a830E9D93231e791B1afFed7c446"; +export const PT_clisBNB_25JUN2026 = "0xe052823b4aefc6e230FAf46231A57d0905E30AE0"; +export const vPT_clisBNB_25JUN2026 = "0x6d3BD68E90B42615cb5abF4B8DE92b154ADc435e"; +export const RATE_MODEL = "0x6463ab803FF081616ac4daC31B9B66854cc28Bc0"; +export const REDUCE_RESERVES_BLOCK_DELTA = "28800"; +export const PT_clisBNB_PENDLE_ORACLE = "0x0FfFBb55d51cD46cD10C7dc865Dc73BD76201310"; + +// Converters +const ETH = "0x2170Ed0880ac9A755fd29B2688956BD959F933F8"; +const USDT = "0x55d398326f99059fF775485246999027B3197955"; +const USDC = "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"; +const BTCB = "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c"; +const XVS = "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63"; +const WBNB = "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"; +const RISK_FUND_CONVERTER = "0xA5622D276CcbB8d9BBE3D1ffd1BB11a0032E53F0"; +const USDT_PRIME_CONVERTER = "0xD9f101AA67F3D72662609a2703387242452078C3"; +const USDC_PRIME_CONVERTER = "0xa758c9C215B6c4198F0a0e3FA46395Fa15Db691b"; +const BTCB_PRIME_CONVERTER = "0xE8CeAa79f082768f99266dFd208d665d2Dd18f53"; +const ETH_PRIME_CONVERTER = "0xca430B8A97Ea918fF634162acb0b731445B8195E"; +const XVS_VAULT_CONVERTER = "0xd5b9AE835F4C59272032B3B954417179573331E0"; +const WBNB_BURN_CONVERTER = "0x9eF79830e626C8ccA7e46DCEd1F90e51E7cFCeBE"; +export const CONVERSION_INCENTIVE = 1e14; + +// Capped oracles +export const DAYS_30 = 30 * 24 * 60 * 60; +export const increaseExchangeRateByPercentage = ( + exchangeRate: BigNumber, + percentage: BigNumber, // BPS value (e.g., 10000 for 100%) +) => { + const increaseAmount = exchangeRate.mul(percentage).div(10000); + return exchangeRate.add(increaseAmount).toString(); +}; +export const getSnapshotGap = ( + exchangeRate: BigNumber, + percentage: number, // BPS value (e.g., 10000 for 100%) +) => { + // snapshot gap is percentage of the exchange rate + const snapshotGap = exchangeRate.mul(percentage).div(10000); + return snapshotGap.toString(); +}; +export const SECONDS_PER_YEAR = 31536000; +export const PTCLISBNB25JUN2026_InitialExchangeRate = parseUnits("1.034146782295294254", 18); +export const PTCLISBNB25JUN2026_Timestamp = 1768293952; +export const PTCLISBNB25JUN2026_GrowthRate = SECONDS_PER_YEAR; // 0% per year +export const PTCLISBNB25JUN2026_SnapshotGap = 400; // 4.00% + +export const converterBaseAssets = { + [RISK_FUND_CONVERTER]: USDT, + [USDT_PRIME_CONVERTER]: USDT, + [USDC_PRIME_CONVERTER]: USDC, + [BTCB_PRIME_CONVERTER]: BTCB, + [ETH_PRIME_CONVERTER]: ETH, + [XVS_VAULT_CONVERTER]: XVS, + [WBNB_BURN_CONVERTER]: WBNB, +}; + +export const marketSpecs = { + vToken: { + address: vPT_clisBNB_25JUN2026, + name: "Venus PT Lista collateral BNB 25JUN2026", + symbol: "vPT-clisBNB-25JUN2026", + underlying: { + address: PT_clisBNB_25JUN2026, + decimals: 18, + symbol: "PT-clisBNB-25JUN2026", + }, + decimals: 8, + exchangeRate: parseUnits("1", 28), + comptroller: bscmainnet.UNITROLLER, + isLegacyPool: true, + }, + interestRateModel: { + model: "jump", + baseRatePerYear: "0", + multiplierPerYear: "0.09", + jumpMultiplierPerYear: "2", + kink: "0.5", + }, + riskParameters: { + collateralFactor: parseUnits("0", 18), + liquidationThreshold: parseUnits("0", 18), + liquidationIncentive: parseUnits("1", 18), + reserveFactor: parseUnits("0", 18), + supplyCap: parseUnits("25000", 18), + borrowCap: parseUnits("0", 18), + }, + initialSupply: { + amount: parseUnits("0.14", 18), + vTokenReceiver: bscmainnet.VTREASURY, + vTokensToBurn: parseUnits("0.1", 8), + }, +}; + +// BNB emode group +export const EMODE_POOL = { + label: "BNB", + id: 3, + markets: [vPT_clisBNB_25JUN2026], + allowCorePoolFallback: true, + marketsConfig: { + vPT_clisBNB_25JUN2026: { + address: vPT_clisBNB_25JUN2026, + collateralFactor: parseUnits("0.87", 18), + liquidationThreshold: parseUnits("0.90", 18), + liquidationIncentive: parseUnits("1.04", 18), + borrowAllowed: false, + }, + }, +}; + +export const convertAmountToVTokens = (amount: BigNumber, exchangeRate: BigNumber) => { + const EXP_SCALE = parseUnits("1", 18); + return amount.mul(EXP_SCALE).div(exchangeRate); +}; + +const vTokensMinted = convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate); +const vTokensRemaining = vTokensMinted.sub(marketSpecs.initialSupply.vTokensToBurn); + +const configureConverters = (fromAssets: string[], incentive: BigNumberish = CONVERSION_INCENTIVE) => { + enum ConversionAccessibility { + NONE = 0, + ALL = 1, + ONLY_FOR_CONVERTERS = 2, + ONLY_FOR_USERS = 3, + } + + return Object.entries(converterBaseAssets).map(([converter, baseAsset]: [string, string]) => { + const conversionConfigs = fromAssets.map(() => [incentive, ConversionAccessibility.ALL]); + return { + target: converter, + signature: "setConversionConfigs(address,address[],(uint256,uint8)[])", + params: [baseAsset, fromAssets, conversionConfigs], + }; + }); +}; + +export const vip790 = () => { + const meta = { + version: "v2", + title: "VIP-790 [BNB Chain] Add PT-slisBNBx-24JUN2026 market to the BNB emode group", + description: "VIP-790 [BNB Chain] BNB emode group", + forDescription: "I agree that Venus Protocol should proceed with this proposal", + againstDescription: "I do not think that Venus Protocol should proceed with this proposal", + abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", + }; + + return makeProposal( + [ + // Add Market + { + target: bscmainnet.RESILIENT_ORACLE, + signature: "setTokenConfig((address,address[3],bool[3],bool))", + params: [ + [ + PT_clisBNB_25JUN2026, + [PT_clisBNB_PENDLE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ], + ], + }, + { + target: PT_clisBNB_PENDLE_ORACLE, + signature: "setSnapshot(uint256,uint256)", + params: [ + increaseExchangeRateByPercentage( + PTCLISBNB25JUN2026_InitialExchangeRate, + BigNumber.from(PTCLISBNB25JUN2026_SnapshotGap), + ), + PTCLISBNB25JUN2026_Timestamp, + ], + }, + { + target: PT_clisBNB_PENDLE_ORACLE, + signature: "setGrowthRate(uint256,uint256)", + params: [PTCLISBNB25JUN2026_GrowthRate, DAYS_30], + }, + { + target: PT_clisBNB_PENDLE_ORACLE, + signature: "setSnapshotGap(uint256)", + params: [getSnapshotGap(PTCLISBNB25JUN2026_InitialExchangeRate, PTCLISBNB25JUN2026_SnapshotGap)], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_supportMarket(address)", + params: [marketSpecs.vToken.address], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setMarketSupplyCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setMarketBorrowCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.borrowCap]], + }, + { + target: marketSpecs.vToken.address, + signature: "setAccessControlManager(address)", + params: [ACM], + }, + { + target: marketSpecs.vToken.address, + signature: "setProtocolShareReserve(address)", + params: [PROTOCOL_SHARE_RESERVE], + }, + { + target: marketSpecs.vToken.address, + signature: "setReduceReservesBlockDelta(uint256)", + params: [REDUCE_RESERVES_BLOCK_DELTA], + }, + { + target: marketSpecs.vToken.address, + signature: "_setReserveFactor(uint256)", + params: [marketSpecs.riskParameters.reserveFactor], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "setCollateralFactor(address,uint256,uint256)", + params: [ + marketSpecs.vToken.address, + marketSpecs.riskParameters.collateralFactor, + marketSpecs.riskParameters.liquidationThreshold, + ], + }, + { + target: marketSpecs.vToken.comptroller, + signature: "setLiquidationIncentive(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], + }, + // { + // target: bscmainnet.VTREASURY, + // signature: "withdrawTreasuryBEP20(address,uint256,address)", + // params: [marketSpecs.vToken.underlying.address, marketSpecs.initialSupply.amount, bscmainnet.NORMAL_TIMELOCK], + // }, + // { + // target: marketSpecs.vToken.underlying.address, + // signature: "approve(address,uint256)", + // params: [marketSpecs.vToken.address, marketSpecs.initialSupply.amount], + // }, + // { + // target: marketSpecs.vToken.address, + // signature: "mint(uint256)", + // params: [marketSpecs.initialSupply.amount], + // }, + // { + // target: marketSpecs.vToken.underlying.address, + // signature: "approve(address,uint256)", + // params: [marketSpecs.vToken.address, 0], + // }, + // // Burn some vTokens + // { + // target: marketSpecs.vToken.address, + // signature: "transfer(address,uint256)", + // params: [ethers.constants.AddressZero, marketSpecs.initialSupply.vTokensToBurn], + // }, + // // Transfer leftover vTokens to receiver + // { + // target: marketSpecs.vToken.address, + // signature: "transfer(address,uint256)", + // params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], + // }, + { + target: marketSpecs.vToken.comptroller, + signature: "_setActionsPaused(address[],uint8[],bool)", + params: [[marketSpecs.vToken.address], [2], true], // Pause Borrow actions + }, + + // // Configure converters + ...configureConverters([marketSpecs.vToken.underlying.address]), + + // // BNB Emode Group + { + target: bscmainnet.UNITROLLER, + signature: "setPoolActive(uint96,bool)", + params: [EMODE_POOL.id, true], + }, + { + target: bscmainnet.UNITROLLER, + signature: "addPoolMarkets(uint96[],address[])", + params: [Array(EMODE_POOL.markets.length).fill(EMODE_POOL.id), EMODE_POOL.markets], + }, + { + target: bscmainnet.UNITROLLER, + signature: "setCollateralFactor(uint96,address,uint256,uint256)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.collateralFactor, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationThreshold, + ], + }, + { + target: bscmainnet.UNITROLLER, + signature: "setLiquidationIncentive(uint96,address,uint256)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, + ], + }, + { + target: bscmainnet.UNITROLLER, + signature: "setIsBorrowAllowed(uint96,address,bool)", + params: [ + EMODE_POOL.id, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, + EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed, + ], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip790; From 3fe24f43201dfd3499d172a738f6c4d73efe40e4 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Wed, 14 Jan 2026 19:50:31 +0530 Subject: [PATCH 05/14] refactor: update mainnet vip and simulation --- simulations/vip-790/bscmainnet.ts | 100 ++++++++++++++++++++---------- vips/vip-790/bscmainnet.ts | 68 ++++++++++---------- 2 files changed, 100 insertions(+), 68 deletions(-) diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-790/bscmainnet.ts index 58732cf25..75ca7e7f2 100644 --- a/simulations/vip-790/bscmainnet.ts +++ b/simulations/vip-790/bscmainnet.ts @@ -1,9 +1,9 @@ import { expect } from "chai"; -import { Contract } from "ethers"; +import { Contract, Signer } from "ethers"; import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { expectEvents, setMaxStalePeriod, setMaxStalePeriodInChainlinkOracle } from "src/utils"; +import { expectEvents, initMainnetUser, setMaxStalePeriod, setMaxStalePeriodInChainlinkOracle } from "src/utils"; import { forking, testVip } from "src/vip-framework"; import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameters"; import { checkVToken } from "src/vip-framework/checks/checkVToken"; @@ -28,13 +28,15 @@ import VTOKEN_ABI from "./abi/VToken.json"; const { bscmainnet } = NETWORK_ADDRESSES; const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; const BNB_FEED = "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE"; +const PT_clisBNB_25JUN2026_HOLDER = "0x3B7e10fFe65c5A59475055D489F71699F7dabfF4"; -forking(75055660, async () => { +forking(75229002, async () => { let comptroller: Contract; let resilientOracle: Contract; let Pt_clisBNB_25JUN2026: Contract; let vPT_clisBNB_25JUN2026: Contract; let bnb: Contract; + let testUser: Signer; before(async () => { const provider = ethers.provider; @@ -43,6 +45,18 @@ forking(75055660, async () => { vPT_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); resilientOracle = new ethers.Contract(bscmainnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + const [signer] = await ethers.getSigners(); + testUser = signer; + + const PT_clisBNB_25JUN2026Holder = await initMainnetUser( + PT_clisBNB_25JUN2026_HOLDER, + ethers.utils.parseEther("10"), + ); + await Pt_clisBNB_25JUN2026.connect(PT_clisBNB_25JUN2026Holder).transfer( + await testUser.getAddress(), + parseUnits("10", 18), + ); + // set maxStalePeriod bnb = new ethers.Contract(NATIVE_TOKEN_ADDR, ERC20_ABI, ethers.provider); @@ -117,7 +131,7 @@ forking(75055660, async () => { checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); it("check price PT_clisBNB_25JUN2026", async () => { - const expectedPrice = parseUnits("889.065723820186309413", 18); + const expectedPrice = parseUnits("912.542908694200730345", 18); const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); expect(underlyingPrice).to.equal(expectedPrice); }); @@ -134,36 +148,31 @@ forking(75055660, async () => { expect(await vPT_clisBNB_25JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); }); - // it("market should have correct total supply", async () => { - // const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); - // expect(vPT_clisBNB_25JUN2026Supply).to.equal( - // convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), - // ); - // }); - - // it("market should have balance of underlying", async () => { - // const PT_clisBNB_25JUN2026_balance = await PT_clisBNB_25JUN2026.balanceOf(vPT_clisBNB_25JUN2026.address); - // expect(PT_clisBNB_25JUN2026_balance).to.greaterThan(0); - // }); - - // it("should burn vTokens", async () => { - // const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); - // expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); - // }); - - // it("should transfer remaining vTokens to receiver", async () => { - // const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); - // expect(slisBNBReceiverBalance).to.equal( - // convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( - // marketSpecs.initialSupply.vTokensToBurn, - // ), - // ); - // }); - - // it("should not leave any vTokens in the timelock", async () => { - // const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); - // expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); - // }); + it("market should have correct total supply", async () => { + const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); + expect(vPT_clisBNB_25JUN2026Supply).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate), + ); + }); + + it("should burn vTokens", async () => { + const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); + expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); + }); + + it("should transfer remaining vTokens to receiver", async () => { + const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); + expect(slisBNBReceiverBalance).to.equal( + convertAmountToVTokens(marketSpecs.initialSupply.amount, marketSpecs.vToken.exchangeRate).sub( + marketSpecs.initialSupply.vTokensToBurn, + ), + ); + }); + + it("should not leave any vTokens in the timelock", async () => { + const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bscmainnet.NORMAL_TIMELOCK); + expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); + }); it("should pause vPT_clisBNB_25JUN2026 market", async () => { expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); @@ -201,5 +210,28 @@ forking(75055660, async () => { } }); }); + + describe("Mint and redeem PT_clisBNB_25JUN2026", async () => { + it("User can mint vU", async () => { + const userAddress = await testUser.getAddress(); + const mintAmount = parseUnits("5", 18); + + // Enter market so minted vU can be used as collateral for borrowing + await comptroller.connect(testUser).enterMarkets([vPT_clisBNB_25JUN2026.address]); + + const vTokenBalBefore = await vPT_clisBNB_25JUN2026.balanceOf(userAddress); + await Pt_clisBNB_25JUN2026.connect(testUser).approve(vPT_clisBNB_25JUN2026.address, mintAmount); + await vPT_clisBNB_25JUN2026.connect(testUser).mint(mintAmount); + expect(await vPT_clisBNB_25JUN2026.balanceOf(userAddress)).to.be.gt(vTokenBalBefore); + }); + + it("User can redeem vU", async () => { + const userAddress = await testUser.getAddress(); + const uBalBefore = await Pt_clisBNB_25JUN2026.balanceOf(userAddress); + const redeemAmount = parseUnits("0.5", 18); + await vPT_clisBNB_25JUN2026.connect(testUser).redeemUnderlying(redeemAmount); + expect(await Pt_clisBNB_25JUN2026.balanceOf(userAddress)).to.be.gt(uBalBefore); + }); + }); }); }); diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-790/bscmainnet.ts index 088b21c46..345f924f3 100644 --- a/vips/vip-790/bscmainnet.ts +++ b/vips/vip-790/bscmainnet.ts @@ -94,9 +94,9 @@ export const marketSpecs = { borrowCap: parseUnits("0", 18), }, initialSupply: { - amount: parseUnits("0.14", 18), + amount: parseUnits("0.035", 18), vTokenReceiver: bscmainnet.VTREASURY, - vTokensToBurn: parseUnits("0.1", 8), + vTokensToBurn: parseUnits("0.035", 8), }, }; @@ -238,38 +238,38 @@ export const vip790 = () => { signature: "setLiquidationIncentive(address,uint256)", params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], }, - // { - // target: bscmainnet.VTREASURY, - // signature: "withdrawTreasuryBEP20(address,uint256,address)", - // params: [marketSpecs.vToken.underlying.address, marketSpecs.initialSupply.amount, bscmainnet.NORMAL_TIMELOCK], - // }, - // { - // target: marketSpecs.vToken.underlying.address, - // signature: "approve(address,uint256)", - // params: [marketSpecs.vToken.address, marketSpecs.initialSupply.amount], - // }, - // { - // target: marketSpecs.vToken.address, - // signature: "mint(uint256)", - // params: [marketSpecs.initialSupply.amount], - // }, - // { - // target: marketSpecs.vToken.underlying.address, - // signature: "approve(address,uint256)", - // params: [marketSpecs.vToken.address, 0], - // }, - // // Burn some vTokens - // { - // target: marketSpecs.vToken.address, - // signature: "transfer(address,uint256)", - // params: [ethers.constants.AddressZero, marketSpecs.initialSupply.vTokensToBurn], - // }, - // // Transfer leftover vTokens to receiver - // { - // target: marketSpecs.vToken.address, - // signature: "transfer(address,uint256)", - // params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], - // }, + { + target: bscmainnet.VTREASURY, + signature: "withdrawTreasuryBEP20(address,uint256,address)", + params: [marketSpecs.vToken.underlying.address, marketSpecs.initialSupply.amount, bscmainnet.NORMAL_TIMELOCK], + }, + { + target: marketSpecs.vToken.underlying.address, + signature: "approve(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.initialSupply.amount], + }, + { + target: marketSpecs.vToken.address, + signature: "mint(uint256)", + params: [marketSpecs.initialSupply.amount], + }, + { + target: marketSpecs.vToken.underlying.address, + signature: "approve(address,uint256)", + params: [marketSpecs.vToken.address, 0], + }, + // Burn some vTokens + { + target: marketSpecs.vToken.address, + signature: "transfer(address,uint256)", + params: [ethers.constants.AddressZero, marketSpecs.initialSupply.vTokensToBurn], + }, + // Transfer leftover vTokens to receiver + { + target: marketSpecs.vToken.address, + signature: "transfer(address,uint256)", + params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], + }, { target: marketSpecs.vToken.comptroller, signature: "_setActionsPaused(address[],uint8[],bool)", From 38e4996e32b07bc5bd48f0287c9499eed4792fa6 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 15 Jan 2026 12:37:43 +0530 Subject: [PATCH 06/14] refactor: remove capped parameters --- src/vip-framework/index.ts | 7 ++++-- vips/vip-790/bscmainnet.ts | 44 ---------------------------------- vips/vip-790/bsctestnet.ts | 48 -------------------------------------- 3 files changed, 5 insertions(+), 94 deletions(-) diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index de2aa7f1f..acd588ef9 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -30,7 +30,7 @@ const OMNICHAIN_PROPOSAL_SENDER = getOmnichainProposalSenderAddress(); const OMNICHAIN_GOVERNANCE_EXECUTOR = NETWORK_ADDRESSES[FORKED_NETWORK as REMOTE_NETWORKS].OMNICHAIN_GOVERNANCE_EXECUTOR; -const VOTING_PERIOD = 115200; +// const VOTING_PERIOD = 115200; export const { DEFAULT_PROPOSER_ADDRESS, @@ -193,7 +193,10 @@ export const testVip = (description: string, proposal: Proposal, options: Testin }); it("should be queued successfully", async () => { - await mineUpTo((await ethers.provider.getBlockNumber()) + VOTING_PERIOD + 1); + // Mine up to proposal endBlock + 1 to ensure proposal is succeeded + const proposalData = await governorProxy.proposals(proposalId); + const endBlock = proposalData.endBlock.toNumber(); + await mineUpTo(endBlock + 1); const tx = await governorProxy.connect(proposer).queue(proposalId); await tx.wait(); }); diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-790/bscmainnet.ts index 345f924f3..aaf1832ef 100644 --- a/vips/vip-790/bscmainnet.ts +++ b/vips/vip-790/bscmainnet.ts @@ -30,29 +30,6 @@ const XVS_VAULT_CONVERTER = "0xd5b9AE835F4C59272032B3B954417179573331E0"; const WBNB_BURN_CONVERTER = "0x9eF79830e626C8ccA7e46DCEd1F90e51E7cFCeBE"; export const CONVERSION_INCENTIVE = 1e14; -// Capped oracles -export const DAYS_30 = 30 * 24 * 60 * 60; -export const increaseExchangeRateByPercentage = ( - exchangeRate: BigNumber, - percentage: BigNumber, // BPS value (e.g., 10000 for 100%) -) => { - const increaseAmount = exchangeRate.mul(percentage).div(10000); - return exchangeRate.add(increaseAmount).toString(); -}; -export const getSnapshotGap = ( - exchangeRate: BigNumber, - percentage: number, // BPS value (e.g., 10000 for 100%) -) => { - // snapshot gap is percentage of the exchange rate - const snapshotGap = exchangeRate.mul(percentage).div(10000); - return snapshotGap.toString(); -}; -export const SECONDS_PER_YEAR = 31536000; -export const PTCLISBNB25JUN2026_InitialExchangeRate = parseUnits("1.034146782295294254", 18); -export const PTCLISBNB25JUN2026_Timestamp = 1768293952; -export const PTCLISBNB25JUN2026_GrowthRate = SECONDS_PER_YEAR; // 0% per year -export const PTCLISBNB25JUN2026_SnapshotGap = 400; // 4.00% - export const converterBaseAssets = { [RISK_FUND_CONVERTER]: USDT, [USDT_PRIME_CONVERTER]: USDT, @@ -168,27 +145,6 @@ export const vip790 = () => { ], ], }, - { - target: PT_clisBNB_PENDLE_ORACLE, - signature: "setSnapshot(uint256,uint256)", - params: [ - increaseExchangeRateByPercentage( - PTCLISBNB25JUN2026_InitialExchangeRate, - BigNumber.from(PTCLISBNB25JUN2026_SnapshotGap), - ), - PTCLISBNB25JUN2026_Timestamp, - ], - }, - { - target: PT_clisBNB_PENDLE_ORACLE, - signature: "setGrowthRate(uint256,uint256)", - params: [PTCLISBNB25JUN2026_GrowthRate, DAYS_30], - }, - { - target: PT_clisBNB_PENDLE_ORACLE, - signature: "setSnapshotGap(uint256)", - params: [getSnapshotGap(PTCLISBNB25JUN2026_InitialExchangeRate, PTCLISBNB25JUN2026_SnapshotGap)], - }, { target: marketSpecs.vToken.comptroller, signature: "_supportMarket(address)", diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts index 87f968591..e0c9cb030 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-790/bsctestnet.ts @@ -31,32 +31,6 @@ const ETH_PRIME_CONVERTER = "0xf358650A007aa12ecC8dac08CF8929Be7f72A4D9"; const XVS_VAULT_CONVERTER = "0x258f49254C758a0E37DAb148ADDAEA851F4b02a2"; export const CONVERSION_INCENTIVE = 1e14; -// Capped oracles -export const DAYS_30 = 30 * 24 * 60 * 60; -export const increaseExchangeRateByPercentage = ( - exchangeRate: BigNumber, - percentage: BigNumber, // BPS value (e.g., 10000 for 100%) -) => { - const increaseAmount = exchangeRate.mul(percentage).div(10000); - return exchangeRate.add(increaseAmount).toString(); -}; - -export const getSnapshotGap = ( - exchangeRate: BigNumber, - percentage: number, // BPS value (e.g., 10000 for 100%) -) => { - // snapshot gap is percentage of the exchange rate - const snapshotGap = exchangeRate.mul(percentage).div(10000); - return snapshotGap.toString(); -}; - -export const SECONDS_PER_YEAR = 31536000; -export const PT_clisBNB_25JUN2026_InitialExchangeRate = parseUnits("1.034169826638422493", 18); -export const PT_clisBNB_25JUN2026_Timestamp = 1758874206; -export const PT_clisBNB_25JUN2026_GrowthRate = SECONDS_PER_YEAR; // 0% per year -export const PT_clisBNB_25JUN2026_SnapshotGap = 400; // 4.00% -export const MAIN_ORACLE_ROLE = 0; - export const converterBaseAssets = { [RISK_FUND_CONVERTER]: USDT, [USDT_PRIME_CONVERTER]: USDT, @@ -177,28 +151,6 @@ export const vip790 = () => { ], ], }, - { - target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, - signature: "setSnapshot(uint256,uint256)", - params: [ - increaseExchangeRateByPercentage( - PT_clisBNB_25JUN2026_InitialExchangeRate, - BigNumber.from(PT_clisBNB_25JUN2026_SnapshotGap), - ), - PT_clisBNB_25JUN2026_Timestamp, - ], - }, - { - target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, - signature: "setGrowthRate(uint256,uint256)", - params: [PT_clisBNB_25JUN2026_GrowthRate, DAYS_30], - }, - { - target: PT_clisBNB_25JUN2026_PENDLE_ORACLE, - signature: "setSnapshotGap(uint256)", - params: [getSnapshotGap(PT_clisBNB_25JUN2026_InitialExchangeRate, PT_clisBNB_25JUN2026_SnapshotGap)], - }, - // Add Market { target: marketSpecs.vToken.comptroller, From a9069e4cb65402355712a1d5d2dc15df981e560a Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 15 Jan 2026 13:57:14 +0530 Subject: [PATCH 07/14] feat: update considering Fermi hardfork --- src/vip-framework/index.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index acd588ef9..5176b2df4 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -30,7 +30,7 @@ const OMNICHAIN_PROPOSAL_SENDER = getOmnichainProposalSenderAddress(); const OMNICHAIN_GOVERNANCE_EXECUTOR = NETWORK_ADDRESSES[FORKED_NETWORK as REMOTE_NETWORKS].OMNICHAIN_GOVERNANCE_EXECUTOR; -// const VOTING_PERIOD = 115200; +const VOTING_PERIOD = 192384; export const { DEFAULT_PROPOSER_ADDRESS, @@ -193,10 +193,7 @@ export const testVip = (description: string, proposal: Proposal, options: Testin }); it("should be queued successfully", async () => { - // Mine up to proposal endBlock + 1 to ensure proposal is succeeded - const proposalData = await governorProxy.proposals(proposalId); - const endBlock = proposalData.endBlock.toNumber(); - await mineUpTo(endBlock + 1); + await mineUpTo((await ethers.provider.getBlockNumber()) + VOTING_PERIOD + 1); const tx = await governorProxy.connect(proposer).queue(proposalId); await tx.wait(); }); From 6c2103a3de6bc89cde43afa883612550a64f7841 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 15 Jan 2026 14:17:10 +0530 Subject: [PATCH 08/14] feat: add comment --- src/vip-framework/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index 5176b2df4..f63594087 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -30,6 +30,12 @@ const OMNICHAIN_PROPOSAL_SENDER = getOmnichainProposalSenderAddress(); const OMNICHAIN_GOVERNANCE_EXECUTOR = NETWORK_ADDRESSES[FORKED_NETWORK as REMOTE_NETWORKS].OMNICHAIN_GOVERNANCE_EXECUTOR; +// VOTING_PERIOD is updated for the Fermi upgrade. +// Previous blocks/year: 42,048,000 +// After Fermi: 70,080,000 +// Ratio: 70,080,000 / 42,048,000 = 1.67 +// Previous voting period: 115,200 +// New voting period: 115,200 * 1.67 = 192,384 const VOTING_PERIOD = 192384; export const { From 53328ed5d204d208348faa2ae697194a1a613787 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Thu, 15 Jan 2026 14:58:30 +0530 Subject: [PATCH 09/14] refactor: added detailed comment --- simulations/vip-790/bscmainnet.ts | 147 ++++++++++++++++++++++++++++-- simulations/vip-790/bsctestnet.ts | 116 ++++++++++++++++++++++- 2 files changed, 249 insertions(+), 14 deletions(-) diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-790/bscmainnet.ts index 75ca7e7f2..47a582f08 100644 --- a/simulations/vip-790/bscmainnet.ts +++ b/simulations/vip-790/bscmainnet.ts @@ -1,3 +1,23 @@ +/** + * @title VIP-790 Simulation Test for BSC Mainnet + * @notice This simulation test validates the listing of PT_clisBNB_25JUN2026 (Pendle Principal Token) + * market in the Venus Protocol on BSC Mainnet. + * + * @dev The test performs the following validations: + * 1. Pre-VIP: Verifies the market is not yet listed + * 2. VIP Execution: Runs the VIP and validates emitted events + * 3. Post-VIP: Validates all market configurations including: + * - Interest rate model parameters + * - VToken properties (name, symbol, decimals, exchange rate) + * - Risk parameters (collateral factor, liquidation threshold, caps) + * - Oracle price configuration + * - Access control and ownership + * - Initial supply distribution and vToken burning + * - Borrowing restrictions (paused and not allowed) + * - Converter incentive configurations + * - E-mode pool risk parameters + * - User mint/redeem functionality + */ import { expect } from "chai"; import { Contract, Signer } from "ethers"; import { parseUnits } from "ethers/lib/utils"; @@ -25,29 +45,51 @@ import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; import VTOKEN_ABI from "./abi/VToken.json"; +// Network-specific addresses for BSC Mainnet const { bscmainnet } = NETWORK_ADDRESSES; + +// Special address used to represent native BNB in the protocol const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; + +// Chainlink BNB/USD price feed address on BSC Mainnet const BNB_FEED = "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE"; + +// Address holding PT_clisBNB_25JUN2026 tokens for testing mint/redeem operations const PT_clisBNB_25JUN2026_HOLDER = "0x3B7e10fFe65c5A59475055D489F71699F7dabfF4"; +/** + * Fork BSC Mainnet at block 75229002 to simulate VIP-790 execution + * This allows testing against the actual mainnet state at a specific block height + */ forking(75229002, async () => { - let comptroller: Contract; - let resilientOracle: Contract; - let Pt_clisBNB_25JUN2026: Contract; - let vPT_clisBNB_25JUN2026: Contract; - let bnb: Contract; - let testUser: Signer; - + // Contract instances used throughout the tests + let comptroller: Contract; // Pool comptroller for managing market configurations + let resilientOracle: Contract; // Venus resilient oracle for price feeds + let Pt_clisBNB_25JUN2026: Contract; // Underlying PT token (Pendle Principal Token) + let vPT_clisBNB_25JUN2026: Contract; // VToken representing the Venus market for PT_clisBNB_25JUN2026 + let bnb: Contract; // BNB token contract for oracle configuration + let testUser: Signer; // Test user signer for mint/redeem operations + + /** + * @notice Setup hook that runs before all tests + * @dev Initializes contract instances and configures oracle stale periods + * Also transfers PT tokens to test user for mint/redeem testing + */ before(async () => { const provider = ethers.provider; + + // Initialize contract instances with their respective ABIs comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); Pt_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.underlying.address, ERC20_ABI, provider); vPT_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); resilientOracle = new ethers.Contract(bscmainnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); + // Get a signer for user interaction tests const [signer] = await ethers.getSigners(); testUser = signer; + // Transfer PT tokens from a holder to the test user for mint/redeem testing + // initMainnetUser impersonates the holder address and funds it with ETH for gas const PT_clisBNB_25JUN2026Holder = await initMainnetUser( PT_clisBNB_25JUN2026_HOLDER, ethers.utils.parseEther("10"), @@ -57,9 +99,11 @@ forking(75229002, async () => { parseUnits("10", 18), ); - // set maxStalePeriod + // Configure oracle stale periods to prevent price staleness errors during testing + // This is necessary because forked state may have outdated price timestamps bnb = new ethers.Contract(NATIVE_TOKEN_ADDR, ERC20_ABI, ethers.provider); + // Set max stale period for BNB price feed (10 years = 315360000 seconds) const CHAINLINK_ORACLE_BNB = "0x8455EFA4D7Ff63b8BFD96AdD889483Ea7d39B70a"; await setMaxStalePeriodInChainlinkOracle( CHAINLINK_ORACLE_BNB, @@ -69,21 +113,46 @@ forking(75229002, async () => { 315360000, ); + // Set max stale periods in the resilient oracle for BNB and PT token await setMaxStalePeriod(resilientOracle, bnb); await setMaxStalePeriod(resilientOracle, Pt_clisBNB_25JUN2026); }); + /** + * @notice Pre-VIP behavior tests + * @dev Validates the state before VIP execution to ensure: + * - The PT_clisBNB_25JUN2026 market is not yet listed + * - The BNB E-mode pool exists (required for E-mode configuration) + */ describe("Pre-VIP behavior", async () => { + // Verify that the market does not exist before VIP execution it("check PT_clisBNB_25JUN2026 market not listed", async () => { const market = await comptroller.markets(marketSpecs.vToken.address); expect(market.isListed).to.equal(false); }); + // Verify that the E-mode pool ID already exists in the comptroller + // This is a prerequisite for adding the market to the E-mode pool it("check BNB Emode PoolId exist", async () => { expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); }); }); + /** + * @notice Execute VIP-790 and validate emitted events + * @dev The VIP execution should emit the following events: + * - MarketListed: Market is added to the comptroller (1 event) + * - NewSupplyCap: Supply cap is set for the market (1 event) + * - NewBorrowCap: Borrow cap is set for the market (1 event) + * - NewAccessControlManager: ACM is configured for the vToken (1 event) + * - NewProtocolShareReserve: PSR is set for the vToken (1 event) + * - NewReduceReservesBlockDelta: Reserve reduction block delta is set (1 event) + * - NewReserveFactor: Reserve factor is configured (1 event) + * - NewCollateralFactor: Collateral factor is set (1 event) + * - NewLiquidationThreshold: Liquidation threshold is set (1 event) + * - NewLiquidationIncentive: Liquidation incentive is set (2 events - base + E-mode) + * - PoolMarketInitialized: Market is initialized in the E-mode pool (1 event) + */ testVip("VIP-790", await vip790(), { callbackAfterExecution: async txResponse => { await expectEvents( @@ -107,11 +176,21 @@ forking(75229002, async () => { }, }); + /** + * @notice Post-VIP behavior tests + * @dev Comprehensive validation of market state after VIP execution + * Tests cover all aspects of market configuration including: + * - Interest rate model, vToken properties, risk parameters + * - Oracle pricing, ownership, access control + * - Initial supply distribution and borrowing restrictions + */ describe("Post-VIP behavior", async () => { + // Verify the correct interest rate model is assigned to the market it("check new IRM", async () => { expect(await vPT_clisBNB_25JUN2026.interestRateModel()).to.equal(RATE_MODEL); }); + // Validate interest rate model parameters (base rate, multiplier, jump multiplier, kink) checkInterestRate(RATE_MODEL, "vPT_clisBNB_25JUN2026", { base: marketSpecs.interestRateModel.baseRatePerYear, multiplier: marketSpecs.interestRateModel.multiplierPerYear, @@ -119,6 +198,7 @@ forking(75229002, async () => { kink: marketSpecs.interestRateModel.kink, }); + // Validate vToken properties (name, symbol, decimals, underlying, exchange rate, comptroller) checkVToken(marketSpecs.vToken.address, { name: marketSpecs.vToken.name, symbol: marketSpecs.vToken.symbol, @@ -128,26 +208,34 @@ forking(75229002, async () => { comptroller: marketSpecs.vToken.comptroller, }); + // Validate risk parameters (collateral factor, liquidation threshold, supply/borrow caps) checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); + // Verify the oracle returns the correct price for PT_clisBNB_25JUN2026 + // Price is denominated in USD with 18 decimals it("check price PT_clisBNB_25JUN2026", async () => { - const expectedPrice = parseUnits("912.542908694200730345", 18); + const expectedPrice = parseUnits("912.542911682632512322", 18); const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); expect(underlyingPrice).to.equal(expectedPrice); }); + // Verify the market admin is set to the Normal Timelock (governance) it("market have correct owner", async () => { expect(await vPT_clisBNB_25JUN2026.admin()).to.equal(bscmainnet.NORMAL_TIMELOCK); }); + // Verify the Access Control Manager is correctly configured it("market have correct ACM", async () => { expect(await vPT_clisBNB_25JUN2026.accessControlManager()).to.equal(bscmainnet.ACCESS_CONTROL_MANAGER); }); + // Verify the Protocol Share Reserve address for revenue distribution it("market should have correct protocol share reserve", async () => { expect(await vPT_clisBNB_25JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); }); + // Verify total supply matches the initial supply after VIP execution + // Total supply = initial amount converted to vTokens using exchange rate it("market should have correct total supply", async () => { const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); expect(vPT_clisBNB_25JUN2026Supply).to.equal( @@ -155,11 +243,14 @@ forking(75229002, async () => { ); }); + // Verify vTokens were burned by sending to the zero address + // This is a security measure to establish initial exchange rate it("should burn vTokens", async () => { const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); }); + // Verify remaining vTokens (after burning) are transferred to the designated receiver it("should transfer remaining vTokens to receiver", async () => { const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); expect(slisBNBReceiverBalance).to.equal( @@ -169,24 +260,35 @@ forking(75229002, async () => { ); }); + // Verify no vTokens remain in the timelock after distribution it("should not leave any vTokens in the timelock", async () => { const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bscmainnet.NORMAL_TIMELOCK); expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); }); + // Verify borrowing is paused for this market (action type 2 = Borrow) + // PT tokens are collateral-only, borrowing should be disabled it("should pause vPT_clisBNB_25JUN2026 market", async () => { expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); }); + // Verify isBorrowAllowed flag is set to false in market configuration it("should set borrowAllowed to False for vPT_clisBNB_25JUN2026 market", async () => { const vPT_clisBNB_25JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); expect(vPT_clisBNB_25JUN2026Market.isBorrowAllowed).to.equal(false); }); + /** + * @notice Converter configuration tests + * @dev Validates that token converters are properly configured with the correct + * conversion incentive for PT_clisBNB_25JUN2026 token conversions. + * Converters allow users to swap tokens with an incentive bonus. + */ describe("Converters", () => { for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + // Verify each converter has the correct incentive configured for PT token conversions it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_clisBNB_25JUN2026`, async () => { const result = await converterContract.conversionConfigurations( baseAsset, @@ -197,12 +299,21 @@ forking(75229002, async () => { } }); + /** + * @notice E-mode (Efficiency Mode) pool configuration tests + * @dev E-mode allows higher capital efficiency for correlated assets. + * This validates that all markets in the BNB E-mode pool have correct + * risk parameters configured (collateral factor, liquidation threshold, etc.) + */ describe("emode", () => { + // Verify each market in the E-mode pool has correct risk parameters it("should set the correct risk parameters to all pool markets", async () => { for (const config of Object.values(EMODE_POOL.marketsConfig)) { const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); + // Verify market is correctly assigned to the E-mode pool expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); expect(marketData.isListed).to.be.equal(true); + // Verify risk parameters match the configured values expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); @@ -211,25 +322,41 @@ forking(75229002, async () => { }); }); + /** + * @notice User interaction tests for minting and redeeming vTokens + * @dev Tests that users can successfully: + * 1. Mint vTokens by depositing PT_clisBNB_25JUN2026 as collateral + * 2. Redeem underlying PT tokens by burning vTokens + * These tests validate the core supply/withdraw functionality of the market. + */ describe("Mint and redeem PT_clisBNB_25JUN2026", async () => { + // Test that users can mint vTokens by depositing underlying PT tokens it("User can mint vU", async () => { const userAddress = await testUser.getAddress(); const mintAmount = parseUnits("5", 18); - // Enter market so minted vU can be used as collateral for borrowing + // Enter the market to enable the minted vTokens as collateral await comptroller.connect(testUser).enterMarkets([vPT_clisBNB_25JUN2026.address]); + // Record balance before mint, approve token transfer, and execute mint const vTokenBalBefore = await vPT_clisBNB_25JUN2026.balanceOf(userAddress); await Pt_clisBNB_25JUN2026.connect(testUser).approve(vPT_clisBNB_25JUN2026.address, mintAmount); await vPT_clisBNB_25JUN2026.connect(testUser).mint(mintAmount); + + // Verify user received vTokens expect(await vPT_clisBNB_25JUN2026.balanceOf(userAddress)).to.be.gt(vTokenBalBefore); }); + // Test that users can redeem underlying tokens by burning vTokens it("User can redeem vU", async () => { const userAddress = await testUser.getAddress(); const uBalBefore = await Pt_clisBNB_25JUN2026.balanceOf(userAddress); const redeemAmount = parseUnits("0.5", 18); + + // Redeem underlying tokens (burns vTokens proportionally) await vPT_clisBNB_25JUN2026.connect(testUser).redeemUnderlying(redeemAmount); + + // Verify user received underlying PT tokens expect(await Pt_clisBNB_25JUN2026.balanceOf(userAddress)).to.be.gt(uBalBefore); }); }); diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-790/bsctestnet.ts index 709395c43..b676dd8d3 100644 --- a/simulations/vip-790/bsctestnet.ts +++ b/simulations/vip-790/bsctestnet.ts @@ -1,3 +1,25 @@ +/** + * @title VIP-790 Simulation Test for BSC Testnet + * @notice This simulation test validates the listing of PT_clisBNB_25JUN2026 (Pendle Principal Token) + * market in the Venus Protocol on BSC Testnet. + * + * @dev The test performs the following validations: + * 1. Pre-VIP: Verifies the market is not yet listed and E-mode pool exists but is inactive + * 2. VIP Execution: Runs the VIP and validates emitted events + * 3. Post-VIP: Validates all market configurations including: + * - Interest rate model parameters + * - VToken properties (name, symbol, decimals, exchange rate) + * - Risk parameters (collateral factor, liquidation threshold, caps) + * - Oracle price configuration + * - Access control and ownership + * - Initial supply distribution and vToken burning + * - Borrowing restrictions (paused and not allowed) + * - Converter incentive configurations + * - E-mode pool risk parameters + * + * @notice Unlike mainnet, testnet does not include mint/redeem user interaction tests + * as those are primarily for validating production functionality. + */ import { expect } from "chai"; import { Contract } from "ethers"; import { ethers } from "hardhat"; @@ -23,21 +45,38 @@ import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; import VTOKEN_ABI from "./abi/VToken.json"; +// Network-specific addresses for BSC Testnet const { bsctestnet } = NETWORK_ADDRESSES; + +// Special address used to represent native BNB in the protocol const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; +/** + * Fork BSC Testnet at block 84342013 to simulate VIP-790 execution + * This allows testing against the actual testnet state at a specific block height + */ forking(84342013, async () => { - let comptroller: Contract; - let resilientOracle: Contract; - let vPT_clisBNB_25JUN2026: Contract; + // Contract instances used throughout the tests + let comptroller: Contract; // Pool comptroller for managing market configurations + let resilientOracle: Contract; // Venus resilient oracle for price feeds + let vPT_clisBNB_25JUN2026: Contract; // VToken representing the Venus market for PT_clisBNB_25JUN2026 + /** + * @notice Setup hook that runs before all tests + * @dev Initializes contract instances and configures oracle stale periods + * to prevent price staleness errors during testing on forked state + */ before(async () => { const provider = ethers.provider; + + // Initialize contract instances with their respective ABIs comptroller = new ethers.Contract(marketSpecs.vToken.comptroller, COMPTROLLER_ABI, provider); vPT_clisBNB_25JUN2026 = new ethers.Contract(marketSpecs.vToken.address, VTOKEN_ABI, provider); resilientOracle = new ethers.Contract(bsctestnet.RESILIENT_ORACLE, RESILIENT_ORACLE_ABI, ethers.provider); - // set maxStalePeriod + // Configure oracle stale period for BNB to prevent price staleness errors during testing + // Set max stale period to 10 years (315360000 seconds) for testing purposes + // Using AddressZero for feed address on testnet as it uses a different oracle setup await setMaxStalePeriodInChainlinkOracle( bsctestnet.CHAINLINK_ORACLE, NATIVE_TOKEN_ADDR, @@ -47,22 +86,49 @@ forking(84342013, async () => { ); }); + /** + * @notice Pre-VIP behavior tests + * @dev Validates the state before VIP execution to ensure: + * - The PT_clisBNB_25JUN2026 market is not yet listed + * - The BNB E-mode pool ID exists (required for E-mode configuration) + * - The E-mode pool is not yet active (will be activated by VIP) + */ describe("Pre-VIP behavior", async () => { + // Verify that the market does not exist before VIP execution it("check PT_clisBNB_25JUN2026 market not listed", async () => { const market = await comptroller.markets(marketSpecs.vToken.address); expect(market.isListed).to.equal(false); }); + // Verify that the E-mode pool ID already exists in the comptroller + // This is a prerequisite for adding the market to the E-mode pool it("check BNB Emode PoolId exist", async () => { expect(await comptroller.lastPoolId()).to.be.greaterThanOrEqual(EMODE_POOL.id); }); + // Verify that the E-mode pool is not active before VIP execution + // The VIP will activate this pool when adding the market it("check BNB Emode Pool not active", async () => { const poolData = await comptroller.pools(EMODE_POOL.id); expect(poolData.isActive).to.equal(false); }); }); + /** + * @notice Execute VIP-790 and validate emitted events + * @dev The VIP execution should emit the following events: + * - MarketListed: Market is added to the comptroller (1 event) + * - NewSupplyCap: Supply cap is set for the market (1 event) + * - NewBorrowCap: Borrow cap is set for the market (1 event) + * - NewAccessControlManager: ACM is configured for the vToken (1 event) + * - NewProtocolShareReserve: PSR is set for the vToken (1 event) + * - NewReduceReservesBlockDelta: Reserve reduction block delta is set (1 event) + * - NewReserveFactor: Reserve factor is configured (1 event) + * - NewCollateralFactor: Collateral factor is set (1 event) + * - NewLiquidationThreshold: Liquidation threshold is set (1 event) + * - NewLiquidationIncentive: Liquidation incentive is set (2 events - base + E-mode) + * - PoolMarketInitialized: Market is initialized in the E-mode pool (1 event) + */ testVip("VIP-790", await vip790(), { callbackAfterExecution: async txResponse => { await expectEvents( @@ -86,11 +152,21 @@ forking(84342013, async () => { }, }); + /** + * @notice Post-VIP behavior tests + * @dev Comprehensive validation of market state after VIP execution + * Tests cover all aspects of market configuration including: + * - Interest rate model, vToken properties, risk parameters + * - Oracle pricing, ownership, access control + * - Initial supply distribution and borrowing restrictions + */ describe("Post-VIP behavior", async () => { + // Verify the correct interest rate model is assigned to the market it("check new IRM", async () => { expect(await vPT_clisBNB_25JUN2026.interestRateModel()).to.equal(RATE_MODEL); }); + // Validate interest rate model parameters (base rate, multiplier, jump multiplier, kink) checkInterestRate(RATE_MODEL, "vPT_clisBNB_25JUN2026", { base: marketSpecs.interestRateModel.baseRatePerYear, multiplier: marketSpecs.interestRateModel.multiplierPerYear, @@ -98,6 +174,7 @@ forking(84342013, async () => { kink: marketSpecs.interestRateModel.kink, }); + // Validate vToken properties (name, symbol, decimals, underlying, exchange rate, comptroller) checkVToken(marketSpecs.vToken.address, { name: marketSpecs.vToken.name, symbol: marketSpecs.vToken.symbol, @@ -107,25 +184,33 @@ forking(84342013, async () => { comptroller: marketSpecs.vToken.comptroller, }); + // Validate risk parameters (collateral factor, liquidation threshold, supply/borrow caps) checkRiskParameters(marketSpecs.vToken.address, marketSpecs.vToken, marketSpecs.riskParameters); + // Verify the oracle returns a non-zero price for PT_clisBNB_25JUN2026 + // On testnet, we only verify the price is non-zero (not an exact value like mainnet) it("check price PT_clisBNB_25JUN2026", async () => { const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); expect(underlyingPrice).to.not.equal(0); }); + // Verify the market admin is set to the Normal Timelock (governance) it("market have correct owner", async () => { expect(await vPT_clisBNB_25JUN2026.admin()).to.equal(bsctestnet.NORMAL_TIMELOCK); }); + // Verify the Access Control Manager is correctly configured it("market have correct ACM", async () => { expect(await vPT_clisBNB_25JUN2026.accessControlManager()).to.equal(bsctestnet.ACCESS_CONTROL_MANAGER); }); + // Verify the Protocol Share Reserve address for revenue distribution it("market should have correct protocol share reserve", async () => { expect(await vPT_clisBNB_25JUN2026.protocolShareReserve()).to.equal(PROTOCOL_SHARE_RESERVE); }); + // Verify total supply matches the initial supply after VIP execution + // Total supply = initial amount converted to vTokens using exchange rate it("market should have correct total supply", async () => { const vPT_clisBNB_25JUN2026Supply = await vPT_clisBNB_25JUN2026.totalSupply(); expect(vPT_clisBNB_25JUN2026Supply).to.equal( @@ -133,11 +218,14 @@ forking(84342013, async () => { ); }); + // Verify vTokens were burned by sending to the zero address + // This is a security measure to establish initial exchange rate it("should burn vTokens", async () => { const vPT_clisBNB_25JUN2026BalanceBurned = await vPT_clisBNB_25JUN2026.balanceOf(ethers.constants.AddressZero); expect(vPT_clisBNB_25JUN2026BalanceBurned).to.equal(marketSpecs.initialSupply.vTokensToBurn); }); + // Verify remaining vTokens (after burning) are transferred to the designated receiver it("should transfer remaining vTokens to receiver", async () => { const slisBNBReceiverBalance = await vPT_clisBNB_25JUN2026.balanceOf(marketSpecs.initialSupply.vTokenReceiver); expect(slisBNBReceiverBalance).to.equal( @@ -147,24 +235,35 @@ forking(84342013, async () => { ); }); + // Verify no vTokens remain in the timelock after distribution it("should not leave any vTokens in the timelock", async () => { const vPT_clisBNB_25JUN2026TimelockBalance = await vPT_clisBNB_25JUN2026.balanceOf(bsctestnet.NORMAL_TIMELOCK); expect(vPT_clisBNB_25JUN2026TimelockBalance).to.equal(0); }); + // Verify borrowing is paused for this market (action type 2 = Borrow) + // PT tokens are collateral-only, borrowing should be disabled it("should pause vPT_clisBNB_25JUN2026 market", async () => { expect(await comptroller.actionPaused(marketSpecs.vToken.address, 2)).to.equal(true); }); + // Verify isBorrowAllowed flag is set to false in market configuration it("should set borrowAllowed to False for vPT_clisBNB_25JUN2026 market", async () => { const vPT_clisBNB_25JUN2026Market = await comptroller.markets(marketSpecs.vToken.address); expect(vPT_clisBNB_25JUN2026Market.isBorrowAllowed).to.equal(false); }); + /** + * @notice Converter configuration tests + * @dev Validates that token converters are properly configured with the correct + * conversion incentive for PT_clisBNB_25JUN2026 token conversions. + * Converters allow users to swap tokens with an incentive bonus. + */ describe("Converters", () => { for (const [converterAddress, baseAsset] of Object.entries(converterBaseAssets)) { const converterContract = new ethers.Contract(converterAddress, SINGLE_TOKEN_CONVERTER_ABI, ethers.provider); + // Verify each converter has the correct incentive configured for PT token conversions it(`should set ${CONVERSION_INCENTIVE} as incentive in converter ${converterAddress}, for asset vPT_clisBNB_25JUN2026`, async () => { const result = await converterContract.conversionConfigurations( baseAsset, @@ -175,12 +274,21 @@ forking(84342013, async () => { } }); + /** + * @notice E-mode (Efficiency Mode) pool configuration tests + * @dev E-mode allows higher capital efficiency for correlated assets. + * This validates that all markets in the BNB E-mode pool have correct + * risk parameters configured (collateral factor, liquidation threshold, etc.) + */ describe("emode", () => { + // Verify each market in the E-mode pool has correct risk parameters it("should set the correct risk parameters to all pool markets", async () => { for (const config of Object.values(EMODE_POOL.marketsConfig)) { const marketData = await comptroller.poolMarkets(EMODE_POOL.id, config.address); + // Verify market is correctly assigned to the E-mode pool expect(marketData.marketPoolId).to.be.equal(EMODE_POOL.id); expect(marketData.isListed).to.be.equal(true); + // Verify risk parameters match the configured values expect(marketData.collateralFactorMantissa).to.be.equal(config.collateralFactor); expect(marketData.liquidationThresholdMantissa).to.be.equal(config.liquidationThreshold); expect(marketData.liquidationIncentiveMantissa).to.be.equal(config.liquidationIncentive); From 83f9f1965ed40da4ddf680688f346928eb6b41ea Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 16 Jan 2026 16:00:29 +0530 Subject: [PATCH 10/14] chore: remove unused ABI files --- simulations/vip-790/abi/CappedOracle.json | 227 -------------------- simulations/vip-790/abi/RedstoneOracle.json | 187 ---------------- simulations/vip-790/abi/VTreasury.json | 83 ------- 3 files changed, 497 deletions(-) delete mode 100644 simulations/vip-790/abi/CappedOracle.json delete mode 100644 simulations/vip-790/abi/RedstoneOracle.json delete mode 100644 simulations/vip-790/abi/VTreasury.json diff --git a/simulations/vip-790/abi/CappedOracle.json b/simulations/vip-790/abi/CappedOracle.json deleted file mode 100644 index d0fd7248e..000000000 --- a/simulations/vip-790/abi/CappedOracle.json +++ /dev/null @@ -1,227 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { "internalType": "address", "name": "market", "type": "address" }, - { "internalType": "address", "name": "ptOracle", "type": "address" }, - { "internalType": "enum PendleOracle.RateKind", "name": "rateKind", "type": "uint8" }, - { "internalType": "address", "name": "ptToken", "type": "address" }, - { "internalType": "address", "name": "underlyingToken", "type": "address" }, - { "internalType": "address", "name": "resilientOracle", "type": "address" }, - { "internalType": "uint32", "name": "twapDuration", "type": "uint32" }, - { "internalType": "uint256", "name": "annualGrowthRate", "type": "uint256" }, - { "internalType": "uint256", "name": "snapshotInterval", "type": "uint256" }, - { "internalType": "uint256", "name": "initialSnapshotMaxExchangeRate", "type": "uint256" }, - { "internalType": "uint256", "name": "initialSnapshotTimestamp", "type": "uint256" }, - { "internalType": "address", "name": "accessControlManager", "type": "address" }, - { "internalType": "uint256", "name": "snapshotGap", "type": "uint256" } - ], - "internalType": "struct PendleOracle.ConstructorParams", - "name": "params", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "InvalidDuration", "type": "error" }, - { "inputs": [], "name": "InvalidGrowthRate", "type": "error" }, - { "inputs": [], "name": "InvalidInitialSnapshot", "type": "error" }, - { "inputs": [], "name": "InvalidSnapshotMaxExchangeRate", "type": "error" }, - { "inputs": [], "name": "InvalidTokenAddress", "type": "error" }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "address", "name": "calledContract", "type": "address" }, - { "internalType": "string", "name": "methodSignature", "type": "string" } - ], - "name": "Unauthorized", - "type": "error" - }, - { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, - { "inputs": [], "name": "ZeroValueNotAllowed", "type": "error" }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "oldGrowthRatePerSecond", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "newGrowthRatePerSecond", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "oldSnapshotInterval", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "newSnapshotInterval", "type": "uint256" } - ], - "name": "GrowthRateUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "oldSnapshotGap", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "newSnapshotGap", "type": "uint256" } - ], - "name": "SnapshotGapUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "maxExchangeRate", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "timestamp", "type": "uint256" } - ], - "name": "SnapshotUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "ACCESS_CONTROL_MANAGER", - "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "CORRELATED_TOKEN", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MARKET", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "PT_ORACLE", - "outputs": [{ "internalType": "contract IPendlePtOracle", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RATE_KIND", - "outputs": [{ "internalType": "enum PendleOracle.RateKind", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "RESILIENT_ORACLE", - "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TWAP_DURATION", - "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UNDERLYING_DECIMALS", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UNDERLYING_TOKEN", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getMaxAllowedExchangeRate", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], - "name": "getPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUnderlyingAmount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "growthRatePerSecond", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isCapped", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_annualGrowthRate", "type": "uint256" }, - { "internalType": "uint256", "name": "_snapshotInterval", "type": "uint256" } - ], - "name": "setGrowthRate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_snapshotMaxExchangeRate", "type": "uint256" }, - { "internalType": "uint256", "name": "_snapshotTimestamp", "type": "uint256" } - ], - "name": "setSnapshot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_snapshotGap", "type": "uint256" }], - "name": "setSnapshotGap", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "snapshotGap", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "snapshotInterval", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "snapshotMaxExchangeRate", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "snapshotTimestamp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "updateSnapshot", "outputs": [], "stateMutability": "nonpayable", "type": "function" } -] diff --git a/simulations/vip-790/abi/RedstoneOracle.json b/simulations/vip-790/abi/RedstoneOracle.json deleted file mode 100644 index 7dd5f6f5f..000000000 --- a/simulations/vip-790/abi/RedstoneOracle.json +++ /dev/null @@ -1,187 +0,0 @@ -[ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "address", "name": "calledContract", "type": "address" }, - { "internalType": "string", "name": "methodSignature", "type": "string" } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } - ], - "name": "NewAccessControlManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "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": "asset", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "previousPriceMantissa", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "newPriceMantissa", "type": "uint256" } - ], - "name": "PricePosted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "feed", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } - ], - "name": "TokenConfigAdded", - "type": "event" - }, - { - "inputs": [], - "name": "NATIVE_TOKEN_ADDR", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "accessControlManager", - "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], - "name": "getPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "prices", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], - "name": "setAccessControlManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "asset", "type": "address" }, - { "internalType": "uint256", "name": "price", "type": "uint256" } - ], - "name": "setDirectPrice", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "address", "name": "asset", "type": "address" }, - { "internalType": "address", "name": "feed", "type": "address" }, - { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } - ], - "internalType": "struct ChainlinkOracle.TokenConfig", - "name": "tokenConfig", - "type": "tuple" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { "internalType": "address", "name": "asset", "type": "address" }, - { "internalType": "address", "name": "feed", "type": "address" }, - { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } - ], - "internalType": "struct ChainlinkOracle.TokenConfig[]", - "name": "tokenConfigs_", - "type": "tuple[]" - } - ], - "name": "setTokenConfigs", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "tokenConfigs", - "outputs": [ - { "internalType": "address", "name": "asset", "type": "address" }, - { "internalType": "address", "name": "feed", "type": "address" }, - { "internalType": "uint256", "name": "maxStalePeriod", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/simulations/vip-790/abi/VTreasury.json b/simulations/vip-790/abi/VTreasury.json deleted file mode 100644 index df5a655ee..000000000 --- a/simulations/vip-790/abi/VTreasury.json +++ /dev/null @@ -1,83 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "tokenAddress", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } - ], - "name": "WithdrawTreasuryBEP20", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "withdrawAddress", "type": "address" } - ], - "name": "WithdrawTreasuryBNB", - "type": "event" - }, - { "payable": true, "stateMutability": "payable", "type": "fallback" }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "address", "name": "tokenAddress", "type": "address" }, - { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, - { "internalType": "address", "name": "withdrawAddress", "type": "address" } - ], - "name": "withdrawTreasuryBEP20", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { "internalType": "uint256", "name": "withdrawAmount", "type": "uint256" }, - { "internalType": "address payable", "name": "withdrawAddress", "type": "address" } - ], - "name": "withdrawTreasuryBNB", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - } -] From 6ae3300eb651cac0ea2b37efeab911c765b6430d Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 16 Jan 2026 16:01:08 +0530 Subject: [PATCH 11/14] refactor: remove redundant zero-value calls and add clarifying comments --- simulations/vip-790/bscmainnet.ts | 6 +---- simulations/vip-790/bsctestnet.ts | 6 ++--- vips/vip-790/bscmainnet.ts | 42 +++++++++++-------------------- vips/vip-790/bsctestnet.ts | 37 +++++++++------------------ 4 files changed, 30 insertions(+), 61 deletions(-) diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-790/bscmainnet.ts index 47a582f08..066523904 100644 --- a/simulations/vip-790/bscmainnet.ts +++ b/simulations/vip-790/bscmainnet.ts @@ -161,17 +161,13 @@ forking(75229002, async () => { [ "MarketListed", "NewSupplyCap", - "NewBorrowCap", "NewAccessControlManager", "NewProtocolShareReserve", "NewReduceReservesBlockDelta", - "NewReserveFactor", - "NewCollateralFactor", - "NewLiquidationThreshold", "NewLiquidationIncentive", "PoolMarketInitialized", ], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], + [1, 1, 1, 1, 1, 2, 1], ); }, }); diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-790/bsctestnet.ts index b676dd8d3..952e10821 100644 --- a/simulations/vip-790/bsctestnet.ts +++ b/simulations/vip-790/bsctestnet.ts @@ -137,17 +137,15 @@ forking(84342013, async () => { [ "MarketListed", "NewSupplyCap", - "NewBorrowCap", "NewAccessControlManager", "NewProtocolShareReserve", "NewReduceReservesBlockDelta", - "NewReserveFactor", "NewCollateralFactor", "NewLiquidationThreshold", "NewLiquidationIncentive", "PoolMarketInitialized", ], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1], + [1, 1, 1, 1, 1, 1, 1, 2, 1], ); }, }); @@ -161,7 +159,7 @@ forking(84342013, async () => { * - Initial supply distribution and borrowing restrictions */ describe("Post-VIP behavior", async () => { - // Verify the correct interest rate model is assigned to the market + // Verify that the correct interest rate model is assigned to the market at deployment time it("check new IRM", async () => { expect(await vPT_clisBNB_25JUN2026.interestRateModel()).to.equal(RATE_MODEL); }); diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-790/bscmainnet.ts index aaf1832ef..2613607ae 100644 --- a/vips/vip-790/bscmainnet.ts +++ b/vips/vip-790/bscmainnet.ts @@ -150,16 +150,6 @@ export const vip790 = () => { signature: "_supportMarket(address)", params: [marketSpecs.vToken.address], }, - { - target: marketSpecs.vToken.comptroller, - signature: "_setMarketSupplyCaps(address[],uint256[])", - params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], - }, - { - target: marketSpecs.vToken.comptroller, - signature: "_setMarketBorrowCaps(address[],uint256[])", - params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.borrowCap]], - }, { target: marketSpecs.vToken.address, signature: "setAccessControlManager(address)", @@ -175,25 +165,20 @@ export const vip790 = () => { signature: "setReduceReservesBlockDelta(uint256)", params: [REDUCE_RESERVES_BLOCK_DELTA], }, - { - target: marketSpecs.vToken.address, - signature: "_setReserveFactor(uint256)", - params: [marketSpecs.riskParameters.reserveFactor], - }, + + // set risk parameters. Setting liquidation incentive and supply cap only as others are zero { target: marketSpecs.vToken.comptroller, - signature: "setCollateralFactor(address,uint256,uint256)", - params: [ - marketSpecs.vToken.address, - marketSpecs.riskParameters.collateralFactor, - marketSpecs.riskParameters.liquidationThreshold, - ], + signature: "setLiquidationIncentive(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], }, { target: marketSpecs.vToken.comptroller, - signature: "setLiquidationIncentive(address,uint256)", - params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], + signature: "_setMarketSupplyCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], }, + + // Seed initial liquidity { target: bscmainnet.VTREASURY, signature: "withdrawTreasuryBEP20(address,uint256,address)", @@ -214,7 +199,8 @@ export const vip790 = () => { signature: "approve(address,uint256)", params: [marketSpecs.vToken.address, 0], }, - // Burn some vTokens + + // Burn some vTokens to prevents exchange rate manipulation at market launch. { target: marketSpecs.vToken.address, signature: "transfer(address,uint256)", @@ -226,16 +212,18 @@ export const vip790 = () => { signature: "transfer(address,uint256)", params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], }, + + // Pause Borrow actions for vPT_clisBNB_25JUN2026 market { target: marketSpecs.vToken.comptroller, signature: "_setActionsPaused(address[],uint8[],bool)", - params: [[marketSpecs.vToken.address], [2], true], // Pause Borrow actions + params: [[marketSpecs.vToken.address], [2], true], }, - // // Configure converters + // Configure converters ...configureConverters([marketSpecs.vToken.underlying.address]), - // // BNB Emode Group + // BNB Emode Group { target: bscmainnet.UNITROLLER, signature: "setPoolActive(uint96,bool)", diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts index e0c9cb030..2aa73153f 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-790/bsctestnet.ts @@ -151,22 +151,13 @@ export const vip790 = () => { ], ], }, + // Add Market { target: marketSpecs.vToken.comptroller, signature: "_supportMarket(address)", params: [marketSpecs.vToken.address], }, - { - target: marketSpecs.vToken.comptroller, - signature: "_setMarketSupplyCaps(address[],uint256[])", - params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], - }, - { - target: marketSpecs.vToken.comptroller, - signature: "_setMarketBorrowCaps(address[],uint256[])", - params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.borrowCap]], - }, { target: marketSpecs.vToken.address, signature: "setAccessControlManager(address)", @@ -182,25 +173,18 @@ export const vip790 = () => { signature: "setReduceReservesBlockDelta(uint256)", params: [REDUCE_RESERVES_BLOCK_DELTA], }, - { - target: marketSpecs.vToken.address, - signature: "_setReserveFactor(uint256)", - params: [marketSpecs.riskParameters.reserveFactor], - }, + // set risk parameters. Setting liquidation incentive and supply cap only as others are zero { target: marketSpecs.vToken.comptroller, - signature: "setCollateralFactor(address,uint256,uint256)", - params: [ - marketSpecs.vToken.address, - marketSpecs.riskParameters.collateralFactor, - marketSpecs.riskParameters.liquidationThreshold, - ], + signature: "setLiquidationIncentive(address,uint256)", + params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], }, { target: marketSpecs.vToken.comptroller, - signature: "setLiquidationIncentive(address,uint256)", - params: [marketSpecs.vToken.address, marketSpecs.riskParameters.liquidationIncentive], + signature: "_setMarketSupplyCaps(address[],uint256[])", + params: [[marketSpecs.vToken.address], [marketSpecs.riskParameters.supplyCap]], }, + // Seed initial liquidity { target: PT_clisBNB_25JUN2026, signature: "faucet(uint256)", @@ -221,7 +205,7 @@ export const vip790 = () => { signature: "approve(address,uint256)", params: [marketSpecs.vToken.address, 0], }, - // Burn some vTokens + // Burn some vTokens to prevents exchange rate manipulation at market launch. { target: marketSpecs.vToken.address, signature: "transfer(address,uint256)", @@ -233,12 +217,15 @@ export const vip790 = () => { signature: "transfer(address,uint256)", params: [marketSpecs.initialSupply.vTokenReceiver, vTokensRemaining], }, + + // Pause Borrow actions for vPT_clisBNB_25JUN2026 market { target: marketSpecs.vToken.comptroller, signature: "_setActionsPaused(address[],uint8[],bool)", - params: [[marketSpecs.vToken.address], [2], true], // Pause Borrow actions + params: [[marketSpecs.vToken.address], [2], true], }, + // Configure converters ...configureConverters([marketSpecs.vToken.underlying.address]), // BNB Emode Group From b79dff5c15f15c246760968da476a79eb7bc745f Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 16 Jan 2026 17:13:20 +0530 Subject: [PATCH 12/14] fix: remove redundant commands --- vips/vip-790/bscmainnet.ts | 14 -------------- vips/vip-790/bsctestnet.ts | 9 --------- 2 files changed, 23 deletions(-) diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-790/bscmainnet.ts index 2613607ae..59bd9ba16 100644 --- a/vips/vip-790/bscmainnet.ts +++ b/vips/vip-790/bscmainnet.ts @@ -224,11 +224,6 @@ export const vip790 = () => { ...configureConverters([marketSpecs.vToken.underlying.address]), // BNB Emode Group - { - target: bscmainnet.UNITROLLER, - signature: "setPoolActive(uint96,bool)", - params: [EMODE_POOL.id, true], - }, { target: bscmainnet.UNITROLLER, signature: "addPoolMarkets(uint96[],address[])", @@ -253,15 +248,6 @@ export const vip790 = () => { EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, ], }, - { - target: bscmainnet.UNITROLLER, - signature: "setIsBorrowAllowed(uint96,address,bool)", - params: [ - EMODE_POOL.id, - EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, - EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed, - ], - }, ], meta, ProposalType.REGULAR, diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-790/bsctestnet.ts index 2aa73153f..009a198b8 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-790/bsctestnet.ts @@ -258,15 +258,6 @@ export const vip790 = () => { EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.liquidationIncentive, ], }, - { - target: bsctestnet.UNITROLLER, - signature: "setIsBorrowAllowed(uint96,address,bool)", - params: [ - EMODE_POOL.id, - EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.address, - EMODE_POOL.marketsConfig.vPT_clisBNB_25JUN2026.borrowAllowed, - ], - }, ], meta, ProposalType.REGULAR, From 55e7c47d8acd8362e7967e21ef37e95d0242c979 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Fri, 16 Jan 2026 20:34:09 +0530 Subject: [PATCH 13/14] test: simulation oracle value --- simulations/vip-790/bscmainnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-790/bscmainnet.ts index 066523904..5644c4ae9 100644 --- a/simulations/vip-790/bscmainnet.ts +++ b/simulations/vip-790/bscmainnet.ts @@ -212,7 +212,7 @@ forking(75229002, async () => { it("check price PT_clisBNB_25JUN2026", async () => { const expectedPrice = parseUnits("912.542911682632512322", 18); const underlyingPrice = await resilientOracle.getUnderlyingPrice(marketSpecs.vToken.address); - expect(underlyingPrice).to.equal(expectedPrice); + expect(underlyingPrice).closeTo(expectedPrice, parseUnits("0.000000000000000001", 18)); }); // Verify the market admin is set to the Normal Timelock (governance) From 7188d93de02272eed240fb73820a2881bf5f5e76 Mon Sep 17 00:00:00 2001 From: fred-venus Date: Wed, 21 Jan 2026 17:40:40 +0800 Subject: [PATCH 14/14] feat: update the vip title and content --- .../{vip-790 => vip-584}/abi/Comptroller.json | 0 .../{vip-790 => vip-584}/abi/ERC20.json | 0 .../abi/ResilientOracle.json | 0 .../abi/SingleTokenConverter.json | 0 .../{vip-790 => vip-584}/abi/VToken.json | 0 .../{vip-790 => vip-584}/bscmainnet.ts | 13 +++-- .../{vip-790 => vip-584}/bsctestnet.ts | 13 +++-- vips/{vip-790 => vip-584}/bscmainnet.ts | 47 +++++++++++++++++-- vips/{vip-790 => vip-584}/bsctestnet.ts | 4 +- 9 files changed, 57 insertions(+), 20 deletions(-) rename simulations/{vip-790 => vip-584}/abi/Comptroller.json (100%) rename simulations/{vip-790 => vip-584}/abi/ERC20.json (100%) rename simulations/{vip-790 => vip-584}/abi/ResilientOracle.json (100%) rename simulations/{vip-790 => vip-584}/abi/SingleTokenConverter.json (100%) rename simulations/{vip-790 => vip-584}/abi/VToken.json (100%) rename simulations/{vip-790 => vip-584}/bscmainnet.ts (98%) rename simulations/{vip-790 => vip-584}/bsctestnet.ts (98%) rename vips/{vip-790 => vip-584}/bscmainnet.ts (84%) rename vips/{vip-790 => vip-584}/bsctestnet.ts (99%) diff --git a/simulations/vip-790/abi/Comptroller.json b/simulations/vip-584/abi/Comptroller.json similarity index 100% rename from simulations/vip-790/abi/Comptroller.json rename to simulations/vip-584/abi/Comptroller.json diff --git a/simulations/vip-790/abi/ERC20.json b/simulations/vip-584/abi/ERC20.json similarity index 100% rename from simulations/vip-790/abi/ERC20.json rename to simulations/vip-584/abi/ERC20.json diff --git a/simulations/vip-790/abi/ResilientOracle.json b/simulations/vip-584/abi/ResilientOracle.json similarity index 100% rename from simulations/vip-790/abi/ResilientOracle.json rename to simulations/vip-584/abi/ResilientOracle.json diff --git a/simulations/vip-790/abi/SingleTokenConverter.json b/simulations/vip-584/abi/SingleTokenConverter.json similarity index 100% rename from simulations/vip-790/abi/SingleTokenConverter.json rename to simulations/vip-584/abi/SingleTokenConverter.json diff --git a/simulations/vip-790/abi/VToken.json b/simulations/vip-584/abi/VToken.json similarity index 100% rename from simulations/vip-790/abi/VToken.json rename to simulations/vip-584/abi/VToken.json diff --git a/simulations/vip-790/bscmainnet.ts b/simulations/vip-584/bscmainnet.ts similarity index 98% rename from simulations/vip-790/bscmainnet.ts rename to simulations/vip-584/bscmainnet.ts index 5644c4ae9..6750102a3 100644 --- a/simulations/vip-790/bscmainnet.ts +++ b/simulations/vip-584/bscmainnet.ts @@ -1,5 +1,5 @@ /** - * @title VIP-790 Simulation Test for BSC Mainnet + * @title VIP-584 Simulation Test for BSC Mainnet * @notice This simulation test validates the listing of PT_clisBNB_25JUN2026 (Pendle Principal Token) * market in the Venus Protocol on BSC Mainnet. * @@ -29,7 +29,7 @@ import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameter import { checkVToken } from "src/vip-framework/checks/checkVToken"; import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; -import { +import vip584, { CONVERSION_INCENTIVE, EMODE_POOL, PROTOCOL_SHARE_RESERVE, @@ -37,8 +37,7 @@ import { convertAmountToVTokens, converterBaseAssets, marketSpecs, - vip790, -} from "../../vips/vip-790/bscmainnet"; +} from "../../vips/vip-584/bscmainnet"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; import ERC20_ABI from "./abi/ERC20.json"; import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; @@ -58,7 +57,7 @@ const BNB_FEED = "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE"; const PT_clisBNB_25JUN2026_HOLDER = "0x3B7e10fFe65c5A59475055D489F71699F7dabfF4"; /** - * Fork BSC Mainnet at block 75229002 to simulate VIP-790 execution + * Fork BSC Mainnet at block 75229002 to simulate VIP-584 execution * This allows testing against the actual mainnet state at a specific block height */ forking(75229002, async () => { @@ -139,7 +138,7 @@ forking(75229002, async () => { }); /** - * @notice Execute VIP-790 and validate emitted events + * @notice Execute VIP-584 and validate emitted events * @dev The VIP execution should emit the following events: * - MarketListed: Market is added to the comptroller (1 event) * - NewSupplyCap: Supply cap is set for the market (1 event) @@ -153,7 +152,7 @@ forking(75229002, async () => { * - NewLiquidationIncentive: Liquidation incentive is set (2 events - base + E-mode) * - PoolMarketInitialized: Market is initialized in the E-mode pool (1 event) */ - testVip("VIP-790", await vip790(), { + testVip("VIP-584", await vip584(), { callbackAfterExecution: async txResponse => { await expectEvents( txResponse, diff --git a/simulations/vip-790/bsctestnet.ts b/simulations/vip-584/bsctestnet.ts similarity index 98% rename from simulations/vip-790/bsctestnet.ts rename to simulations/vip-584/bsctestnet.ts index 952e10821..a8661ae1b 100644 --- a/simulations/vip-790/bsctestnet.ts +++ b/simulations/vip-584/bsctestnet.ts @@ -1,5 +1,5 @@ /** - * @title VIP-790 Simulation Test for BSC Testnet + * @title VIP-584 Simulation Test for BSC Testnet * @notice This simulation test validates the listing of PT_clisBNB_25JUN2026 (Pendle Principal Token) * market in the Venus Protocol on BSC Testnet. * @@ -30,7 +30,7 @@ import { checkRiskParameters } from "src/vip-framework/checks/checkRiskParameter import { checkVToken } from "src/vip-framework/checks/checkVToken"; import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; -import { +import vip584, { CONVERSION_INCENTIVE, EMODE_POOL, PROTOCOL_SHARE_RESERVE, @@ -38,8 +38,7 @@ import { convertAmountToVTokens, converterBaseAssets, marketSpecs, - vip790, -} from "../../vips/vip-790/bsctestnet"; +} from "../../vips/vip-584/bsctestnet"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; import RESILIENT_ORACLE_ABI from "./abi/ResilientOracle.json"; import SINGLE_TOKEN_CONVERTER_ABI from "./abi/SingleTokenConverter.json"; @@ -52,7 +51,7 @@ const { bsctestnet } = NETWORK_ADDRESSES; const NATIVE_TOKEN_ADDR = "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"; /** - * Fork BSC Testnet at block 84342013 to simulate VIP-790 execution + * Fork BSC Testnet at block 84342013 to simulate VIP-584 execution * This allows testing against the actual testnet state at a specific block height */ forking(84342013, async () => { @@ -115,7 +114,7 @@ forking(84342013, async () => { }); /** - * @notice Execute VIP-790 and validate emitted events + * @notice Execute VIP-584 and validate emitted events * @dev The VIP execution should emit the following events: * - MarketListed: Market is added to the comptroller (1 event) * - NewSupplyCap: Supply cap is set for the market (1 event) @@ -129,7 +128,7 @@ forking(84342013, async () => { * - NewLiquidationIncentive: Liquidation incentive is set (2 events - base + E-mode) * - PoolMarketInitialized: Market is initialized in the E-mode pool (1 event) */ - testVip("VIP-790", await vip790(), { + testVip("VIP-584", await vip584(), { callbackAfterExecution: async txResponse => { await expectEvents( txResponse, diff --git a/vips/vip-790/bscmainnet.ts b/vips/vip-584/bscmainnet.ts similarity index 84% rename from vips/vip-790/bscmainnet.ts rename to vips/vip-584/bscmainnet.ts index 59bd9ba16..a96a70383 100644 --- a/vips/vip-790/bscmainnet.ts +++ b/vips/vip-584/bscmainnet.ts @@ -120,11 +120,50 @@ const configureConverters = (fromAssets: string[], incentive: BigNumberish = CON }); }; -export const vip790 = () => { +export const vip584 = () => { const meta = { version: "v2", - title: "VIP-790 [BNB Chain] Add PT-slisBNBx-24JUN2026 market to the BNB emode group", - description: "VIP-790 [BNB Chain] BNB emode group", + title: "VIP-584 [BNB Chain] New PT-clisBNBx-25JUN2026 Listing markets in the BNB e-mode", + description: `If passed, this VIP will add one new market to the **BNB e-mode** on BNB Chain, for the following underlying asset: + +- [**PT-clisBNBx-25JUN2026**](https://bscscan.com/token/0xe052823b4aefc6e230faf46231a57d0905e30ae0) + +Community posts associated with these markets: + +- [**Add Support for PT-slisBNB in Venus BNB E-Mode Group**](https://community.venus.io/t/add-support-for-pt-slisbnb-in-venus-bnb-e-mode-group/5556) + +### **Description** + +**Name** + +- slisBNBx/clisBNBx: [**Rebranding clisBNB to slisBNBx**](https://www.binance.com/en/square/post/26438548906666) + +**Risk parameters of the new markets** + +- Borrow cap: 0 +- Supply cap: 25,000 +- Collateral factor: 87% +- Liquidation Threshold: 90% +- Liquidation Incentive: 4% +- Bootstrap liquidity: 0.035 **PT-clisBNBx-25JUN2026** + +**Price configuration** + +- Pricing: Pendle's 30-minute TWAP of the **PT-slisBNBx / slisBNB** market and combining it with the existing **slisBNB price oracle**. + +### **PT-clisBNBx-25JUN2026 market Contracts on mainnet** + +- [**PT-clisBNBx-25JUN2026**](https://bscscan.com/address/0x6d3BD68E90B42615cb5abF4B8DE92b154ADc435e) + +### **References** + +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/657) + +### **Voting options** + +- For - I agree that Venus Protocol should proceed with this proposal +- Against - I do not think that Venus Protocol should proceed with this proposal +- Abstain - I am indifferent to whether Venus Protocol proceeds or not`, forDescription: "I agree that Venus Protocol should proceed with this proposal", againstDescription: "I do not think that Venus Protocol should proceed with this proposal", abstainDescription: "I am indifferent to whether Venus Protocol proceeds or not", @@ -254,4 +293,4 @@ export const vip790 = () => { ); }; -export default vip790; +export default vip584; diff --git a/vips/vip-790/bsctestnet.ts b/vips/vip-584/bsctestnet.ts similarity index 99% rename from vips/vip-790/bsctestnet.ts rename to vips/vip-584/bsctestnet.ts index 009a198b8..530287089 100644 --- a/vips/vip-790/bsctestnet.ts +++ b/vips/vip-584/bsctestnet.ts @@ -121,7 +121,7 @@ const configureConverters = (fromAssets: string[], incentive: BigNumberish = CON }); }; -export const vip790 = () => { +export const vip584 = () => { const meta = { version: "v2", title: "VIP-790 [BNB Chain] Add PT-clisBNB-25JUN2026 market to the BNB emode group", @@ -264,4 +264,4 @@ export const vip790 = () => { ); }; -export default vip790; +export default vip584;