From eae92bfd15420e2885050653db425f17e1100047 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 15 Dec 2025 12:57:44 +0530 Subject: [PATCH 1/7] add: risk-steward testnet configuration vip and simulations --- .../vip-600/abi/AccessControlManager.json | 157 + simulations/vip-600/abi/Comproller.json | 4477 +++++++++++++++++ .../abi/DestinationStewardReceiver.json | 1327 +++++ simulations/vip-600/abi/ILVToken.json | 902 ++++ .../vip-600/abi/IsolatedPoolComptroller.json | 954 ++++ simulations/vip-600/abi/OwnerMinimalAbi.json | 15 + .../vip-600/abi/RiskStewardReceiver.json | 1615 ++++++ simulations/vip-600/abi/VToken.json | 1691 +++++++ simulations/vip-600/bsctestnet.ts | 349 ++ simulations/vip-600/sepolia.ts | 220 + vips/vip-600/bsctestnet.ts | 301 ++ 11 files changed, 12008 insertions(+) create mode 100644 simulations/vip-600/abi/AccessControlManager.json create mode 100644 simulations/vip-600/abi/Comproller.json create mode 100644 simulations/vip-600/abi/DestinationStewardReceiver.json create mode 100644 simulations/vip-600/abi/ILVToken.json create mode 100644 simulations/vip-600/abi/IsolatedPoolComptroller.json create mode 100644 simulations/vip-600/abi/OwnerMinimalAbi.json create mode 100644 simulations/vip-600/abi/RiskStewardReceiver.json create mode 100644 simulations/vip-600/abi/VToken.json create mode 100644 simulations/vip-600/bsctestnet.ts create mode 100644 simulations/vip-600/sepolia.ts create mode 100644 vips/vip-600/bsctestnet.ts diff --git a/simulations/vip-600/abi/AccessControlManager.json b/simulations/vip-600/abi/AccessControlManager.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/simulations/vip-600/abi/AccessControlManager.json @@ -0,0 +1,157 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "contractAddress", "type": "address" }, + { "indexed": false, "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "PermissionRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToPermit", "type": "address" } + ], + "name": "giveCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "hasPermission", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" } + ], + "name": "isAllowedToCall", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "accountToRevoke", "type": "address" } + ], + "name": "revokeCallPermission", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/Comproller.json b/simulations/vip-600/abi/Comproller.json new file mode 100644 index 000000000..7fc9365bb --- /dev/null +++ b/simulations/vip-600/abi/Comproller.json @@ -0,0 +1,4477 @@ +[ + { + "inputs": [], + "name": "AlreadyInSelectedPool", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowNotAllowedInPool", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPoolLabel", + "type": "error" + }, + { + "inputs": [], + "name": "ExecuteFlashLoanFailed", + "type": "error" + }, + { + "inputs": [], + "name": "FailedToCreateDebtPosition", + "type": "error" + }, + { + "inputs": [], + "name": "FlashLoanNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "FlashLoanPausedSystemWide", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "InactivePool", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleBorrowedAssets", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFlashLoanParams", + "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": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [], + "name": "MarketNotListedInCorePool", + "type": "error" + }, + { + "inputs": [], + "name": "NoAssetsRequested", + "type": "error" + }, + { + "inputs": [], + "name": "NotAnApprovedDelegate", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "repaid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "required", + "type": "uint256" + } + ], + "name": "NotEnoughRepayment", + "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" + }, + { + "inputs": [], + "name": "ReentrancyGuardReentrantCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SenderNotAuthorizedForFlashLoan", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requested", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maximum", + "type": "uint256" + } + ], + "name": "TooManyAssetsRequested", + "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": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract VToken[]", + "name": "assets", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "FlashLoanExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "oldPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newPaused", + "type": "bool" + } + ], + "name": "FlashLoanPauseChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalf", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repaidAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "remainingDebt", + "type": "uint256" + } + ], + "name": "FlashLoanRepaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "isWhitelisted", + "type": "bool" + } + ], + "name": "IsAccountFlashLoanWhitelisted", + "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": [], + "name": "MAX_FLASHLOAN_ASSETS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "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": "", + "type": "address" + } + ], + "name": "authorizedFlashLoan", + "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": "onBehalf", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "enterMarketBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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 payable", + "name": "onBehalf", + "type": "address" + }, + { + "internalType": "address payable", + "name": "receiver", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "underlyingAmounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "param", + "type": "bytes" + } + ], + "name": "executeFlashLoan", + "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": [], + "name": "flashLoanPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "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": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setFlashLoanPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "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": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "isWhiteListed", + "type": "bool" + } + ], + "name": "setWhiteListFlashLoanAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [ + { + "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-600/abi/DestinationStewardReceiver.json b/simulations/vip-600/abi/DestinationStewardReceiver.json new file mode 100644 index 000000000..f67c5f250 --- /dev/null +++ b/simulations/vip-600/abi/DestinationStewardReceiver.json @@ -0,0 +1,1327 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "endpoint_", + "type": "address" + }, + { + "internalType": "uint32", + "name": "layerZeroEid_", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConfigNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDebounce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDelegate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidEndpointCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateType", + "type": "error" + }, + { + "inputs": [], + "name": "LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "NoPeer", + "type": "error" + }, + { + "inputs": [], + "name": "NotAnExecutor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "NotEnoughNative", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "OnlyEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "OnlyPeer", + "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": "UnsupportedUpdateType", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateIsExpired", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateNotUnlocked", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateTooFrequent", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "updateTypeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousActive", + "type": "bool" + }, + { + "indexed": true, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ConfigActiveUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arrivalTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "DuplicateUpdateReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousApproved", + "type": "bool" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ExecutorStatusUpdated", + "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": "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": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "name": "PeerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arrivalTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "RegisteredPendingUpdateExist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "remoteDelay", + "type": "uint256" + } + ], + "name": "RemoteDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "RemoteUpdateExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arrivalTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "RemoteUpdateRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "updateTypeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "previousRiskSteward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "riskSteward", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousDebounce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousActive", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "RiskParameterConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "UpdateRejected", + "type": "event" + }, + { + "inputs": [], + "name": "LAYER_ZERO_EID", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REMOTE_DELAY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REMOTE_UPDATE_EXPIRATION_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + } + ], + "name": "allowInitializePath", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endpoint", + "outputs": [ + { + "internalType": "contract ILayerZeroEndpointV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "executeUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getExecutableUpdates", + "outputs": [ + { + "internalType": "uint256[]", + "name": "executableUpdates", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getLastExecutedAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getRegisteredUpdate", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + }, + { + "internalType": "enum DestinationStewardReceiver.UpdateStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "arrivalTime", + "type": "uint256" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + } + ], + "internalType": "struct DestinationStewardReceiver.DestinationUpdate", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "name": "getRiskParameterConfig", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + } + ], + "internalType": "struct DestinationStewardReceiver.RiskParamConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "isComposeMsgSender", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "lastExecutedAt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "lastRegisteredUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nextNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oAppVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "senderVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "receiverVersion", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + } + ], + "name": "peers", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "rejectUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "riskParameterConfigs", + "outputs": [ + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setConfigActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "setPeer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + } + ], + "name": "setRiskParameterConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setWhitelistedExecutor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "updates", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + }, + { + "internalType": "enum DestinationStewardReceiver.UpdateStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "arrivalTime", + "type": "uint256" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedExecutors", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/ILVToken.json b/simulations/vip-600/abi/ILVToken.json new file mode 100644 index 000000000..c4b1366e5 --- /dev/null +++ b/simulations/vip-600/abi/ILVToken.json @@ -0,0 +1,902 @@ +[ + { + "inputs": [ + { "internalType": "bool", "name": "timeBased_", "type": "bool" }, + { "internalType": "uint256", "name": "blocksPerYear_", "type": "uint256" }, + { "internalType": "uint256", "name": "maxBorrowRateMantissa_", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [{ "internalType": "uint256", "name": "actualAddAmount", "type": "uint256" }], + "name": "AddReservesFactorFreshCheck", + "type": "error" + }, + { "inputs": [], "name": "BorrowCashNotAvailable", "type": "error" }, + { "inputs": [], "name": "BorrowFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "DelegateNotApproved", "type": "error" }, + { "inputs": [], "name": "ForceLiquidateBorrowUnauthorized", "type": "error" }, + { "inputs": [], "name": "HealBorrowUnauthorized", "type": "error" }, + { "inputs": [], "name": "InvalidBlocksPerYear", "type": "error" }, + { "inputs": [], "name": "InvalidTimeBasedConfiguration", "type": "error" }, + { + "inputs": [{ "internalType": "uint256", "name": "errorCode", "type": "uint256" }], + "name": "LiquidateAccrueCollateralInterestFailed", + "type": "error" + }, + { "inputs": [], "name": "LiquidateCloseAmountIsUintMax", "type": "error" }, + { "inputs": [], "name": "LiquidateCloseAmountIsZero", "type": "error" }, + { "inputs": [], "name": "LiquidateCollateralFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "LiquidateFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "LiquidateLiquidatorIsBorrower", "type": "error" }, + { "inputs": [], "name": "LiquidateSeizeLiquidatorIsBorrower", "type": "error" }, + { "inputs": [], "name": "MintFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "ProtocolSeizeShareTooBig", "type": "error" }, + { "inputs": [], "name": "RedeemFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "RedeemTransferOutNotPossible", "type": "error" }, + { "inputs": [], "name": "ReduceReservesCashNotAvailable", "type": "error" }, + { "inputs": [], "name": "ReduceReservesCashValidation", "type": "error" }, + { "inputs": [], "name": "ReduceReservesFreshCheck", "type": "error" }, + { "inputs": [], "name": "RepayBorrowFreshnessCheck", "type": "error" }, + { "inputs": [], "name": "SetInterestRateModelFreshCheck", "type": "error" }, + { "inputs": [], "name": "SetReserveFactorBoundsCheck", "type": "error" }, + { "inputs": [], "name": "SetReserveFactorFreshCheck", "type": "error" }, + { "inputs": [], "name": "TransferNotAllowed", "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" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "cashPrior", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "interestAccumulated", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "borrowIndex", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "AccrueInterest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "badDebtDelta", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "badDebtOld", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "badDebtNew", "type": "uint256" } + ], + "name": "BadDebtIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "badDebtOld", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "badDebtNew", "type": "uint256" } + ], + "name": "BadDebtRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "name": "HealBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "liquidator", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": true, "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "LiquidateBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "minter", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "mintTokens", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBalance", "type": "uint256" } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract ComptrollerInterface", "name": "oldComptroller", "type": "address" }, + { "indexed": true, "internalType": "contract ComptrollerInterface", "name": "newComptroller", "type": "address" } + ], + "name": "NewComptroller", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "NewMarketInterestRateModel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldProtocolSeizeShareMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newProtocolSeizeShareMantissa", "type": "uint256" } + ], + "name": "NewProtocolSeizeShare", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": 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": "oldReduceReservesBlockOrTimestampDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReduceReservesBlockOrTimestampDelta", + "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": true, "internalType": "address", "name": "oldShortfall", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newShortfall", "type": "address" } + ], + "name": "NewShortfallContract", + "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": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "ProtocolSeize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "redeemer", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBalance", "type": "uint256" } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "payer", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "RepayBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "benefactor", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "addAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } + ], + "name": "ReservesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "protocolShareReserve", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reduceAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } + ], + "name": "SpreadReservesReduced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "token", "type": "address" }], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "NO_ERROR", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrueInterest", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "addAmount", "type": "uint256" }], + "name": "addReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "badDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "recoveredAmount_", "type": "uint256" }], + "name": "badDebtRecovered", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "balanceOfUnderlying", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "blocksOrSecondsPerYear", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }], + "name": "borrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "borrowBalanceCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "borrowBalanceStored", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptroller", + "outputs": [{ "internalType": "contract ComptrollerInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateStored", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "contract VTokenInterface", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "forceLiquidateBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountSnapshot", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "vTokenBalance", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowBalance", "type": "uint256" }, + { "internalType": "uint256", "name": "exchangeRate", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumberOrTimestamp", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCash", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "name": "healBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "underlying_", "type": "address" }, + { "internalType": "contract ComptrollerInterface", "name": "comptroller_", "type": "address" }, + { "internalType": "contract InterestRateModel", "name": "interestRateModel_", "type": "address" }, + { "internalType": "uint256", "name": "initialExchangeRateMantissa_", "type": "uint256" }, + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" }, + { "internalType": "uint8", "name": "decimals_", "type": "uint8" }, + { "internalType": "address", "name": "admin_", "type": "address" }, + { "internalType": "address", "name": "accessControlManager_", "type": "address" }, + { + "components": [ + { "internalType": "address", "name": "shortfall", "type": "address" }, + { "internalType": "address payable", "name": "protocolShareReserve", "type": "address" } + ], + "internalType": "struct VTokenInterface.RiskManagementInit", + "name": "riskManagement", + "type": "tuple" + }, + { "internalType": "uint256", "name": "reserveFactorMantissa_", "type": "uint256" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "interestRateModel", + "outputs": [{ "internalType": "contract InterestRateModel", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isTimeBased", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isVToken", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "contract VTokenInterface", "name": "vTokenCollateral", "type": "address" } + ], + "name": "liquidateBorrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "mintAmount", "type": "uint256" }], + "name": "mint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "mintBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolSeizeShareMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolShareReserve", + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }], + "name": "redeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }], + "name": "redeemUnderlying", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" } + ], + "name": "redeemUnderlyingBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "reduceAmount", "type": "uint256" }], + "name": "reduceReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockDelta", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockNumber", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "uint256", "name": "repayAmount", "type": "uint256" }], + "name": "repayBorrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "name": "repayBorrowBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract InterestRateModel", "name": "newInterestRateModel", "type": "address" }], + "name": "setInterestRateModel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newProtocolSeizeShareMantissa_", "type": "uint256" }], + "name": "setProtocolSeizeShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address payable", "name": "protocolShareReserve_", "type": "address" }], + "name": "setProtocolShareReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_newReduceReservesBlockOrTimestampDelta", "type": "uint256" }], + "name": "setReduceReservesBlockDelta", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newReserveFactorMantissa", "type": "uint256" }], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "shortfall_", "type": "address" }], + "name": "setShortfallContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shortfall", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IERC20Upgradeable", "name": "token", "type": "address" }], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrows", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalReserves", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/IsolatedPoolComptroller.json b/simulations/vip-600/abi/IsolatedPoolComptroller.json new file mode 100644 index 000000000..ad25568bc --- /dev/null +++ b/simulations/vip-600/abi/IsolatedPoolComptroller.json @@ -0,0 +1,954 @@ +[ + { + "inputs": [{ "internalType": "address", "name": "poolRegistry_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "ActionPaused", + "type": "error" + }, + { "inputs": [], "name": "BorrowActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "BorrowCapIsNotZero", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedLessThanOrEqualTo", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { "inputs": [], "name": "CollateralFactorIsNotZero", "type": "error" }, + { "inputs": [], "name": "ComptrollerMismatch", "type": "error" }, + { "inputs": [], "name": "DelegationStatusUnchanged", "type": "error" }, + { "inputs": [], "name": "EnterMarketActionNotPaused", "type": "error" }, + { "inputs": [], "name": "ExitMarketActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "uint256", "name": "collateralToSeize", "type": "uint256" }, + { "internalType": "uint256", "name": "availableCollateral", "type": "uint256" } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { "inputs": [], "name": "InsufficientLiquidity", "type": "error" }, + { "inputs": [], "name": "InsufficientShortfall", "type": "error" }, + { "inputs": [], "name": "InvalidCollateralFactor", "type": "error" }, + { "inputs": [], "name": "InvalidLiquidationThreshold", "type": "error" }, + { "inputs": [], "name": "LiquidateActionNotPaused", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "MarketNotCollateral", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopsLimit", "type": "uint256" }, + { "internalType": "uint256", "name": "requiredLoops", "type": "uint256" } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expectedGreaterThan", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { "inputs": [], "name": "MintActionNotPaused", "type": "error" }, + { "inputs": [], "name": "NonzeroBorrowBalance", "type": "error" }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "PriceError", + "type": "error" + }, + { "inputs": [], "name": "RedeemActionNotPaused", "type": "error" }, + { "inputs": [], "name": "RepayActionNotPaused", "type": "error" }, + { "inputs": [], "name": "SeizeActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "uint256", "name": "cap", "type": "uint256" } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { "inputs": [], "name": "SupplyCapIsNotZero", "type": "error" }, + { "inputs": [], "name": "TooMuchRepay", "type": "error" }, + { "inputs": [], "name": "TransferActionNotPaused", "type": "error" }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "expectedSender", "type": "address" }, + { "internalType": "address", "name": "actualSender", "type": "address" } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "enum Action", "name": "action", "type": "uint8" }, + { "indexed": false, "internalType": "bool", "name": "pauseState", "type": "bool" } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "approver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "delegate", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "vToken", "type": "address" }], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLoopsLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newmaxLoopsLimit", "type": "uint256" } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldCloseFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldCollateralFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationIncentiveMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "oldLiquidationThresholdMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableCollateral", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IPrime", "name": "oldPrimeToken", "type": "address" }, + { "indexed": false, "internalType": "contract IPrime", "name": "newPrimeToken", "type": "address" } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "rewardsDistributor", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "rewardToken", "type": "address" } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "accountAssets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "enum Action", "name": "action", "type": "uint8" } + ], + "name": "actionPaused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract RewardsDistributor", "name": "_rewardsDistributor", "type": "address" }], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "allMarkets", + "outputs": [{ "internalType": "contract VToken", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "approvedDelegates", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "borrowCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "contract VToken", "name": "vToken", "type": "address" } + ], + "name": "checkMembership", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address[]", "name": "vTokens", "type": "address[]" }], + "name": "enterMarkets", + "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vTokenAddress", "type": "address" }], + "name": "exitMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAssetsIn", + "outputs": [{ "internalType": "contract VToken[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getBorrowingPower", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" }, + { "internalType": "address", "name": "vTokenModify", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, + { "internalType": "uint256", "name": "shortfall", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [{ "internalType": "contract RewardsDistributor[]", "name": "", "type": "address[]" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "supplySpeed", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowSpeed", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "loopLimit", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "isForcedLiquidationEnabled", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "isMarketListed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { + "components": [ + { "internalType": "contract VToken", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "contract VToken", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { "internalType": "uint256", "name": "error", "type": "uint256" }, + { "internalType": "uint256", "name": "tokensToSeize", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "markets", + "outputs": [ + { "internalType": "bool", "name": "isListed", "type": "bool" }, + { "internalType": "uint256", "name": "collateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "liquidationThresholdMantissa", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "actualMintAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [{ "internalType": "contract ResilientOracleInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "borrowAmount", "type": "uint256" } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "bool", "name": "skipLiquidityCheck", "type": "bool" } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "minter", "type": "address" }, + { "internalType": "uint256", "name": "mintAmount", "type": "uint256" } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "seizerContract", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [{ "internalType": "contract IPrime", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "redeemer", "type": "address" }, + { "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "payer", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "actualRepayAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "borrowerIndex", "type": "uint256" } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "marketsList", "type": "address[]" }, + { "internalType": "enum Action[]", "name": "actionsList", "type": "uint8[]" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newCloseFactorMantissa", "type": "uint256" }], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken", "name": "vToken", "type": "address" }, + { "internalType": "uint256", "name": "newCollateralFactorMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "newLiquidationThresholdMantissa", "type": "uint256" } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLiquidationIncentiveMantissa", "type": "uint256" }], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newBorrowCaps", "type": "uint256[]" } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract VToken[]", "name": "vTokens", "type": "address[]" }, + { "internalType": "uint256[]", "name": "newSupplyCaps", "type": "uint256[]" } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit", "type": "uint256" }], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newMinLiquidatableCollateral", "type": "uint256" }], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ResilientOracleInterface", "name": "newOracle", "type": "address" }], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract IPrime", "name": "_prime", "type": "address" }], + "name": "setPrimeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "supplyCaps", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract VToken", "name": "vToken", "type": "address" }], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "transferTokens", "type": "uint256" } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "market", "type": "address" }], + "name": "unlistMarket", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegate", "type": "address" }, + { "internalType": "bool", "name": "approved", "type": "bool" } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "updatePrices", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/OwnerMinimalAbi.json b/simulations/vip-600/abi/OwnerMinimalAbi.json new file mode 100644 index 000000000..c8cd38844 --- /dev/null +++ b/simulations/vip-600/abi/OwnerMinimalAbi.json @@ -0,0 +1,15 @@ +[ + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/RiskStewardReceiver.json b/simulations/vip-600/abi/RiskStewardReceiver.json new file mode 100644 index 000000000..9434424db --- /dev/null +++ b/simulations/vip-600/abi/RiskStewardReceiver.json @@ -0,0 +1,1615 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "riskOracle_", + "type": "address" + }, + { + "internalType": "address", + "name": "endpoint_", + "type": "address" + }, + { + "internalType": "uint32", + "name": "layerZeroLzEid_", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConfigNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDebounce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDelegate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidEndpointCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLzSendCaller", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "optionType", + "type": "uint16" + } + ], + "name": "InvalidOptionType", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRegisteredUpdate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTimelock", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateToResend", + "type": "error" + }, + { + "inputs": [], + "name": "LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "NoPeer", + "type": "error" + }, + { + "inputs": [], + "name": "NotAnExecutor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "NotEnoughNative", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "OnlyEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "OnlyPeer", + "type": "error" + }, + { + "inputs": [], + "name": "PauseStatusUnchanged", + "type": "error" + }, + { + "inputs": [], + "name": "PausedError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "RegisteredUpdateTypeExist", + "type": "error" + }, + { + "inputs": [], + "name": "RenounceOwnershipNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFailed", + "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": "UnsupportedUpdateType", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateAlreadyResolved", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateIsExpired", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateNotUnlocked", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateTooFrequent", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "updateTypeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousActive", + "type": "bool" + }, + { + "indexed": true, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ConfigActiveUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousApproved", + "type": "bool" + }, + { + "indexed": true, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ExecutorStatusUpdated", + "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": "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": "bool", + "name": "previousPaused", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PauseStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "name": "PeerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "updateTypeHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "previousRiskSteward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "riskSteward", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousDebounce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousTimelock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timelock", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousActive", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "RiskParameterConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepNative", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "UpdateExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "UpdateExpired", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UpdateRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "UpdateRejected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UpdateResentToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "UpdateSentToDestination", + "type": "event" + }, + { + "inputs": [], + "name": "LAYER_ZERO_EID", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RISK_ORACLE", + "outputs": [ + { + "internalType": "contract IRiskOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPDATE_EXPIRATION_TIME", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + } + ], + "name": "allowInitializePath", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "endpoint", + "outputs": [ + { + "internalType": "contract ILayerZeroEndpointV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "executeRegisteredUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getExecutableUpdates", + "outputs": [ + { + "internalType": "uint256[]", + "name": "executableUpdates", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getLastProcessedUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getLastRegisteredUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "name": "getRiskParameterConfig", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timelock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + } + ], + "internalType": "struct IRiskStewardReceiver.RiskParamConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "acm_", + "type": "address" + }, + { + "internalType": "address", + "name": "delegate_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "isComposeMsgSender", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "isUpdateExecutable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "lastProcessedUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "lastRegisteredUpdate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "address", + "name": "refundAddress", + "type": "address" + } + ], + "name": "lzSend", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nextNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oAppVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "senderVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "receiverVersion", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + } + ], + "name": "peers", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "processUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "name": "quote", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "rejectUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "name": "resendRemoteUpdate", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "riskParameterConfigs", + "outputs": [ + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timelock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setConfigActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "setPeer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "riskSteward", + "type": "address" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timelock", + "type": "uint256" + } + ], + "name": "setRiskParameterConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setWhitelistedExecutor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sweepNative", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "updates", + "outputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unlockTime", + "type": "uint256" + }, + { + "internalType": "enum IRiskStewardReceiver.UpdateStatus", + "name": "status", + "type": "uint8" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "executedAt", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "whitelistedExecutors", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/simulations/vip-600/abi/VToken.json b/simulations/vip-600/abi/VToken.json new file mode 100644 index 000000000..9a13ff711 --- /dev/null +++ b/simulations/vip-600/abi/VToken.json @@ -0,0 +1,1691 @@ +[ + { + "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" + } + ], + "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": "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" + }, + { + "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 InterestRateModelV8", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract InterestRateModelV8", + "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" + }, + { + "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" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reduceAmount_", + "type": "uint256" + } + ], + "name": "_reduceReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "newComptroller", + "type": "address" + } + ], + "name": "_setComptroller", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract InterestRateModelV8", + "name": "newInterestRateModel_", + "type": "address" + } + ], + "name": "_setInterestRateModel", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "newPendingAdmin", + "type": "address" + } + ], + "name": "_setPendingAdmin", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newReserveFactorMantissa_", + "type": "uint256" + } + ], + "name": "_setReserveFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrueInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOfUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "calculateFlashLoanFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptroller", + "outputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flashLoanAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "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" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "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": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "interestRateModel", + "outputs": [ + { + "internalType": "contract InterestRateModelV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isFlashLoanEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isVToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolShareReserve", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockDelta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlManagerAddress", + "type": "address" + } + ], + "name": "setAccessControlManager", + "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" + }, + { + "inputs": [ + { + "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": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newReduceReservesBlockDelta_", + "type": "uint256" + } + ], + "name": "setReduceReservesBlockDelta", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrows", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address 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" + } + ], + "name": "transferOutUnderlyingFlashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/bsctestnet.ts b/simulations/vip-600/bsctestnet.ts new file mode 100644 index 000000000..d39f59c05 --- /dev/null +++ b/simulations/vip-600/bsctestnet.ts @@ -0,0 +1,349 @@ +import { expect } from "chai"; +import { Signer } 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 vip600, { + COLLATERALFACTORS_STEWARD, + CORE_COMPTROLLER, + DEFI_COMPTROLLER, + DESTINATION_RECEIVER_STEWARD, + IRM_STEWARD, + MARKETCAP_STEWARD, + RISK_ORACLE, + RISK_STEWARD_RECEIVER, + SEPOLIA_EID, + vBTC, + vUSDT_DEFI, +} from "../../vips/vip-600/bsctestnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import COMPTROLLER_ABI from "./abi/Comproller.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; +import RSR_ABI from "./abi/RiskStewardReceiver.json"; +import VToken_ABI from "./abi/VToken.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +forking(78592328, async () => { + const provider = ethers.provider; + const acm = new ethers.Contract(bsctestnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); + const comptroller = new ethers.Contract(CORE_COMPTROLLER, COMPTROLLER_ABI, provider); + const isolatedPoolComptroller = new ethers.Contract(DEFI_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + const vBtc = new ethers.Contract(vBTC, VToken_ABI, provider); + const vUsdtDefi = new ethers.Contract(vUSDT_DEFI, ISOLATED_VToken_ABI, provider); + + // Risk Steward contracts + const riskStewardReceiver = new ethers.Contract(RISK_STEWARD_RECEIVER, RSR_ABI, provider); + const marketCapSteward = new ethers.Contract(MARKETCAP_STEWARD, Owner_ABI, provider); + const collateralFactorSteward = new ethers.Contract(COLLATERALFACTORS_STEWARD, Owner_ABI, provider); + const irmSteward = new ethers.Contract(IRM_STEWARD, Owner_ABI, provider); + + testVip("vip600 Configuring Risk Stewards", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [37], // Expected number of PermissionGranted events (BSC only) + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("RISK_ORACLE permissions", () => { + it("should grant addAuthorizedSender permission to NORMAL_TIMELOCK", async () => { + const addAuthorizedSenderRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "addAuthorizedSender(address)"], + ); + const addAuthorizedSenderRoleHashNormal = ethers.utils.keccak256(addAuthorizedSenderRoleNormal); + expect(await acm.hasRole(addAuthorizedSenderRoleHashNormal, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + }); + + it("should grant removeAuthorizedSender permission to all timelocks", async () => { + const removeAuthorizedSenderRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "removeAuthorizedSender(address)"], + ); + const removeAuthorizedSenderRoleHashNormal = ethers.utils.keccak256(removeAuthorizedSenderRoleNormal); + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bsctestnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bsctestnet.GUARDIAN)).to.be.true; + }); + + it("should grant addUpdateType permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + const addUpdateTypeRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "addUpdateType(string)"], + ); + const addUpdateTypeRoleHashNormal = ethers.utils.keccak256(addUpdateTypeRoleNormal); + expect(await acm.hasRole(addUpdateTypeRoleHashNormal, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(addUpdateTypeRoleHashNormal, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setUpdateTypeActive permission to all timelocks", async () => { + const setUpdateTypeActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "setUpdateTypeActive(string,bool)"], + ); + const setUpdateTypeActiveRoleHash = ethers.utils.keccak256(setUpdateTypeActiveRole); + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bsctestnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bsctestnet.GUARDIAN)).to.be.true; + }); + }); + + describe("RISK_STEWARD_RECEIVER permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bsctestnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bsctestnet.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bsctestnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bsctestnet.GUARDIAN)).to.be.true; + }); + + it("should grant setPaused permission to all timelocks", async () => { + const setPausedRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setPaused(bool)"], + ); + const setPausedRoleHash = ethers.utils.keccak256(setPausedRole); + expect(await acm.hasRole(setPausedRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bsctestnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bsctestnet.GUARDIAN)).to.be.true; + }); + }); + + describe("Steward permissions", () => { + it("should grant setSafeDeltaBps permission to MARKETCAP_STEWARD", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [MARKETCAP_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setSafeDeltaBps permission to COLLATERALFACTORS_STEWARD", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [COLLATERALFACTORS_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + }); + + describe("MARKETCAP_STEWARD permissions", () => { + it("should grant _setMarketBorrowCaps permission to MARKETCAP_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "_setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant _setMarketSupplyCaps permission to MARKETCAP_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant setMarketBorrowCaps permission to MARKETCAP_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to MARKETCAP_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant CORE_POOL setCollateralFactor permission to COLLATERALFACTORS_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "setCollateralFactor(uint96,address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, COLLATERALFACTORS_STEWARD)).to.be.true; + }); + + it("should grant ISOLATED_POOL setCollateralFactor permission to COLLATERALFACTORS_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, COLLATERALFACTORS_STEWARD)).to.be.true; + }); + + it("should grant _setInterestRateModel permission to IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "_setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, IRM_STEWARD)).to.be.true; + }); + + it("should grant setInterestRateModel permission to IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, IRM_STEWARD)).to.be.true; + }); + }); + + describe("Market operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + + before(async () => { + marketCapSteward = await initMainnetUser(MARKETCAP_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(COLLATERALFACTORS_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(IRM_STEWARD, parseUnits("2")); + }); + + it("should allow Market Cap Steward to set supply caps on core pool markets", async () => { + await expect( + comptroller.connect(marketCapSteward).setMarketSupplyCaps([vBTC], [parseUnits("150000", 18)]), + ).to.emit(comptroller, "NewSupplyCap"); + }); + + it("should allow Market Cap Steward to set borrow caps on core pool markets", async () => { + await expect( + comptroller.connect(marketCapSteward).setMarketBorrowCaps([vBTC], [parseUnits("55000", 18)]), + ).to.emit(comptroller, "NewBorrowCap"); + }); + + it("should allow Market Cap Steward to set supply caps on isolated pool markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([vUSDT_DEFI], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow Market Cap Steward to set borrow caps on isolated pool markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([vUSDT_DEFI], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow Collateral Factor Steward to set collateral factors on core pool markets", async () => { + await expect( + comptroller + .connect(collateralFactorSteward) + ["setCollateralFactor(uint96,address,uint256,uint256)"]( + 0, + vBTC, + parseUnits("0.7", 18), + parseUnits("0.75", 18), + ), + ).to.be.revertedWith("invalid resilient oracle price"); // this reverts due to stale period but it means passed the ACM check + }); + + it("should allow Collateral Factor Steward to set collateral factors on isolated pool markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(vUSDT_DEFI, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.be.revertedWith("invalid resilient oracle price"); // passed the ACM check + }); + + it("should allow IRM Steward to set interest rate models on core pool markets", async () => { + const TEST_IRM_ADDRESS = "0xf59B7f2733a549dCF82b804d69d9c6a38985B90B"; + await expect(vBtc.connect(irmSteward)._setInterestRateModel(TEST_IRM_ADDRESS)).to.emit( + vBtc, + "NewMarketInterestRateModel", + ); + }); + + it("should allow IRM Steward to set interest rate models on isolated pool markets", async () => { + const TEST_IRM_ADDRESS = "0xf59B7f2733a549dCF82b804d69d9c6a38985B90B"; + await expect(vUsdtDefi.connect(irmSteward).setInterestRateModel(TEST_IRM_ADDRESS)).to.emit( + vUsdtDefi, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("Risk Steward Ownership", () => { + it("should set RISK_STEWARD_RECEIVER owner to NORMAL_TIMELOCK", async () => { + expect(await riskStewardReceiver.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + + it("should set MARKETCAP_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await marketCapSteward.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + + it("should set COLLATERALFACTORS_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await collateralFactorSteward.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + + it("should set IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await irmSteward.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to DESTINATION_RECEIVER_STEWARD (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32); + expect(await riskStewardReceiver.peers(SEPOLIA_EID)).to.equal(expectedPeer.toLocaleLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/sepolia.ts b/simulations/vip-600/sepolia.ts new file mode 100644 index 000000000..7a5026f56 --- /dev/null +++ b/simulations/vip-600/sepolia.ts @@ -0,0 +1,220 @@ +import { expect } from "chai"; +import { Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + BSCTESTNET_EID, + DESTINATION_RECEIVER_STEWARD, + RISK_STEWARD_RECEIVER, + SEPOLIA_ACM, + SEPOLIA_CF_STEWARD, + SEPOLIA_COMPTROLLER, + SEPOLIA_IRM_STEWARD, + SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { sepolia } = NETWORK_ADDRESSES; + +forking(9844003, async () => { + const provider = ethers.provider; + const acm = new ethers.Contract(SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + const isolatedPoolComptroller = new ethers.Contract(SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + + // SEPOLIA Risk Steward contracts + const destinationReceiverSteward = new ethers.Contract(DESTINATION_RECEIVER_STEWARD, DSR_ABI, provider); + const sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, Owner_ABI, provider); + const sepoliaCfSteward = new ethers.Contract(SEPOLIA_CF_STEWARD, Owner_ABI, provider); + const sepoliaIrmSteward = new ethers.Contract(SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [18], // Expected number of PermissionGranted events for Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [DESTINATION_RECEIVER_STEWARD, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [DESTINATION_RECEIVER_STEWARD, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [DESTINATION_RECEIVER_STEWARD, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, sepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, sepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant setSafeDeltaBps permission to MARKETCAP_STEWARD", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setSafeDeltaBps permission to COLLATERALFACTORS_STEWARD", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0xfe050f628bF5278aCfA1e7B13b59fF207e769235"; + + before(async () => { + marketCapSteward = await initMainnetUser(SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0x8E09246751bcf2F621694881bd0E55d681f061c3"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(sepolia.NORMAL_TIMELOCK); + }); + + it("should set SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await sepoliaMcSteward.owner()).to.equal(sepolia.NORMAL_TIMELOCK); + }); + + it("should set SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await sepoliaCfSteward.owner()).to.equal(sepolia.NORMAL_TIMELOCK); + }); + + it("should set SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await sepoliaIrmSteward.owner()).to.equal(sepolia.NORMAL_TIMELOCK); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for DESTINATION_RECEIVER_STEWARD (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLocaleLowerCase()); + }); + }); + }); +}); diff --git a/vips/vip-600/bsctestnet.ts b/vips/vip-600/bsctestnet.ts new file mode 100644 index 000000000..577f0ca8e --- /dev/null +++ b/vips/vip-600/bsctestnet.ts @@ -0,0 +1,301 @@ +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { LzChainId, ProposalMeta, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { bsctestnet, sepolia } = NETWORK_ADDRESSES; +export const CORE_COMPTROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; +export const RISK_ORACLE = "0xaEDeFDE255BBf2D44BC62D8A078719a258C9a19b"; +export const RISK_STEWARD_RECEIVER = "0xe9Cb27160Df47433b10f6d877FDb6bb7FB9b6578"; +export const MARKETCAP_STEWARD = "0x476B76eC52b055DFbfa26D281b840FC55bEcA4BD"; +export const COLLATERALFACTORS_STEWARD = "0x7922872a4d56c8FE76a6F362c6633c2308C5ac44"; +export const IRM_STEWARD = "0xBb049f3C14a82393d7645b78884d75a7788a6a70"; +export const BSCTESTNET_EID = 40102; + +export const DEFI_COMPTROLLER = "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD"; +export const vUSDT_DEFI = "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750"; +export const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; + +// SEPOLIA +export const DESTINATION_RECEIVER_STEWARD = "0xD66A3a67842ad563892685216a70B659FC8c18d3"; +export const SEPOLIA_MC_STEWARD = "0xC10683dcb59A1812cc1D202BA561b23eB9E0599b"; +export const SEPOLIA_CF_STEWARD = "0x4Ff531929bDAf4208844dFAbecEDFD28B10611a5"; +export const SEPOLIA_IRM_STEWARD = "0xF68F3C38aE73aC35e550644867556DB5cc4a62EC"; +export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; +export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; +export const SEPOLIA_EID = 40161; + +export const vip600 = async () => { + const meta: ProposalMeta = { + version: "v2", + title: "VIP-600", + description: `VIP-600`, + 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( + [ + // RISK ORACLE + ...[bsctestnet.NORMAL_TIMELOCK].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "addAuthorizedSender(address)", timelock], + }; + }), + ...[ + bsctestnet.NORMAL_TIMELOCK, + bsctestnet.FAST_TRACK_TIMELOCK, + bsctestnet.CRITICAL_TIMELOCK, + bsctestnet.GUARDIAN, + ].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "removeAuthorizedSender(address)", timelock], + }; + }), + ...[bsctestnet.NORMAL_TIMELOCK, bsctestnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "addUpdateType(string)", timelock], + }; + }), + ...[ + bsctestnet.NORMAL_TIMELOCK, + bsctestnet.FAST_TRACK_TIMELOCK, + bsctestnet.CRITICAL_TIMELOCK, + bsctestnet.GUARDIAN, + ].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "setUpdateTypeActive(string,bool)", timelock], + }; + }), + + // RSR + ...[bsctestnet.NORMAL_TIMELOCK, bsctestnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)", timelock], + }; + }), + ...[ + bsctestnet.NORMAL_TIMELOCK, + bsctestnet.FAST_TRACK_TIMELOCK, + bsctestnet.CRITICAL_TIMELOCK, + bsctestnet.GUARDIAN, + ].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setConfigActive(string,bool)", timelock], + }; + }), + ...[ + bsctestnet.NORMAL_TIMELOCK, + bsctestnet.FAST_TRACK_TIMELOCK, + bsctestnet.CRITICAL_TIMELOCK, + bsctestnet.GUARDIAN, + ].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", timelock], + }; + }), + ...[ + bsctestnet.NORMAL_TIMELOCK, + bsctestnet.FAST_TRACK_TIMELOCK, + bsctestnet.CRITICAL_TIMELOCK, + bsctestnet.GUARDIAN, + ].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setPaused(bool)", timelock], + }; + }), + + // RS + ...[bsctestnet.NORMAL_TIMELOCK, bsctestnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [MARKETCAP_STEWARD, "setSafeDeltaBps(uint256)", timelock], + }; + }), + ...[bsctestnet.NORMAL_TIMELOCK, bsctestnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [COLLATERALFACTORS_STEWARD, "setSafeDeltaBps(uint256)", timelock], + }; + }), + + // MARKETCAP_STEWARD + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "_setMarketBorrowCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "setMarketBorrowCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "setMarketSupplyCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "setCollateralFactor(uint96,address,uint256,uint256)", COLLATERALFACTORS_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ + ethers.constants.AddressZero, + "setCollateralFactor(address,uint256,uint256)", + COLLATERALFACTORS_STEWARD, + ], + }, + + // IRM_STEWARD + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "_setInterestRateModel(address)", IRM_STEWARD], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "setInterestRateModel(address)", IRM_STEWARD], + }, + + // DRSR + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [DESTINATION_RECEIVER_STEWARD, "setRiskParameterConfig(string,address,uint256)", timelock], + dstChainId: LzChainId.sepolia, + }; + }), + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK, sepolia.CRITICAL_TIMELOCK, sepolia.GUARDIAN].map( + timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [DESTINATION_RECEIVER_STEWARD, "setConfigActive(string,bool)", timelock], + dstChainId: LzChainId.sepolia, + }; + }, + ), + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK, sepolia.CRITICAL_TIMELOCK, sepolia.GUARDIAN].map( + timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [DESTINATION_RECEIVER_STEWARD, "setWhitelistedExecutor(address,bool)", timelock], + dstChainId: LzChainId.sepolia, + }; + }, + ), + + // REMOTE RS + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)", timelock], + dstChainId: LzChainId.sepolia, + }; + }), + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)", timelock], + dstChainId: LzChainId.sepolia, + }; + }), + + // REMOTE MARKETCAP_STEWARD + { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])", SEPOLIA_MC_STEWARD], + dstChainId: LzChainId.sepolia, + }, + { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])", SEPOLIA_MC_STEWARD], + dstChainId: LzChainId.sepolia, + }, + { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)", SEPOLIA_CF_STEWARD], + dstChainId: LzChainId.sepolia, + }, + + // REMOTE IRM_STEWARD + { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "setInterestRateModel(address)", SEPOLIA_IRM_STEWARD], + dstChainId: LzChainId.sepolia, + }, + + // accept ownership + ...[DESTINATION_RECEIVER_STEWARD, SEPOLIA_MC_STEWARD, SEPOLIA_CF_STEWARD, SEPOLIA_IRM_STEWARD].map(target => { + return { + target, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.sepolia, + }; + }), + + ...[RISK_ORACLE, RISK_STEWARD_RECEIVER, MARKETCAP_STEWARD, COLLATERALFACTORS_STEWARD, IRM_STEWARD].map(target => { + return { + target, + signature: "acceptOwnership()", + params: [], + }; + }), + + // Wire bridge connection + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [SEPOLIA_EID, ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32)], + }, + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.sepolia, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip600; From ae5fed1446d0e59fde8e12189e723fb8f927dcb5 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Fri, 2 Jan 2026 20:17:18 +0530 Subject: [PATCH 2/7] feat: add vip to enable risk steward on bsctestnet and sepolia --- .../abi/DestinationStewardReceiver.json | 101 +- simulations/vip-600/abi/MarketCapSteward.json | 547 +++++++++++ simulations/vip-600/abi/RiskOracle.json | 922 ++++++++++++++++++ .../vip-600/abi/RiskStewardReceiver.json | 206 +--- simulations/vip-600/bsctestnet-2.ts | 122 +++ simulations/vip-600/bsctestnet.ts | 97 +- simulations/vip-600/sepolia-2.ts | 100 ++ simulations/vip-600/sepolia.ts | 13 +- vips/vip-600/bsctestnet-2.ts | 174 ++++ vips/vip-600/bsctestnet.ts | 79 +- 10 files changed, 1997 insertions(+), 364 deletions(-) create mode 100644 simulations/vip-600/abi/MarketCapSteward.json create mode 100644 simulations/vip-600/abi/RiskOracle.json create mode 100644 simulations/vip-600/bsctestnet-2.ts create mode 100644 simulations/vip-600/sepolia-2.ts create mode 100644 vips/vip-600/bsctestnet-2.ts diff --git a/simulations/vip-600/abi/DestinationStewardReceiver.json b/simulations/vip-600/abi/DestinationStewardReceiver.json index f67c5f250..446db6e78 100644 --- a/simulations/vip-600/abi/DestinationStewardReceiver.json +++ b/simulations/vip-600/abi/DestinationStewardReceiver.json @@ -20,6 +20,16 @@ "name": "ConfigNotActive", "type": "error" }, + { + "inputs": [], + "name": "ConfigStatusUnchanged", + "type": "error" + }, + { + "inputs": [], + "name": "ExecutorStatusUnchanged", + "type": "error" + }, { "inputs": [], "name": "InvalidDebounce", @@ -37,12 +47,17 @@ }, { "inputs": [], - "name": "InvalidUpdateType", + "name": "InvalidLayerZeroEid", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRemoteDelay", "type": "error" }, { "inputs": [], - "name": "LzTokenUnavailable", + "name": "InvalidUpdateType", "type": "error" }, { @@ -61,17 +76,6 @@ "name": "NotAnExecutor", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "msgValue", - "type": "uint256" - } - ], - "name": "NotEnoughNative", - "type": "error" - }, { "inputs": [ { @@ -99,6 +103,16 @@ "name": "OnlyPeer", "type": "error" }, + { + "inputs": [], + "name": "RemoteDelayUnchanged", + "type": "error" + }, + { + "inputs": [], + "name": "RenounceOwnershipNotAllowed", + "type": "error" + }, { "inputs": [ { @@ -197,7 +211,7 @@ "type": "uint256" }, { - "indexed": false, + "indexed": true, "internalType": "string", "name": "updateType", "type": "string" @@ -228,7 +242,7 @@ "type": "bool" }, { - "indexed": true, + "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" @@ -342,7 +356,7 @@ "type": "uint256" }, { - "indexed": false, + "indexed": true, "internalType": "string", "name": "updateType", "type": "string" @@ -399,7 +413,7 @@ "type": "uint256" }, { - "indexed": false, + "indexed": true, "internalType": "string", "name": "updateType", "type": "string" @@ -495,19 +509,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "REMOTE_DELAY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "REMOTE_UPDATE_EXPIRATION_TIME", @@ -736,7 +737,7 @@ "type": "tuple" }, { - "internalType": "enum DestinationStewardReceiver.UpdateStatus", + "internalType": "enum IDestinationStewardReceiver.UpdateStatus", "name": "status", "type": "uint8" }, @@ -751,7 +752,7 @@ "type": "address" } ], - "internalType": "struct DestinationStewardReceiver.DestinationUpdate", + "internalType": "struct IDestinationStewardReceiver.DestinationUpdate", "name": "", "type": "tuple" } @@ -787,7 +788,7 @@ "type": "address" } ], - "internalType": "struct DestinationStewardReceiver.RiskParamConfig", + "internalType": "struct IDestinationStewardReceiver.RiskParamConfig", "name": "", "type": "tuple" } @@ -896,7 +897,7 @@ "type": "address" } ], - "name": "lastRegisteredUpdate", + "name": "lastRegisteredUpdateId", "outputs": [ { "internalType": "uint256", @@ -996,7 +997,7 @@ "type": "uint64" } ], - "stateMutability": "pure", + "stateMutability": "view", "type": "function" }, { @@ -1057,11 +1058,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "remoteDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "pure", "type": "function" }, { @@ -1155,6 +1169,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newRemoteDelay", + "type": "uint256" + } + ], + "name": "setRemoteDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1287,7 +1314,7 @@ "type": "tuple" }, { - "internalType": "enum DestinationStewardReceiver.UpdateStatus", + "internalType": "enum IDestinationStewardReceiver.UpdateStatus", "name": "status", "type": "uint8" }, diff --git a/simulations/vip-600/abi/MarketCapSteward.json b/simulations/vip-600/abi/MarketCapSteward.json new file mode 100644 index 000000000..b7cefbeb9 --- /dev/null +++ b/simulations/vip-600/abi/MarketCapSteward.json @@ -0,0 +1,547 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "riskStewardReceiver_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidSafeDeltaBps", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUintLength", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyRiskStewardReceiver", + "type": "error" + }, + { + "inputs": [], + "name": "RedundantValue", + "type": "error" + }, + { + "inputs": [], + "name": "RenounceOwnershipNotAllowed", + "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": "UnsupportedUpdateType", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "BorrowCapUpdated", + "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": "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": "uint256", + "name": "oldSafeDeltaBps", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSafeDeltaBps", + "type": "uint256" + } + ], + "name": "SafeDeltaBpsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "SupplyCapUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "BORROW_CAP", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BORROW_CAP_KEY", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RISK_STEWARD_RECEIVER", + "outputs": [ + { + "internalType": "contract IRiskStewardReceiver", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SUPPLY_CAP", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SUPPLY_CAP_KEY", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "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": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + } + ], + "name": "applyUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "update", + "type": "tuple" + } + ], + "name": "isSafeForDirectExecution", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "safeDeltaBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "safeDeltaBps_", + "type": "uint256" + } + ], + "name": "setSafeDeltaBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/RiskOracle.json b/simulations/vip-600/abi/RiskOracle.json new file mode 100644 index 000000000..d7e726e42 --- /dev/null +++ b/simulations/vip-600/abi/RiskOracle.json @@ -0,0 +1,922 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateId", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidUpdateTypeString", + "type": "error" + }, + { + "inputs": [], + "name": "NoUpdateFound", + "type": "error" + }, + { + "inputs": [], + "name": "RenounceOwnershipNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "SenderAlreadyAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "SenderNotAuthorized", + "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": "UpdateTypeAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateTypeNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateTypeNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "UpdateTypeStatusUnchanged", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "AuthorizedSenderAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "AuthorizedSenderRemoved", + "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": "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": "string", + "name": "referenceId", + "type": "string" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": true, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "name": "UpdatePublished", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "previousActive", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "UpdateTypeActiveStatusChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "name": "UpdateTypeAdded", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "activeUpdateTypes", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "addAuthorizedSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newUpdateType", + "type": "string" + } + ], + "name": "addUpdateType", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allUpdateTypes", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "allUpdateTypesLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "authorizedSenders", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "name": "getActiveUpdateTypes", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllUpdateTypes", + "outputs": [ + { + "internalType": "string[]", + "name": "", + "type": "string[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getLatestUpdateByTypeAndMarket", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "getLatestUpdateIdByTypeAndMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "getUpdateById", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "internalType": "struct RiskParameterUpdate", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "latestUpdateIdByMarketAndType", + "outputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "referenceIds", + "type": "string[]" + }, + { + "internalType": "bytes[]", + "name": "newValues", + "type": "bytes[]" + }, + { + "internalType": "string[]", + "name": "updateTypes", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "uint96[]", + "name": "poolIds", + "type": "uint96[]" + }, + { + "internalType": "uint32[]", + "name": "dstEid", + "type": "uint32[]" + }, + { + "internalType": "bytes[]", + "name": "additionalData", + "type": "bytes[]" + } + ], + "name": "publishBulkRiskParameterUpdates", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "name": "publishRiskParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "removeAuthorizedSender", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setUpdateTypeActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateCounter", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "updatesById", + "outputs": [ + { + "internalType": "string", + "name": "referenceId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "bytes32", + "name": "updateTypeKey", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "newValue", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "previousValue", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "internalType": "address", + "name": "publisher", + "type": "address" + }, + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "uint32", + "name": "destLzEid", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "additionalData", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/abi/RiskStewardReceiver.json b/simulations/vip-600/abi/RiskStewardReceiver.json index 9434424db..86de7a13f 100644 --- a/simulations/vip-600/abi/RiskStewardReceiver.json +++ b/simulations/vip-600/abi/RiskStewardReceiver.json @@ -25,6 +25,16 @@ "name": "ConfigNotActive", "type": "error" }, + { + "inputs": [], + "name": "ConfigStatusUnchanged", + "type": "error" + }, + { + "inputs": [], + "name": "ExecutorStatusUnchanged", + "type": "error" + }, { "inputs": [], "name": "InvalidDebounce", @@ -40,6 +50,11 @@ "name": "InvalidEndpointCall", "type": "error" }, + { + "inputs": [], + "name": "InvalidLayerZeroEid", + "type": "error" + }, { "inputs": [], "name": "InvalidLzSendCaller", @@ -71,6 +86,11 @@ "name": "InvalidUpdateToResend", "type": "error" }, + { + "inputs": [], + "name": "InvalidUpdateType", + "type": "error" + }, { "inputs": [], "name": "LzTokenUnavailable", @@ -103,17 +123,6 @@ "name": "NotEnoughNative", "type": "error" }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "OnlyEndpoint", - "type": "error" - }, { "inputs": [ { @@ -212,6 +221,11 @@ "name": "UpdateTooFrequent", "type": "error" }, + { + "inputs": [], + "name": "UpdateWillExpireBeforeUnlock", + "type": "error" + }, { "inputs": [], "name": "ZeroAddressNotAllowed", @@ -239,7 +253,7 @@ "type": "bool" }, { - "indexed": true, + "indexed": false, "internalType": "bool", "name": "active", "type": "bool" @@ -264,7 +278,7 @@ "type": "bool" }, { - "indexed": true, + "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" @@ -541,7 +555,7 @@ "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "uint256", "name": "updateId", "type": "uint256" @@ -553,7 +567,7 @@ "type": "uint32" }, { - "indexed": false, + "indexed": true, "internalType": "string", "name": "updateType", "type": "string" @@ -572,7 +586,7 @@ "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "uint256", "name": "updateId", "type": "uint256" @@ -584,7 +598,7 @@ "type": "uint32" }, { - "indexed": false, + "indexed": true, "internalType": "string", "name": "updateType", "type": "string" @@ -658,42 +672,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "srcEid", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "sender", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "internalType": "struct Origin", - "name": "origin", - "type": "tuple" - } - ], - "name": "allowInitializePath", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "endpoint", @@ -851,52 +829,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "srcEid", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "sender", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "internalType": "struct Origin", - "name": "", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - }, - { - "internalType": "address", - "name": "_sender", - "type": "address" - } - ], - "name": "isComposeMsgSender", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [ { @@ -964,56 +896,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "srcEid", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "sender", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "internalType": "struct Origin", - "name": "_origin", - "type": "tuple" - }, - { - "internalType": "bytes32", - "name": "_guid", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "_message", - "type": "bytes" - }, - { - "internalType": "address", - "name": "_executor", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_extraData", - "type": "bytes" - } - ], - "name": "lzReceive", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, { "inputs": [ { @@ -1121,30 +1003,6 @@ "stateMutability": "payable", "type": "function" }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "nextNonce", - "outputs": [ - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "oAppVersion", @@ -1160,7 +1018,7 @@ "type": "uint64" } ], - "stateMutability": "pure", + "stateMutability": "view", "type": "function" }, { diff --git a/simulations/vip-600/bsctestnet-2.ts b/simulations/vip-600/bsctestnet-2.ts new file mode 100644 index 000000000..2958ab3e5 --- /dev/null +++ b/simulations/vip-600/bsctestnet-2.ts @@ -0,0 +1,122 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + COLLATERALFACTORS_STEWARD, + DESTINATION_RECEIVER_STEWARD, + FIVE_MINUTES, + IRM_STEWARD, + MARKETCAP_STEWARD, + RISK_ORACLE, + RISK_PARAMETER_SENDER, + RISK_STEWARD_RECEIVER, + SEPOLIA_EID, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; +import RISK_ORACLE_ABI from "./abi/RiskOracle.json"; +import RSR_ABI from "./abi/RiskStewardReceiver.json"; + +forking(82091393, async () => { + const provider = ethers.provider; + const riskOracle = new ethers.Contract(RISK_ORACLE, RISK_ORACLE_ABI, provider); + const riskStewardReceiver = new ethers.Contract(RISK_STEWARD_RECEIVER, RSR_ABI, provider); + const marketCapSteward = new ethers.Contract(MARKETCAP_STEWARD, STEWARD_ABI, provider); + const collateralFactorSteward = new ethers.Contract(COLLATERALFACTORS_STEWARD, STEWARD_ABI, provider); + + await pretendExecutingVip(await vip600a(), NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK); + + testVip("vip600 Phase-2 Configuring Risk Stewards", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [RISK_ORACLE_ABI, RSR_ABI, STEWARD_ABI], + [ + "AuthorizedSenderAdded", + "UpdateTypeAdded", + "RiskParameterConfigUpdated", + "ExecutorStatusUpdated", + "SafeDeltaBpsUpdated", + ], + [1, 4, 4, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior", () => { + describe("Risk Oracle Configuration", () => { + it("should add authorized senders to Risk Oracle", async () => { + for (const sender of RISK_PARAMETER_SENDER) { + expect(await riskOracle.authorizedSenders(sender)).to.be.true; + } + }); + + it("should add all update types to Risk Oracle", async () => { + expect(await riskOracle.getAllUpdateTypes()).to.deep.equal(UPDATE_TYPES); + }); + }); + + describe("Risk Steward Receiver Configuration", () => { + it("should configure risk parameters for SupplyCap", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(MARKETCAP_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.timelock).to.equal(FIVE_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(MARKETCAP_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.timelock).to.equal(FIVE_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(COLLATERALFACTORS_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.timelock).to.equal(FIVE_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.timelock).to.equal(FIVE_MINUTES); + expect(config.active).to.be.true; + }); + + it("should whitelist executors", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await riskStewardReceiver.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Market Cap Steward to 40%", async () => { + expect(await marketCapSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Collateral Factor Steward to 40%", async () => { + expect(await collateralFactorSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to DESTINATION_RECEIVER_STEWARD (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32); + expect(await riskStewardReceiver.peers(SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/bsctestnet.ts b/simulations/vip-600/bsctestnet.ts index d39f59c05..174f5931a 100644 --- a/simulations/vip-600/bsctestnet.ts +++ b/simulations/vip-600/bsctestnet.ts @@ -9,36 +9,30 @@ import { forking, testVip } from "src/vip-framework"; import vip600, { COLLATERALFACTORS_STEWARD, CORE_COMPTROLLER, - DEFI_COMPTROLLER, - DESTINATION_RECEIVER_STEWARD, IRM_STEWARD, MARKETCAP_STEWARD, RISK_ORACLE, RISK_STEWARD_RECEIVER, - SEPOLIA_EID, - vBTC, - vUSDT_DEFI, } from "../../vips/vip-600/bsctestnet"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; import COMPTROLLER_ABI from "./abi/Comproller.json"; -import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; -import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; import Owner_ABI from "./abi/OwnerMinimalAbi.json"; +import RiskOracle_ABI from "./abi/RiskOracle.json"; import RSR_ABI from "./abi/RiskStewardReceiver.json"; import VToken_ABI from "./abi/VToken.json"; const { bsctestnet } = NETWORK_ADDRESSES; -forking(78592328, async () => { +forking(82078679, async () => { const provider = ethers.provider; const acm = new ethers.Contract(bsctestnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); const comptroller = new ethers.Contract(CORE_COMPTROLLER, COMPTROLLER_ABI, provider); - const isolatedPoolComptroller = new ethers.Contract(DEFI_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; const vBtc = new ethers.Contract(vBTC, VToken_ABI, provider); - const vUsdtDefi = new ethers.Contract(vUSDT_DEFI, ISOLATED_VToken_ABI, provider); // Risk Steward contracts const riskStewardReceiver = new ethers.Contract(RISK_STEWARD_RECEIVER, RSR_ABI, provider); + const riskOracle = new ethers.Contract(RISK_ORACLE, RiskOracle_ABI, provider); const marketCapSteward = new ethers.Contract(MARKETCAP_STEWARD, Owner_ABI, provider); const collateralFactorSteward = new ethers.Contract(COLLATERALFACTORS_STEWARD, Owner_ABI, provider); const irmSteward = new ethers.Contract(IRM_STEWARD, Owner_ABI, provider); @@ -49,7 +43,7 @@ forking(78592328, async () => { txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], - [37], // Expected number of PermissionGranted events (BSC only) + [33], // Expected number of PermissionGranted events (BSC only) ); }, }); @@ -104,7 +98,7 @@ forking(78592328, async () => { it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { const setRiskParamRole = ethers.utils.solidityPack( ["address", "string"], - [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256,uint256)"], ); const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); expect(await acm.hasRole(setRiskParamRoleHash, bsctestnet.NORMAL_TIMELOCK)).to.be.true; @@ -189,24 +183,6 @@ forking(78592328, async () => { expect(await acm.hasRole(supplyCapRoleHash, MARKETCAP_STEWARD)).to.be.true; }); - it("should grant setMarketBorrowCaps permission to MARKETCAP_STEWARD", async () => { - const borrowCapRole = ethers.utils.solidityPack( - ["address", "string"], - [ethers.constants.AddressZero, "setMarketBorrowCaps(address[],uint256[])"], - ); - const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); - expect(await acm.hasRole(borrowCapRoleHash, MARKETCAP_STEWARD)).to.be.true; - }); - - it("should grant setMarketSupplyCaps permission to MARKETCAP_STEWARD", async () => { - const supplyCapRole = ethers.utils.solidityPack( - ["address", "string"], - [ethers.constants.AddressZero, "setMarketSupplyCaps(address[],uint256[])"], - ); - const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); - expect(await acm.hasRole(supplyCapRoleHash, MARKETCAP_STEWARD)).to.be.true; - }); - it("should grant CORE_POOL setCollateralFactor permission to COLLATERALFACTORS_STEWARD", async () => { const collateralFactorRole = ethers.utils.solidityPack( ["address", "string"], @@ -216,15 +192,6 @@ forking(78592328, async () => { expect(await acm.hasRole(collateralFactorRoleHash, COLLATERALFACTORS_STEWARD)).to.be.true; }); - it("should grant ISOLATED_POOL setCollateralFactor permission to COLLATERALFACTORS_STEWARD", async () => { - const collateralFactorRole = ethers.utils.solidityPack( - ["address", "string"], - [ethers.constants.AddressZero, "setCollateralFactor(address,uint256,uint256)"], - ); - const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); - expect(await acm.hasRole(collateralFactorRoleHash, COLLATERALFACTORS_STEWARD)).to.be.true; - }); - it("should grant _setInterestRateModel permission to IRM_STEWARD", async () => { const irmRole = ethers.utils.solidityPack( ["address", "string"], @@ -233,15 +200,6 @@ forking(78592328, async () => { const irmRoleHash = ethers.utils.keccak256(irmRole); expect(await acm.hasRole(irmRoleHash, IRM_STEWARD)).to.be.true; }); - - it("should grant setInterestRateModel permission to IRM_STEWARD", async () => { - const irmRole = ethers.utils.solidityPack( - ["address", "string"], - [ethers.constants.AddressZero, "setInterestRateModel(address)"], - ); - const irmRoleHash = ethers.utils.keccak256(irmRole); - expect(await acm.hasRole(irmRoleHash, IRM_STEWARD)).to.be.true; - }); }); describe("Market operations", () => { @@ -267,22 +225,6 @@ forking(78592328, async () => { ).to.emit(comptroller, "NewBorrowCap"); }); - it("should allow Market Cap Steward to set supply caps on isolated pool markets", async () => { - await expect( - isolatedPoolComptroller - .connect(marketCapSteward) - .setMarketSupplyCaps([vUSDT_DEFI], [parseUnits("150000", 18)]), - ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); - }); - - it("should allow Market Cap Steward to set borrow caps on isolated pool markets", async () => { - await expect( - isolatedPoolComptroller - .connect(marketCapSteward) - .setMarketBorrowCaps([vUSDT_DEFI], [parseUnits("55000", 18)]), - ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); - }); - it("should allow Collateral Factor Steward to set collateral factors on core pool markets", async () => { await expect( comptroller @@ -296,14 +238,6 @@ forking(78592328, async () => { ).to.be.revertedWith("invalid resilient oracle price"); // this reverts due to stale period but it means passed the ACM check }); - it("should allow Collateral Factor Steward to set collateral factors on isolated pool markets", async () => { - await expect( - isolatedPoolComptroller - .connect(collateralFactorSteward) - .setCollateralFactor(vUSDT_DEFI, parseUnits("0.8", 18), parseUnits("0.85", 18)), - ).to.be.revertedWith("invalid resilient oracle price"); // passed the ACM check - }); - it("should allow IRM Steward to set interest rate models on core pool markets", async () => { const TEST_IRM_ADDRESS = "0xf59B7f2733a549dCF82b804d69d9c6a38985B90B"; await expect(vBtc.connect(irmSteward)._setInterestRateModel(TEST_IRM_ADDRESS)).to.emit( @@ -311,17 +245,13 @@ forking(78592328, async () => { "NewMarketInterestRateModel", ); }); - - it("should allow IRM Steward to set interest rate models on isolated pool markets", async () => { - const TEST_IRM_ADDRESS = "0xf59B7f2733a549dCF82b804d69d9c6a38985B90B"; - await expect(vUsdtDefi.connect(irmSteward).setInterestRateModel(TEST_IRM_ADDRESS)).to.emit( - vUsdtDefi, - "NewMarketInterestRateModel", - ); - }); }); describe("Risk Steward Ownership", () => { + it("should set RISK_ORACLE owner to NORMAL_TIMELOCK", async () => { + expect(await riskOracle.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); + }); + it("should set RISK_STEWARD_RECEIVER owner to NORMAL_TIMELOCK", async () => { expect(await riskStewardReceiver.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); }); @@ -338,12 +268,5 @@ forking(78592328, async () => { expect(await irmSteward.owner()).to.equal(bsctestnet.NORMAL_TIMELOCK); }); }); - - describe("Cross-chain peer connections", () => { - it("should set peer for RISK_STEWARD_RECEIVER (RSR) to DESTINATION_RECEIVER_STEWARD (DSR)", async () => { - const expectedPeer = ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32); - expect(await riskStewardReceiver.peers(SEPOLIA_EID)).to.equal(expectedPeer.toLocaleLowerCase()); - }); - }); }); }); diff --git a/simulations/vip-600/sepolia-2.ts b/simulations/vip-600/sepolia-2.ts new file mode 100644 index 000000000..21384ac02 --- /dev/null +++ b/simulations/vip-600/sepolia-2.ts @@ -0,0 +1,100 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + BSCTESTNET_EID, + DESTINATION_RECEIVER_STEWARD, + FIVE_MINUTES, + RISK_STEWARD_RECEIVER, + SEPOLIA_CF_STEWARD, + SEPOLIA_IRM_STEWARD, + SEPOLIA_MC_STEWARD, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(9965225, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract(DESTINATION_RECEIVER_STEWARD, DSR_ABI, provider); + const sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const sepoliaCfSteward = new ethers.Contract(SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Sepolia Market Cap Steward to 40%", async () => { + expect(await sepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Sepolia Collateral Factor Steward to 40%", async () => { + expect(await sepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for DESTINATION_RECEIVER_STEWARD (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/sepolia.ts b/simulations/vip-600/sepolia.ts index 7a5026f56..771e787ed 100644 --- a/simulations/vip-600/sepolia.ts +++ b/simulations/vip-600/sepolia.ts @@ -7,9 +7,7 @@ import { expectEvents, initMainnetUser } from "src/utils"; import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import vip600, { - BSCTESTNET_EID, DESTINATION_RECEIVER_STEWARD, - RISK_STEWARD_RECEIVER, SEPOLIA_ACM, SEPOLIA_CF_STEWARD, SEPOLIA_COMPTROLLER, @@ -24,7 +22,7 @@ import Owner_ABI from "./abi/OwnerMinimalAbi.json"; const { sepolia } = NETWORK_ADDRESSES; -forking(9844003, async () => { +forking(9965225, async () => { const provider = ethers.provider; const acm = new ethers.Contract(SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); const isolatedPoolComptroller = new ethers.Contract(SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); @@ -41,7 +39,7 @@ forking(9844003, async () => { txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], - [18], // Expected number of PermissionGranted events for Sepolia commands + [20], // Expected number of PermissionGranted events for Sepolia commands ); }, }); @@ -209,12 +207,5 @@ forking(9844003, async () => { expect(await sepoliaIrmSteward.owner()).to.equal(sepolia.NORMAL_TIMELOCK); }); }); - - describe("Cross-chain peer connections", () => { - it("should set peer for DESTINATION_RECEIVER_STEWARD (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { - const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); - expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLocaleLowerCase()); - }); - }); }); }); diff --git a/vips/vip-600/bsctestnet-2.ts b/vips/vip-600/bsctestnet-2.ts new file mode 100644 index 000000000..e924b3183 --- /dev/null +++ b/vips/vip-600/bsctestnet-2.ts @@ -0,0 +1,174 @@ +import { ethers } from "hardhat"; +import { LzChainId, ProposalMeta, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +export const CORE_COMPTROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; +export const RISK_ORACLE = "0x4DEA4D1A9F6101D4adacE89f16064D780D2F241d"; +export const RISK_STEWARD_RECEIVER = "0x2F6eb64826f3A067eBFFb5909De7AA4e0Cb31b81"; +export const MARKETCAP_STEWARD = "0xecC583037338D1EFE2C15bb2c6ac81E0294375C2"; +export const COLLATERALFACTORS_STEWARD = "0xBf821F512EA224201108303cc6dA200391Eb38aC"; +export const IRM_STEWARD = "0xE7AcaF3d6CeBA793d94f867FFCE0A1e9a6b3977C"; +export const BSCTESTNET_EID = 40102; + +export const DEFI_COMPTROLLER = "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD"; +export const vUSDT_DEFI = "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750"; +export const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; + +// SEPOLIA +export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; +export const SEPOLIA_CF_STEWARD = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; +export const SEPOLIA_IRM_STEWARD = "0x96834aF3d481C3f70dd31a4a3fe7607C2FC6Aa5b"; +export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; +export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; +export const SEPOLIA_EID = 40161; + +export const WHITELISTED_EXECUTORS = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing wallets +export const RISK_PARAMETER_SENDER = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing wallet +export const UPDATE_TYPES = ["SupplyCap", "BorrowCap", "CollateralFactor", "IRM"]; +export const TEN_MINUTES = 600; +export const FIVE_MINUTES = 300; + +export const vip600 = async () => { + const meta: ProposalMeta = { + version: "v2", + title: "VIP-600 Risk-Steward Phase-2", + description: `VIP-600 Risk-Steward Phase-2 enable for BSC and sepolia network`, + 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( + [ + // Risk Oracle + ...RISK_PARAMETER_SENDER.map(senders => { + return { + target: RISK_ORACLE, + signature: "addAuthorizedSender(address)", + params: [senders], + }; + }), + + ...UPDATE_TYPES.map(updateType => { + return { + target: RISK_ORACLE, + signature: "addUpdateType(string)", + params: [updateType], + }; + }), + + // RSR + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[0], MARKETCAP_STEWARD, TEN_MINUTES, FIVE_MINUTES], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[1], MARKETCAP_STEWARD, TEN_MINUTES, FIVE_MINUTES], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[2], COLLATERALFACTORS_STEWARD, TEN_MINUTES, FIVE_MINUTES], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[3], IRM_STEWARD, TEN_MINUTES, FIVE_MINUTES], + }, + + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: RISK_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + }; + }), + + { + target: MARKETCAP_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], // 40% + }, + { + target: COLLATERALFACTORS_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + }, + + // DSR + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.sepolia, + }, + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.sepolia, + }, + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.sepolia, + }, + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.sepolia, + }, + + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.sepolia, + }, + + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.sepolia, + }; + }), + { + target: SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.sepolia, + }, + { + target: SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.sepolia, + }, + + // Wire bridge connection + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [SEPOLIA_EID, ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32)], + }, + { + target: DESTINATION_RECEIVER_STEWARD, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.sepolia, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip600; diff --git a/vips/vip-600/bsctestnet.ts b/vips/vip-600/bsctestnet.ts index 577f0ca8e..d58343339 100644 --- a/vips/vip-600/bsctestnet.ts +++ b/vips/vip-600/bsctestnet.ts @@ -5,22 +5,18 @@ import { makeProposal } from "src/utils"; const { bsctestnet, sepolia } = NETWORK_ADDRESSES; export const CORE_COMPTROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; -export const RISK_ORACLE = "0xaEDeFDE255BBf2D44BC62D8A078719a258C9a19b"; -export const RISK_STEWARD_RECEIVER = "0xe9Cb27160Df47433b10f6d877FDb6bb7FB9b6578"; -export const MARKETCAP_STEWARD = "0x476B76eC52b055DFbfa26D281b840FC55bEcA4BD"; -export const COLLATERALFACTORS_STEWARD = "0x7922872a4d56c8FE76a6F362c6633c2308C5ac44"; -export const IRM_STEWARD = "0xBb049f3C14a82393d7645b78884d75a7788a6a70"; +export const RISK_ORACLE = "0x4DEA4D1A9F6101D4adacE89f16064D780D2F241d"; +export const RISK_STEWARD_RECEIVER = "0x2F6eb64826f3A067eBFFb5909De7AA4e0Cb31b81"; +export const MARKETCAP_STEWARD = "0xecC583037338D1EFE2C15bb2c6ac81E0294375C2"; +export const COLLATERALFACTORS_STEWARD = "0xBf821F512EA224201108303cc6dA200391Eb38aC"; +export const IRM_STEWARD = "0xE7AcaF3d6CeBA793d94f867FFCE0A1e9a6b3977C"; export const BSCTESTNET_EID = 40102; -export const DEFI_COMPTROLLER = "0x23a73971A6B9f6580c048B9CB188869B2A2aA2aD"; -export const vUSDT_DEFI = "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750"; -export const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; - // SEPOLIA -export const DESTINATION_RECEIVER_STEWARD = "0xD66A3a67842ad563892685216a70B659FC8c18d3"; -export const SEPOLIA_MC_STEWARD = "0xC10683dcb59A1812cc1D202BA561b23eB9E0599b"; -export const SEPOLIA_CF_STEWARD = "0x4Ff531929bDAf4208844dFAbecEDFD28B10611a5"; -export const SEPOLIA_IRM_STEWARD = "0xF68F3C38aE73aC35e550644867556DB5cc4a62EC"; +export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; +export const SEPOLIA_CF_STEWARD = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; +export const SEPOLIA_IRM_STEWARD = "0x96834aF3d481C3f70dd31a4a3fe7607C2FC6Aa5b"; export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; export const SEPOLIA_EID = 40161; @@ -28,8 +24,8 @@ export const SEPOLIA_EID = 40161; export const vip600 = async () => { const meta: ProposalMeta = { version: "v2", - title: "VIP-600", - description: `VIP-600`, + title: "VIP-600 Risk-Steward Phase-1", + description: `VIP-600 Risk-Steward Phase-1 Grant ACM Permissions`, 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", @@ -82,7 +78,7 @@ export const vip600 = async () => { return { target: bsctestnet.ACCESS_CONTROL_MANAGER, signature: "giveCallPermission(address,string,address)", - params: [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)", timelock], + params: [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256,uint256)", timelock], }; }), ...[ @@ -149,30 +145,13 @@ export const vip600 = async () => { signature: "giveCallPermission(address,string,address)", params: [CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])", MARKETCAP_STEWARD], }, - { - target: bsctestnet.ACCESS_CONTROL_MANAGER, - signature: "giveCallPermission(address,string,address)", - params: [ethers.constants.AddressZero, "setMarketBorrowCaps(address[],uint256[])", MARKETCAP_STEWARD], - }, - { - target: bsctestnet.ACCESS_CONTROL_MANAGER, - signature: "giveCallPermission(address,string,address)", - params: [ethers.constants.AddressZero, "setMarketSupplyCaps(address[],uint256[])", MARKETCAP_STEWARD], - }, + + // CF_STEWARD { target: bsctestnet.ACCESS_CONTROL_MANAGER, signature: "giveCallPermission(address,string,address)", params: [CORE_COMPTROLLER, "setCollateralFactor(uint96,address,uint256,uint256)", COLLATERALFACTORS_STEWARD], }, - { - target: bsctestnet.ACCESS_CONTROL_MANAGER, - signature: "giveCallPermission(address,string,address)", - params: [ - ethers.constants.AddressZero, - "setCollateralFactor(address,uint256,uint256)", - COLLATERALFACTORS_STEWARD, - ], - }, // IRM_STEWARD { @@ -180,11 +159,6 @@ export const vip600 = async () => { signature: "giveCallPermission(address,string,address)", params: [ethers.constants.AddressZero, "_setInterestRateModel(address)", IRM_STEWARD], }, - { - target: bsctestnet.ACCESS_CONTROL_MANAGER, - signature: "giveCallPermission(address,string,address)", - params: [ethers.constants.AddressZero, "setInterestRateModel(address)", IRM_STEWARD], - }, // DRSR ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { @@ -205,6 +179,14 @@ export const vip600 = async () => { }; }, ), + ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: SEPOLIA_ACM, + signature: "giveCallPermission(address,string,address)", + params: [DESTINATION_RECEIVER_STEWARD, "setRemoteDelay(uint256)", timelock], + dstChainId: LzChainId.sepolia, + }; + }), ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK, sepolia.CRITICAL_TIMELOCK, sepolia.GUARDIAN].map( timelock => { return { @@ -247,13 +229,13 @@ export const vip600 = async () => { params: [SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])", SEPOLIA_MC_STEWARD], dstChainId: LzChainId.sepolia, }, + // REMOTE CF_STEWARD { target: SEPOLIA_ACM, signature: "giveCallPermission(address,string,address)", params: [SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)", SEPOLIA_CF_STEWARD], dstChainId: LzChainId.sepolia, }, - // REMOTE IRM_STEWARD { target: SEPOLIA_ACM, @@ -262,7 +244,7 @@ export const vip600 = async () => { dstChainId: LzChainId.sepolia, }, - // accept ownership + // accept ownerships ...[DESTINATION_RECEIVER_STEWARD, SEPOLIA_MC_STEWARD, SEPOLIA_CF_STEWARD, SEPOLIA_IRM_STEWARD].map(target => { return { target, @@ -279,19 +261,6 @@ export const vip600 = async () => { params: [], }; }), - - // Wire bridge connection - { - target: RISK_STEWARD_RECEIVER, - signature: "setPeer(uint32,bytes32)", - params: [SEPOLIA_EID, ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32)], - }, - { - target: DESTINATION_RECEIVER_STEWARD, - signature: "setPeer(uint32,bytes32)", - params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], - dstChainId: LzChainId.sepolia, - }, ], meta, ProposalType.REGULAR, From 38dedb1ccfedf44b671783f8161736285334175d Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Fri, 2 Jan 2026 20:29:42 +0530 Subject: [PATCH 3/7] fix: linting --- simulations/vip-600/sepolia-2.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/simulations/vip-600/sepolia-2.ts b/simulations/vip-600/sepolia-2.ts index 21384ac02..8d2941e91 100644 --- a/simulations/vip-600/sepolia-2.ts +++ b/simulations/vip-600/sepolia-2.ts @@ -1,8 +1,7 @@ import { expect } from "chai"; import { ethers } from "hardhat"; -import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { expectEvents } from "src/utils"; -import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; import vip600, { From 5f8f28083baa7b603472ce2990e455688cb098af Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Fri, 2 Jan 2026 21:13:22 +0530 Subject: [PATCH 4/7] fix: update contract address --- simulations/vip-600/sepolia-2.ts | 2 +- simulations/vip-600/sepolia.ts | 2 +- vips/vip-600/bsctestnet-2.ts | 4 ++-- vips/vip-600/bsctestnet.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/simulations/vip-600/sepolia-2.ts b/simulations/vip-600/sepolia-2.ts index 8d2941e91..ac5a0c302 100644 --- a/simulations/vip-600/sepolia-2.ts +++ b/simulations/vip-600/sepolia-2.ts @@ -19,7 +19,7 @@ import vip600, { import DSR_ABI from "./abi/DestinationStewardReceiver.json"; import STEWARD_ABI from "./abi/MarketCapSteward.json"; -forking(9965225, async () => { +forking(9965780, async () => { const provider = ethers.provider; const destinationReceiverSteward = new ethers.Contract(DESTINATION_RECEIVER_STEWARD, DSR_ABI, provider); const sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); diff --git a/simulations/vip-600/sepolia.ts b/simulations/vip-600/sepolia.ts index 771e787ed..e1313ce7c 100644 --- a/simulations/vip-600/sepolia.ts +++ b/simulations/vip-600/sepolia.ts @@ -22,7 +22,7 @@ import Owner_ABI from "./abi/OwnerMinimalAbi.json"; const { sepolia } = NETWORK_ADDRESSES; -forking(9965225, async () => { +forking(9965780, async () => { const provider = ethers.provider; const acm = new ethers.Contract(SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); const isolatedPoolComptroller = new ethers.Contract(SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); diff --git a/vips/vip-600/bsctestnet-2.ts b/vips/vip-600/bsctestnet-2.ts index e924b3183..015a6a8ea 100644 --- a/vips/vip-600/bsctestnet-2.ts +++ b/vips/vip-600/bsctestnet-2.ts @@ -17,8 +17,8 @@ export const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; // SEPOLIA export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; -export const SEPOLIA_CF_STEWARD = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; -export const SEPOLIA_IRM_STEWARD = "0x96834aF3d481C3f70dd31a4a3fe7607C2FC6Aa5b"; +export const SEPOLIA_CF_STEWARD = "0xBe9174A13577B016280aEc20a3b369C5BA272241"; +export const SEPOLIA_IRM_STEWARD = "0xa7E80c303f2EcF9436F11Da14C512B09B44854f4"; export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; export const SEPOLIA_EID = 40161; diff --git a/vips/vip-600/bsctestnet.ts b/vips/vip-600/bsctestnet.ts index d58343339..25bfb3d73 100644 --- a/vips/vip-600/bsctestnet.ts +++ b/vips/vip-600/bsctestnet.ts @@ -15,8 +15,8 @@ export const BSCTESTNET_EID = 40102; // SEPOLIA export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; -export const SEPOLIA_CF_STEWARD = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; -export const SEPOLIA_IRM_STEWARD = "0x96834aF3d481C3f70dd31a4a3fe7607C2FC6Aa5b"; +export const SEPOLIA_CF_STEWARD = "0xBe9174A13577B016280aEc20a3b369C5BA272241"; +export const SEPOLIA_IRM_STEWARD = "0xa7E80c303f2EcF9436F11Da14C512B09B44854f4"; export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; export const SEPOLIA_EID = 40161; From a8789fb84c09ebbbed79319846188091e98454c0 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 5 Jan 2026 17:43:58 +0530 Subject: [PATCH 5/7] fix: typo --- simulations/vip-600/bsctestnet.ts | 4 ++-- simulations/vip-600/sepolia.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simulations/vip-600/bsctestnet.ts b/simulations/vip-600/bsctestnet.ts index 174f5931a..0a97cb29b 100644 --- a/simulations/vip-600/bsctestnet.ts +++ b/simulations/vip-600/bsctestnet.ts @@ -143,7 +143,7 @@ forking(82078679, async () => { }); describe("Steward permissions", () => { - it("should grant setSafeDeltaBps permission to MARKETCAP_STEWARD", async () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK", async () => { const marketCapRole = ethers.utils.solidityPack( ["address", "string"], [MARKETCAP_STEWARD, "setSafeDeltaBps(uint256)"], @@ -153,7 +153,7 @@ forking(82078679, async () => { expect(await acm.hasRole(marketCapRoleHash, bsctestnet.FAST_TRACK_TIMELOCK)).to.be.true; }); - it("should grant setSafeDeltaBps permission to COLLATERALFACTORS_STEWARD", async () => { + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK ", async () => { const cfRole = ethers.utils.solidityPack( ["address", "string"], [COLLATERALFACTORS_STEWARD, "setSafeDeltaBps(uint256)"], diff --git a/simulations/vip-600/sepolia.ts b/simulations/vip-600/sepolia.ts index e1313ce7c..547a36901 100644 --- a/simulations/vip-600/sepolia.ts +++ b/simulations/vip-600/sepolia.ts @@ -82,7 +82,7 @@ forking(9965780, async () => { }); describe("REMOTE_RS setSafeDeltaBps permissions", () => { - it("should grant setSafeDeltaBps permission to MARKETCAP_STEWARD", async () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK ", async () => { const marketCapRole = ethers.utils.solidityPack( ["address", "string"], [SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], @@ -92,7 +92,7 @@ forking(9965780, async () => { expect(await acm.hasRole(marketCapRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; }); - it("should grant setSafeDeltaBps permission to COLLATERALFACTORS_STEWARD", async () => { + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK", async () => { const cfRole = ethers.utils.solidityPack( ["address", "string"], [SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], From 9e1d56f551372ed8fbe6aafeadf39b5f263a8952 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 5 Jan 2026 18:24:30 +0530 Subject: [PATCH 6/7] feat: add mainnet VIP to enable Risk Steward on bscmainnet --- simulations/vip-600/bscmainnet.ts | 353 ++++++++++++++++++++++++++++++ vips/vip-600/bscmainnet.ts | 234 ++++++++++++++++++++ 2 files changed, 587 insertions(+) create mode 100644 simulations/vip-600/bscmainnet.ts create mode 100644 vips/vip-600/bscmainnet.ts diff --git a/simulations/vip-600/bscmainnet.ts b/simulations/vip-600/bscmainnet.ts new file mode 100644 index 000000000..9f8739765 --- /dev/null +++ b/simulations/vip-600/bscmainnet.ts @@ -0,0 +1,353 @@ +import { expect } from "chai"; +import { Signer } 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 vip600, { + CF_STEWARD_SAFE_DELTA, + COLLATERALFACTORS_STEWARD, + CORE_COMPTROLLER, + DEBOUNCE, + IRM_STEWARD, + MARKETCAP_STEWARD, + MC_STEWARD_SAFE_DELTA, + RISK_ORACLE, + RISK_PARAMETER_SENDER, + RISK_STEWARD_RECEIVER, + TIMELOCK, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bscmainnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import COMPTROLLER_ABI from "./abi/Comproller.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; +import RISK_ORACLE_ABI from "./abi/RiskOracle.json"; +import RSR_ABI from "./abi/RiskStewardReceiver.json"; +import VToken_ABI from "./abi/VToken.json"; + +const { bscmainnet } = NETWORK_ADDRESSES; + +forking(74152263, async () => { + const provider = ethers.provider; + const acm = new ethers.Contract(bscmainnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); + const comptroller = new ethers.Contract(CORE_COMPTROLLER, COMPTROLLER_ABI, provider); + const vBTC = "0x882C173bC7Ff3b7786CA16dfeD3DFFfb9Ee7847B"; + const vBtc = new ethers.Contract(vBTC, VToken_ABI, provider); + + // Risk Steward contracts + const riskStewardReceiver = new ethers.Contract(RISK_STEWARD_RECEIVER, RSR_ABI, provider); + const riskOracle = new ethers.Contract(RISK_ORACLE, RISK_ORACLE_ABI, provider); + const marketCapSteward = new ethers.Contract(MARKETCAP_STEWARD, STEWARD_ABI, provider); + const collateralFactorSteward = new ethers.Contract(COLLATERALFACTORS_STEWARD, STEWARD_ABI, provider); + const irmSteward = new ethers.Contract(IRM_STEWARD, Owner_ABI, provider); + + testVip("VIP-600 Risk-Steward ACM Permissions & Configuration", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, RISK_ORACLE_ABI, RSR_ABI, STEWARD_ABI], + [ + "RoleGranted", + "AuthorizedSenderAdded", + "UpdateTypeAdded", + "RiskParameterConfigUpdated", + "ExecutorStatusUpdated", + "SafeDeltaBpsUpdated", + ], + [33, 1, 4, 4, 1, 2], // 33 ACM permissions, 1 sender, 4 update types, 4 configs, 1 executor, 2 delta updates + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("ACM Permissions", () => { + describe("RISK_ORACLE permissions", () => { + it("should grant addAuthorizedSender permission to NORMAL_TIMELOCK", async () => { + const addAuthorizedSenderRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "addAuthorizedSender(address)"], + ); + const addAuthorizedSenderRoleHashNormal = ethers.utils.keccak256(addAuthorizedSenderRoleNormal); + expect(await acm.hasRole(addAuthorizedSenderRoleHashNormal, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + }); + + it("should grant removeAuthorizedSender permission to all timelocks", async () => { + const removeAuthorizedSenderRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "removeAuthorizedSender(address)"], + ); + const removeAuthorizedSenderRoleHashNormal = ethers.utils.keccak256(removeAuthorizedSenderRoleNormal); + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(removeAuthorizedSenderRoleHashNormal, bscmainnet.GUARDIAN)).to.be.true; + }); + + it("should grant addUpdateType permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + const addUpdateTypeRoleNormal = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "addUpdateType(string)"], + ); + const addUpdateTypeRoleHashNormal = ethers.utils.keccak256(addUpdateTypeRoleNormal); + expect(await acm.hasRole(addUpdateTypeRoleHashNormal, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(addUpdateTypeRoleHashNormal, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setUpdateTypeActive permission to all timelocks", async () => { + const setUpdateTypeActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_ORACLE, "setUpdateTypeActive(string,bool)"], + ); + const setUpdateTypeActiveRoleHash = ethers.utils.keccak256(setUpdateTypeActiveRole); + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setUpdateTypeActiveRoleHash, bscmainnet.GUARDIAN)).to.be.true; + }); + }); + + describe("RISK_STEWARD_RECEIVER permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, bscmainnet.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, bscmainnet.GUARDIAN)).to.be.true; + }); + + it("should grant setPaused permission to all timelocks", async () => { + const setPausedRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER, "setPaused(bool)"], + ); + const setPausedRoleHash = ethers.utils.keccak256(setPausedRole); + expect(await acm.hasRole(setPausedRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setPausedRoleHash, bscmainnet.GUARDIAN)).to.be.true; + }); + }); + + describe("Steward permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [MARKETCAP_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [COLLATERALFACTORS_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + }); + + describe("MARKETCAP_STEWARD permissions", () => { + it("should grant _setMarketBorrowCaps permission to MARKETCAP_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "_setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant _setMarketSupplyCaps permission to MARKETCAP_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKETCAP_STEWARD)).to.be.true; + }); + + it("should grant CORE_POOL setCollateralFactor permission to COLLATERALFACTORS_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [CORE_COMPTROLLER, "setCollateralFactor(uint96,address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, COLLATERALFACTORS_STEWARD)).to.be.true; + }); + + it("should grant _setInterestRateModel permission to IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + ["0x0000000000000000000000000000000000000000000000000000000000000000", "_setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, IRM_STEWARD)).to.be.true; + }); + }); + + describe("Market operations", () => { + let marketCapStewardSigner: Signer; + let collateralFactorStewardSigner: Signer; + let irmStewardSigner: Signer; + + before(async () => { + marketCapStewardSigner = await initMainnetUser(MARKETCAP_STEWARD, parseUnits("2")); + collateralFactorStewardSigner = await initMainnetUser(COLLATERALFACTORS_STEWARD, parseUnits("2")); + irmStewardSigner = await initMainnetUser(IRM_STEWARD, parseUnits("2")); + }); + + it("should allow Market Cap Steward to set supply caps on core pool markets", async () => { + await expect( + comptroller.connect(marketCapStewardSigner).setMarketSupplyCaps([vBTC], [parseUnits("150000", 18)]), + ).to.emit(comptroller, "NewSupplyCap"); + }); + + it("should allow Market Cap Steward to set borrow caps on core pool markets", async () => { + await expect( + comptroller.connect(marketCapStewardSigner).setMarketBorrowCaps([vBTC], [parseUnits("55000", 18)]), + ).to.emit(comptroller, "NewBorrowCap"); + }); + + it("should allow Collateral Factor Steward to set collateral factors on core pool markets", async () => { + await expect( + comptroller + .connect(collateralFactorStewardSigner) + ["setCollateralFactor(uint96,address,uint256,uint256)"]( + 0, + vBTC, + parseUnits("0.7", 18), + parseUnits("0.75", 18), + ), + ).to.be.revertedWith("invalid resilient oracle price"); // this reverts due to stale period but it means passed the ACM check + }); + + it("should allow IRM Steward to set interest rate models on core pool markets", async () => { + const TEST_IRM_ADDRESS = "0x38Dd273fE7590403f554F350a7c3c592e8227EB7"; + await expect(vBtc.connect(irmStewardSigner)._setInterestRateModel(TEST_IRM_ADDRESS)).to.emit( + vBtc, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("Risk Steward Ownership", () => { + it("should set RISK_ORACLE owner to NORMAL_TIMELOCK", async () => { + expect(await riskOracle.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("should set RISK_STEWARD_RECEIVER owner to NORMAL_TIMELOCK", async () => { + expect(await riskStewardReceiver.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("should set MARKETCAP_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await marketCapSteward.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("should set COLLATERALFACTORS_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await collateralFactorSteward.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("should set IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await irmSteward.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + }); + }); + + describe("Risk Steward Configuration", () => { + describe("Risk Oracle Configuration", () => { + it("should add authorized senders to Risk Oracle", async () => { + for (const sender of RISK_PARAMETER_SENDER) { + expect(await riskOracle.authorizedSenders(sender)).to.be.true; + } + }); + + it("should add all update types to Risk Oracle", async () => { + expect(await riskOracle.getAllUpdateTypes()).to.deep.equal(UPDATE_TYPES); + }); + }); + + describe("Risk Steward Receiver Configuration", () => { + it("should configure risk parameters for SupplyCap", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(MARKETCAP_STEWARD); + expect(config.debounce).to.equal(DEBOUNCE); + expect(config.timelock).to.equal(TIMELOCK); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(MARKETCAP_STEWARD); + expect(config.debounce).to.equal(DEBOUNCE); + expect(config.timelock).to.equal(TIMELOCK); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactor", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(COLLATERALFACTORS_STEWARD); + expect(config.debounce).to.equal(DEBOUNCE); + expect(config.timelock).to.equal(TIMELOCK); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM", async () => { + const config = await riskStewardReceiver.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(IRM_STEWARD); + expect(config.debounce).to.equal(DEBOUNCE); + expect(config.timelock).to.equal(TIMELOCK); + expect(config.active).to.be.true; + }); + + it("should whitelist executors", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await riskStewardReceiver.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Market Cap Steward to 40%", async () => { + expect(await marketCapSteward.safeDeltaBps()).to.equal(MC_STEWARD_SAFE_DELTA); + }); + + it("should set safe delta BPS for Collateral Factor Steward to 10%", async () => { + expect(await collateralFactorSteward.safeDeltaBps()).to.equal(CF_STEWARD_SAFE_DELTA); + }); + }); + }); + }); +}); diff --git a/vips/vip-600/bscmainnet.ts b/vips/vip-600/bscmainnet.ts new file mode 100644 index 000000000..1db09f2b5 --- /dev/null +++ b/vips/vip-600/bscmainnet.ts @@ -0,0 +1,234 @@ +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalMeta, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const { bscmainnet } = NETWORK_ADDRESSES; +export const CORE_COMPTROLLER = "0xfD36E2c2a6789Db23113685031d7F16329158384"; +export const RISK_ORACLE = "0x0E3E51958b0Daa8C57c949675975CBEDd7b5a1a1"; +export const RISK_STEWARD_RECEIVER = "0x47856bFa74B71d24a5545c7506862B8FddE52baB"; +export const MARKETCAP_STEWARD = "0x816FfD00A274EDE0091421F77817ca260Db3a3E3"; +export const COLLATERALFACTORS_STEWARD = "0x1414ADf007E324ec1D0A77b9F1A8759Ad33d2879"; +export const IRM_STEWARD = "0x8acaBc42Bb98E2e2b091902a7E23f60CcB730aaa"; + +export const WHITELISTED_EXECUTORS = ["0x1111111111111111111111111111111111111111"]; // TODO +export const RISK_PARAMETER_SENDER = ["0x1111111111111111111111111111111111111111"]; // TODO +export const UPDATE_TYPES = ["SupplyCap", "BorrowCap", "CollateralFactor", "IRM"]; +export const DEBOUNCE = 259200; // THREE_DAYS +export const TIMELOCK = 21600; // SIX_HOURS +export const MC_STEWARD_SAFE_DELTA = 4000; // 40% +export const CF_STEWARD_SAFE_DELTA = 1000; // 10% + +export const vip600 = async () => { + const meta: ProposalMeta = { + version: "v2", + title: "VIP-600 Risk-Steward Phase-1", + description: `VIP-600 Risk-Steward Phase-1 Grant ACM Permissions`, + 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( + [ + // ACM + // RISK ORACLE + ...[bscmainnet.NORMAL_TIMELOCK].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "addAuthorizedSender(address)", timelock], + }; + }), + ...[ + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, + ].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "removeAuthorizedSender(address)", timelock], + }; + }), + ...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "addUpdateType(string)", timelock], + }; + }), + ...[ + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, + ].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_ORACLE, "setUpdateTypeActive(string,bool)", timelock], + }; + }), + + // RSR + ...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256,uint256)", timelock], + }; + }), + ...[ + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, + ].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setConfigActive(string,bool)", timelock], + }; + }), + ...[ + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, + ].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", timelock], + }; + }), + ...[ + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, + ].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER, "setPaused(bool)", timelock], + }; + }), + + // RS + ...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [MARKETCAP_STEWARD, "setSafeDeltaBps(uint256)", timelock], + }; + }), + ...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK].map(timelock => { + return { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [COLLATERALFACTORS_STEWARD, "setSafeDeltaBps(uint256)", timelock], + }; + }), + + // MARKETCAP_STEWARD + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "_setMarketBorrowCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])", MARKETCAP_STEWARD], + }, + + // CF_STEWARD + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [CORE_COMPTROLLER, "setCollateralFactor(uint96,address,uint256,uint256)", COLLATERALFACTORS_STEWARD], + }, + + // IRM_STEWARD + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ethers.constants.AddressZero, "_setInterestRateModel(address)", IRM_STEWARD], + }, + + ...[RISK_ORACLE, RISK_STEWARD_RECEIVER, MARKETCAP_STEWARD, COLLATERALFACTORS_STEWARD, IRM_STEWARD].map(target => { + return { + target, + signature: "acceptOwnership()", + params: [], + }; + }), + + // Configuration + // Risk Oracle + ...RISK_PARAMETER_SENDER.map(senders => { + return { + target: RISK_ORACLE, + signature: "addAuthorizedSender(address)", + params: [senders], + }; + }), + + ...UPDATE_TYPES.map(updateType => { + return { + target: RISK_ORACLE, + signature: "addUpdateType(string)", + params: [updateType], + }; + }), + + // RSR + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[0], MARKETCAP_STEWARD, DEBOUNCE, TIMELOCK], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[1], MARKETCAP_STEWARD, DEBOUNCE, TIMELOCK], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[2], COLLATERALFACTORS_STEWARD, DEBOUNCE, TIMELOCK], + }, + { + target: RISK_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256,uint256)", + params: [UPDATE_TYPES[3], IRM_STEWARD, DEBOUNCE, TIMELOCK], + }, + + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: RISK_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + }; + }), + + { + target: MARKETCAP_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [MC_STEWARD_SAFE_DELTA], + }, + { + target: COLLATERALFACTORS_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [CF_STEWARD_SAFE_DELTA], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip600; From c20db159b5a31bfd85cabc531c399e3876f3a7de Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Thu, 8 Jan 2026 18:47:31 +0530 Subject: [PATCH 7/7] feat: enable risk steward on all testnet networks --- simulations/vip-600/abi/ACMAggregator.json | 118 +++++ simulations/vip-600/arbitrumsepolia-2.ts | 103 +++++ simulations/vip-600/arbitrumsepolia.ts | 274 ++++++++++++ simulations/vip-600/basesepolia-2.ts | 99 +++++ simulations/vip-600/basesepolia.ts | 269 ++++++++++++ simulations/vip-600/bscmainnet.ts | 2 +- simulations/vip-600/bsctestnet-2.ts | 43 +- simulations/vip-600/bsctestnet.ts | 7 +- simulations/vip-600/opsepolia-2.ts | 99 +++++ simulations/vip-600/opsepolia.ts | 269 ++++++++++++ simulations/vip-600/sepolia-2.ts | 8 +- simulations/vip-600/sepolia.ts | 98 ++++- simulations/vip-600/unichainsepolia-2.ts | 103 +++++ simulations/vip-600/unichainsepolia.ts | 274 ++++++++++++ simulations/vip-600/zksyncsepolia-2.ts | 99 +++++ simulations/vip-600/zksyncsepolia.ts | 270 ++++++++++++ vips/vip-600/bscmainnet.ts | 2 +- vips/vip-600/bsctestnet-2.ts | 389 +++++++++++++++- vips/vip-600/bsctestnet.ts | 489 +++++++++++++++++---- 19 files changed, 2893 insertions(+), 122 deletions(-) create mode 100644 simulations/vip-600/abi/ACMAggregator.json create mode 100644 simulations/vip-600/arbitrumsepolia-2.ts create mode 100644 simulations/vip-600/arbitrumsepolia.ts create mode 100644 simulations/vip-600/basesepolia-2.ts create mode 100644 simulations/vip-600/basesepolia.ts create mode 100644 simulations/vip-600/opsepolia-2.ts create mode 100644 simulations/vip-600/opsepolia.ts create mode 100644 simulations/vip-600/unichainsepolia-2.ts create mode 100644 simulations/vip-600/unichainsepolia.ts create mode 100644 simulations/vip-600/zksyncsepolia-2.ts create mode 100644 simulations/vip-600/zksyncsepolia.ts diff --git a/simulations/vip-600/abi/ACMAggregator.json b/simulations/vip-600/abi/ACMAggregator.json new file mode 100644 index 000000000..0974d4ab3 --- /dev/null +++ b/simulations/vip-600/abi/ACMAggregator.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "_acm", "type": "address" }], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "EmptyPermissions", "type": "error" }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "GrantPermissionsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "GrantPermissionsExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "RevokePermissionsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "RevokePermissionsExecuted", + "type": "event" + }, + { + "inputs": [], + "name": "ACM", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "internalType": "struct ACMCommandsAggregator.Permission[]", + "name": "_permissions", + "type": "tuple[]" + } + ], + "name": "addGrantPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "internalType": "struct ACMCommandsAggregator.Permission[]", + "name": "_permissions", + "type": "tuple[]" + } + ], + "name": "addRevokePermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "executeGrantPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }], + "name": "executeRevokePermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "grantPermissions", + "outputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "revokePermissions", + "outputs": [ + { "internalType": "address", "name": "contractAddress", "type": "address" }, + { "internalType": "string", "name": "functionSig", "type": "string" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-600/arbitrumsepolia-2.ts b/simulations/vip-600/arbitrumsepolia-2.ts new file mode 100644 index 000000000..14136fde6 --- /dev/null +++ b/simulations/vip-600/arbitrumsepolia-2.ts @@ -0,0 +1,103 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + ARBITRUM_SEPOLIA_CF_STEWARD, + ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ARBITRUM_SEPOLIA_IRM_STEWARD, + ARBITRUM_SEPOLIA_MC_STEWARD, + BSCTESTNET_EID, + FIVE_MINUTES, + RISK_STEWARD_RECEIVER, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(231698540, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract( + ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + DSR_ABI, + provider, + ); + const arbitrumsepoliaMcSteward = new ethers.Contract(ARBITRUM_SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const arbitrumsepoliaCfSteward = new ethers.Contract(ARBITRUM_SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on Arbitrum Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on Arbitrum Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(ARBITRUM_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(ARBITRUM_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(ARBITRUM_SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(ARBITRUM_SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Arbitrum Sepolia Market Cap Steward to 40%", async () => { + expect(await arbitrumsepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Arbitrum Sepolia Collateral Factor Steward to 40%", async () => { + expect(await arbitrumsepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/arbitrumsepolia.ts b/simulations/vip-600/arbitrumsepolia.ts new file mode 100644 index 000000000..c3041cd12 --- /dev/null +++ b/simulations/vip-600/arbitrumsepolia.ts @@ -0,0 +1,274 @@ +import { expect } from "chai"; +import { Contract, Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + ARBITRUMSEPOLIA_ACM_AGGREGATOR, + ARBITRUMSEPOLIA_ACM_AGR_INDEX, + ARBITRUMSEPOLIA_PERMISSIONS, + ARBITRUM_SEPOLIA_ACM, + ARBITRUM_SEPOLIA_CF_STEWARD, + ARBITRUM_SEPOLIA_COMPTROLLER, + ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ARBITRUM_SEPOLIA_IRM_STEWARD, + ARBITRUM_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { arbitrumsepolia } = NETWORK_ADDRESSES; + +forking(231698540, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let arbitrumsepoliaMcSteward: Contract; + let arbitrumsepoliaCfSteward: Contract; + let arbitrumsepoliaIrmSteward: Contract; + + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(ARBITRUM_SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract( + ARBITRUM_SEPOLIA_COMPTROLLER, + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + acmAggregator = new ethers.Contract(ARBITRUMSEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // ARBITRUM_SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + arbitrumsepoliaMcSteward = new ethers.Contract(ARBITRUM_SEPOLIA_MC_STEWARD, Owner_ABI, provider); + arbitrumsepoliaCfSteward = new ethers.Contract(ARBITRUM_SEPOLIA_CF_STEWARD, Owner_ABI, provider); + arbitrumsepoliaIrmSteward = new ethers.Contract(ARBITRUM_SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(ARBITRUMSEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match ARBITRUMSEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match ARBITRUMSEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < ARBITRUMSEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(ARBITRUMSEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = ARBITRUMSEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(ARBITRUMSEPOLIA_PERMISSIONS.length); + // Out of bound + await expect( + acmAggregator.callStatic.grantPermissions(ARBITRUMSEPOLIA_ACM_AGR_INDEX, ARBITRUMSEPOLIA_PERMISSIONS.length), + ).to.be.reverted; + }); + }); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Arbitrum Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [24], // Expected number of PermissionGranted events for Arbitrum Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, arbitrumsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, arbitrumsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, arbitrumsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, arbitrumsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, arbitrumsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to ARBITRUM_SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, ARBITRUM_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to ARBITRUM_SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, ARBITRUM_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to ARBITRUM_SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [ARBITRUM_SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, ARBITRUM_SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to ARBITRUM_SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, ARBITRUM_SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0x292Ec2b45C549Bc2c6B31937dBd511beaAEabea8"; + + before(async () => { + marketCapSteward = await initMainnetUser(ARBITRUM_SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(ARBITRUM_SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(ARBITRUM_SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow ARBITRUM_SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow ARBITRUM_SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow ARBITRUM_SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow ARBITRUM_SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0x50e8FF8748684F5DbDAEc5554c7FE3E82Cdc19e1"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("ARBITRUM_SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(arbitrumsepolia.NORMAL_TIMELOCK); + }); + + it("should set ARBITRUM_SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await arbitrumsepoliaMcSteward.owner()).to.equal(arbitrumsepolia.NORMAL_TIMELOCK); + }); + + it("should set ARBITRUM_SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await arbitrumsepoliaCfSteward.owner()).to.equal(arbitrumsepolia.NORMAL_TIMELOCK); + }); + + it("should set ARBITRUM_SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await arbitrumsepoliaIrmSteward.owner()).to.equal(arbitrumsepolia.NORMAL_TIMELOCK); + }); + }); + }); +}); diff --git a/simulations/vip-600/basesepolia-2.ts b/simulations/vip-600/basesepolia-2.ts new file mode 100644 index 000000000..5ccfa9ec4 --- /dev/null +++ b/simulations/vip-600/basesepolia-2.ts @@ -0,0 +1,99 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + BASE_SEPOLIA_CF_STEWARD, + BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + BASE_SEPOLIA_IRM_STEWARD, + BASE_SEPOLIA_MC_STEWARD, + BSCTESTNET_EID, + FIVE_MINUTES, + RISK_STEWARD_RECEIVER, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(36052864, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract(BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + const basesepoliaMcSteward = new ethers.Contract(BASE_SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const basesepoliaCfSteward = new ethers.Contract(BASE_SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on Base Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on Base Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(BASE_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(BASE_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(BASE_SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(BASE_SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Base Sepolia Market Cap Steward to 40%", async () => { + expect(await basesepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Base Sepolia Collateral Factor Steward to 40%", async () => { + expect(await basesepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/basesepolia.ts b/simulations/vip-600/basesepolia.ts new file mode 100644 index 000000000..80231bb74 --- /dev/null +++ b/simulations/vip-600/basesepolia.ts @@ -0,0 +1,269 @@ +import { expect } from "chai"; +import { Contract, Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + BASESEPOLIA_ACM_AGGREGATOR, + BASESEPOLIA_ACM_AGR_INDEX, + BASESEPOLIA_PERMISSIONS, + BASE_SEPOLIA_ACM, + BASE_SEPOLIA_CF_STEWARD, + BASE_SEPOLIA_COMPTROLLER, + BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + BASE_SEPOLIA_IRM_STEWARD, + BASE_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { basesepolia } = NETWORK_ADDRESSES; + +forking(36052864, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let basesepoliaMcSteward: Contract; + let basesepoliaCfSteward: Contract; + let basesepoliaIrmSteward: Contract; + + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(BASE_SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract(BASE_SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + acmAggregator = new ethers.Contract(BASESEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // BASE_SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + basesepoliaMcSteward = new ethers.Contract(BASE_SEPOLIA_MC_STEWARD, Owner_ABI, provider); + basesepoliaCfSteward = new ethers.Contract(BASE_SEPOLIA_CF_STEWARD, Owner_ABI, provider); + basesepoliaIrmSteward = new ethers.Contract(BASE_SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(BASESEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match BASESEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match BASESEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < BASESEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(BASESEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = BASESEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(BASESEPOLIA_PERMISSIONS.length); + // Out of bound + await expect(acmAggregator.callStatic.grantPermissions(BASESEPOLIA_ACM_AGR_INDEX, BASESEPOLIA_PERMISSIONS.length)) + .to.be.reverted; + }); + }); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Base Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [24], // Expected number of PermissionGranted events for Base Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, basesepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, basesepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, basesepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, basesepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, basesepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to BASE_SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, BASE_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to BASE_SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, BASE_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to BASE_SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [BASE_SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, BASE_SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to BASE_SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, BASE_SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0xA31D67c056Aadc2501535f2776bF1157904f810e"; + + before(async () => { + marketCapSteward = await initMainnetUser(BASE_SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(BASE_SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(BASE_SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow BASE_SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow BASE_SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow BASE_SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow BASE_SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0x43B1cF9AFA734F04d395Db87c593c75c2701Ea49"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("BASE_SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(basesepolia.NORMAL_TIMELOCK); + }); + + it("should set BASE_SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await basesepoliaMcSteward.owner()).to.equal(basesepolia.NORMAL_TIMELOCK); + }); + + it("should set BASE_SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await basesepoliaCfSteward.owner()).to.equal(basesepolia.NORMAL_TIMELOCK); + }); + + it("should set BASE_SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await basesepoliaIrmSteward.owner()).to.equal(basesepolia.NORMAL_TIMELOCK); + }); + }); + }); +}); diff --git a/simulations/vip-600/bscmainnet.ts b/simulations/vip-600/bscmainnet.ts index 9f8739765..a4a9109c4 100644 --- a/simulations/vip-600/bscmainnet.ts +++ b/simulations/vip-600/bscmainnet.ts @@ -31,7 +31,7 @@ import VToken_ABI from "./abi/VToken.json"; const { bscmainnet } = NETWORK_ADDRESSES; -forking(74152263, async () => { +forking(74496538, async () => { const provider = ethers.provider; const acm = new ethers.Contract(bscmainnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); const comptroller = new ethers.Contract(CORE_COMPTROLLER, COMPTROLLER_ABI, provider); diff --git a/simulations/vip-600/bsctestnet-2.ts b/simulations/vip-600/bsctestnet-2.ts index 2958ab3e5..2bb4c9410 100644 --- a/simulations/vip-600/bsctestnet-2.ts +++ b/simulations/vip-600/bsctestnet-2.ts @@ -6,24 +6,34 @@ import { forking, pretendExecutingVip, testVip } from "src/vip-framework"; import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; import vip600, { + ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ARBITRUM_SEPOLIA_EID, + BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + BASE_SEPOLIA_EID, COLLATERALFACTORS_STEWARD, - DESTINATION_RECEIVER_STEWARD, FIVE_MINUTES, IRM_STEWARD, MARKETCAP_STEWARD, + OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + OP_SEPOLIA_EID, RISK_ORACLE, RISK_PARAMETER_SENDER, RISK_STEWARD_RECEIVER, + SEPOLIA_DESTINATION_STEWARD_RECEIVER, SEPOLIA_EID, TEN_MINUTES, + UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + UNICHAIN_SEPOLIA_EID, UPDATE_TYPES, WHITELISTED_EXECUTORS, + ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ZK_SEPOLIA_EID, } from "../../vips/vip-600/bsctestnet-2"; import STEWARD_ABI from "./abi/MarketCapSteward.json"; import RISK_ORACLE_ABI from "./abi/RiskOracle.json"; import RSR_ABI from "./abi/RiskStewardReceiver.json"; -forking(82091393, async () => { +forking(83235428, async () => { const provider = ethers.provider; const riskOracle = new ethers.Contract(RISK_ORACLE, RISK_ORACLE_ABI, provider); const riskStewardReceiver = new ethers.Contract(RISK_STEWARD_RECEIVER, RSR_ABI, provider); @@ -113,10 +123,35 @@ forking(82091393, async () => { }); describe("Cross-chain peer connections", () => { - it("should set peer for RISK_STEWARD_RECEIVER (RSR) to DESTINATION_RECEIVER_STEWARD (DSR)", async () => { - const expectedPeer = ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32); + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); expect(await riskStewardReceiver.peers(SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); }); + + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); + expect(await riskStewardReceiver.peers(ARBITRUM_SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); + + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); + expect(await riskStewardReceiver.peers(BASE_SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); + + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); + expect(await riskStewardReceiver.peers(OP_SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); + + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); + expect(await riskStewardReceiver.peers(UNICHAIN_SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); + + it("should set peer for RISK_STEWARD_RECEIVER (RSR) to ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32); + expect(await riskStewardReceiver.peers(ZK_SEPOLIA_EID)).to.equal(expectedPeer.toLowerCase()); + }); }); }); }); diff --git a/simulations/vip-600/bsctestnet.ts b/simulations/vip-600/bsctestnet.ts index 0a97cb29b..9e4bb5b64 100644 --- a/simulations/vip-600/bsctestnet.ts +++ b/simulations/vip-600/bsctestnet.ts @@ -23,7 +23,7 @@ import VToken_ABI from "./abi/VToken.json"; const { bsctestnet } = NETWORK_ADDRESSES; -forking(82078679, async () => { +forking(83235428, async () => { const provider = ethers.provider; const acm = new ethers.Contract(bsctestnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); const comptroller = new ethers.Contract(CORE_COMPTROLLER, COMPTROLLER_ABI, provider); @@ -43,20 +43,21 @@ forking(82078679, async () => { txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], - [33], // Expected number of PermissionGranted events (BSC only) + [34], // Expected number of PermissionGranted events (BSC only) ); }, }); describe("Post-VIP behavior", () => { describe("RISK_ORACLE permissions", () => { - it("should grant addAuthorizedSender permission to NORMAL_TIMELOCK", async () => { + it("should grant addAuthorizedSender permission to NORMAL_TIMELOCK and GUARDIAN", async () => { const addAuthorizedSenderRoleNormal = ethers.utils.solidityPack( ["address", "string"], [RISK_ORACLE, "addAuthorizedSender(address)"], ); const addAuthorizedSenderRoleHashNormal = ethers.utils.keccak256(addAuthorizedSenderRoleNormal); expect(await acm.hasRole(addAuthorizedSenderRoleHashNormal, bsctestnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(addAuthorizedSenderRoleHashNormal, bsctestnet.GUARDIAN)).to.be.true; }); it("should grant removeAuthorizedSender permission to all timelocks", async () => { diff --git a/simulations/vip-600/opsepolia-2.ts b/simulations/vip-600/opsepolia-2.ts new file mode 100644 index 000000000..7046c47ba --- /dev/null +++ b/simulations/vip-600/opsepolia-2.ts @@ -0,0 +1,99 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + BSCTESTNET_EID, + FIVE_MINUTES, + OP_SEPOLIA_CF_STEWARD, + OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + OP_SEPOLIA_IRM_STEWARD, + OP_SEPOLIA_MC_STEWARD, + RISK_STEWARD_RECEIVER, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(38035753, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract(OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + const opsepoliaMcSteward = new ethers.Contract(OP_SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const opsepoliaCfSteward = new ethers.Contract(OP_SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on Optimism Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on Optimism Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(OP_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(OP_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(OP_SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(OP_SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Optimism Sepolia Market Cap Steward to 40%", async () => { + expect(await opsepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Optimism Sepolia Collateral Factor Steward to 40%", async () => { + expect(await opsepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/opsepolia.ts b/simulations/vip-600/opsepolia.ts new file mode 100644 index 000000000..541fb71b0 --- /dev/null +++ b/simulations/vip-600/opsepolia.ts @@ -0,0 +1,269 @@ +import { expect } from "chai"; +import { Contract, Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + OPSEPOLIA_ACM_AGR_INDEX, + OPSEPOLIA_PERMISSIONS, + OPTEMISUMSEPOLIA_ACM_AGGREGATOR, + OP_SEPOLIA_ACM, + OP_SEPOLIA_CF_STEWARD, + OP_SEPOLIA_COMPTROLLER, + OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + OP_SEPOLIA_IRM_STEWARD, + OP_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { opsepolia } = NETWORK_ADDRESSES; + +forking(38035753, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let opsepoliaMcSteward: Contract; + let opsepoliaCfSteward: Contract; + let opsepoliaIrmSteward: Contract; + + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(OP_SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract(OP_SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + acmAggregator = new ethers.Contract(OPTEMISUMSEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // OPTIMISM_SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + opsepoliaMcSteward = new ethers.Contract(OP_SEPOLIA_MC_STEWARD, Owner_ABI, provider); + opsepoliaCfSteward = new ethers.Contract(OP_SEPOLIA_CF_STEWARD, Owner_ABI, provider); + opsepoliaIrmSteward = new ethers.Contract(OP_SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(OPSEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match OPSEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match OPSEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < OPSEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(OPSEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = OPSEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(OPSEPOLIA_PERMISSIONS.length); + // Out of bound + await expect(acmAggregator.callStatic.grantPermissions(OPSEPOLIA_ACM_AGR_INDEX, OPSEPOLIA_PERMISSIONS.length)).to + .be.reverted; + }); + }); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Optimism Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [24], // Expected number of PermissionGranted events for Optimism Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, opsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, opsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, opsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, opsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, opsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to OP_SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, OP_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to OP_SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, OP_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to OP_SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [OP_SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, OP_SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to OP_SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, OP_SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0x2419606690B08060ebFd7581e0a6Ae45f1915ee9"; + + before(async () => { + marketCapSteward = await initMainnetUser(OP_SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(OP_SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(OP_SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow OP_SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow OP_SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow OP_SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow OP_SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0x5A0F8bce93204F14F3829d3c77644ee540843C22"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("OPTIMISM_SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(opsepolia.NORMAL_TIMELOCK); + }); + + it("should set OP_SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await opsepoliaMcSteward.owner()).to.equal(opsepolia.NORMAL_TIMELOCK); + }); + + it("should set OP_SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await opsepoliaCfSteward.owner()).to.equal(opsepolia.NORMAL_TIMELOCK); + }); + + it("should set OP_SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await opsepoliaIrmSteward.owner()).to.equal(opsepolia.NORMAL_TIMELOCK); + }); + }); + }); +}); diff --git a/simulations/vip-600/sepolia-2.ts b/simulations/vip-600/sepolia-2.ts index ac5a0c302..32c00268f 100644 --- a/simulations/vip-600/sepolia-2.ts +++ b/simulations/vip-600/sepolia-2.ts @@ -6,10 +6,10 @@ import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; import vip600, { BSCTESTNET_EID, - DESTINATION_RECEIVER_STEWARD, FIVE_MINUTES, RISK_STEWARD_RECEIVER, SEPOLIA_CF_STEWARD, + SEPOLIA_DESTINATION_STEWARD_RECEIVER, SEPOLIA_IRM_STEWARD, SEPOLIA_MC_STEWARD, TEN_MINUTES, @@ -19,9 +19,9 @@ import vip600, { import DSR_ABI from "./abi/DestinationStewardReceiver.json"; import STEWARD_ABI from "./abi/MarketCapSteward.json"; -forking(9965780, async () => { +forking(10002670, async () => { const provider = ethers.provider; - const destinationReceiverSteward = new ethers.Contract(DESTINATION_RECEIVER_STEWARD, DSR_ABI, provider); + const destinationReceiverSteward = new ethers.Contract(SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); const sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); const sepoliaCfSteward = new ethers.Contract(SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); @@ -90,7 +90,7 @@ forking(9965780, async () => { }); describe("Cross-chain peer connections", () => { - it("should set peer for DESTINATION_RECEIVER_STEWARD (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + it("should set peer for SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); }); diff --git a/simulations/vip-600/sepolia.ts b/simulations/vip-600/sepolia.ts index 547a36901..d679db2c6 100644 --- a/simulations/vip-600/sepolia.ts +++ b/simulations/vip-600/sepolia.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { Signer } from "ethers"; +import { Contract, Signer } from "ethers"; import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; @@ -7,13 +7,17 @@ import { expectEvents, initMainnetUser } from "src/utils"; import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; import vip600, { - DESTINATION_RECEIVER_STEWARD, SEPOLIA_ACM, + SEPOLIA_ACM_AGGREGATOR, + SEPOLIA_ACM_AGR_INDEX, SEPOLIA_CF_STEWARD, SEPOLIA_COMPTROLLER, + SEPOLIA_DESTINATION_STEWARD_RECEIVER, SEPOLIA_IRM_STEWARD, SEPOLIA_MC_STEWARD, + SEPOLIA_PERMISSIONS, } from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; import DSR_ABI from "./abi/DestinationStewardReceiver.json"; import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; @@ -22,16 +26,56 @@ import Owner_ABI from "./abi/OwnerMinimalAbi.json"; const { sepolia } = NETWORK_ADDRESSES; -forking(9965780, async () => { - const provider = ethers.provider; - const acm = new ethers.Contract(SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); - const isolatedPoolComptroller = new ethers.Contract(SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); +forking(10002670, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let sepoliaMcSteward: Contract; + let sepoliaCfSteward: Contract; + let sepoliaIrmSteward: Contract; - // SEPOLIA Risk Steward contracts - const destinationReceiverSteward = new ethers.Contract(DESTINATION_RECEIVER_STEWARD, DSR_ABI, provider); - const sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, Owner_ABI, provider); - const sepoliaCfSteward = new ethers.Contract(SEPOLIA_CF_STEWARD, Owner_ABI, provider); - const sepoliaIrmSteward = new ethers.Contract(SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract(SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + acmAggregator = new ethers.Contract(SEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + sepoliaMcSteward = new ethers.Contract(SEPOLIA_MC_STEWARD, Owner_ABI, provider); + sepoliaCfSteward = new ethers.Contract(SEPOLIA_CF_STEWARD, Owner_ABI, provider); + sepoliaIrmSteward = new ethers.Contract(SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(SEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match SEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match SEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < SEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(SEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = SEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(SEPOLIA_PERMISSIONS.length); + // Out of bound + await expect(acmAggregator.callStatic.grantPermissions(SEPOLIA_ACM_AGR_INDEX, SEPOLIA_PERMISSIONS.length)).to.be + .reverted; + }); + }); testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Sepolia", await vip600(), { callbackAfterExecution: async txResponse => { @@ -39,27 +83,28 @@ forking(9965780, async () => { txResponse, [ACCESS_CONTROL_MANAGER_ABI], ["PermissionGranted"], - [20], // Expected number of PermissionGranted events for Sepolia commands + [24], // Expected number of PermissionGranted events for Sepolia commands ); }, }); describe("Post-VIP behavior", () => { describe("DESTINATION_RECEIVER_STEWARD permissions", () => { - it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK and FAST_TRACK_TIMELOCK", async () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { const setRiskParamRole = ethers.utils.solidityPack( ["address", "string"], - [DESTINATION_RECEIVER_STEWARD, "setRiskParameterConfig(string,address,uint256)"], + [SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], ); const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); expect(await acm.hasRole(setRiskParamRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; expect(await acm.hasRole(setRiskParamRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, sepolia.GUARDIAN)).to.be.true; }); it("should grant setConfigActive permission to all timelocks", async () => { const setConfigActiveRole = ethers.utils.solidityPack( ["address", "string"], - [DESTINATION_RECEIVER_STEWARD, "setConfigActive(string,bool)"], + [SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], ); const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; @@ -68,10 +113,21 @@ forking(9965780, async () => { expect(await acm.hasRole(setConfigActiveRoleHash, sepolia.GUARDIAN)).to.be.true; }); + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, sepolia.GUARDIAN)).to.be.true; + }); + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { const setWhitelistedExecutorRole = ethers.utils.solidityPack( ["address", "string"], - [DESTINATION_RECEIVER_STEWARD, "setWhitelistedExecutor(address,bool)"], + [SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], ); const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); expect(await acm.hasRole(setWhitelistedExecutorRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; @@ -82,7 +138,7 @@ forking(9965780, async () => { }); describe("REMOTE_RS setSafeDeltaBps permissions", () => { - it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK ", async () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { const marketCapRole = ethers.utils.solidityPack( ["address", "string"], [SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], @@ -90,9 +146,10 @@ forking(9965780, async () => { const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); expect(await acm.hasRole(marketCapRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; expect(await acm.hasRole(marketCapRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, sepolia.GUARDIAN)).to.be.true; }); - it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL and FAST_TRACK TIMELOCK", async () => { + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { const cfRole = ethers.utils.solidityPack( ["address", "string"], [SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], @@ -100,6 +157,7 @@ forking(9965780, async () => { const cfRoleHash = ethers.utils.keccak256(cfRole); expect(await acm.hasRole(cfRoleHash, sepolia.NORMAL_TIMELOCK)).to.be.true; expect(await acm.hasRole(cfRoleHash, sepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, sepolia.GUARDIAN)).to.be.true; }); }); @@ -176,12 +234,12 @@ forking(9965780, async () => { isolatedPoolComptroller .connect(collateralFactorSteward) .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), - ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + ).to.be.revertedWith("invalid resilient oracle price"); // this reverts due to stale period but it means passed the ACM check }); it("should allow SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { const irmAddress = "0x8E09246751bcf2F621694881bd0E55d681f061c3"; - const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, provider); + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( market, diff --git a/simulations/vip-600/unichainsepolia-2.ts b/simulations/vip-600/unichainsepolia-2.ts new file mode 100644 index 000000000..852bc5f58 --- /dev/null +++ b/simulations/vip-600/unichainsepolia-2.ts @@ -0,0 +1,103 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + BSCTESTNET_EID, + FIVE_MINUTES, + RISK_STEWARD_RECEIVER, + TEN_MINUTES, + UNICHAIN_SEPOLIA_CF_STEWARD, + UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + UNICHAIN_SEPOLIA_IRM_STEWARD, + UNICHAIN_SEPOLIA_MC_STEWARD, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(41021745, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract( + UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + DSR_ABI, + provider, + ); + const unichainsepoliaMcSteward = new ethers.Contract(UNICHAIN_SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const unichainsepoliaCfSteward = new ethers.Contract(UNICHAIN_SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on Unichain Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on Unichain Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(UNICHAIN_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(UNICHAIN_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(UNICHAIN_SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(UNICHAIN_SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for Unichain Sepolia Market Cap Steward to 40%", async () => { + expect(await unichainsepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for Unichain Sepolia Collateral Factor Steward to 40%", async () => { + expect(await unichainsepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/unichainsepolia.ts b/simulations/vip-600/unichainsepolia.ts new file mode 100644 index 000000000..f8cf73425 --- /dev/null +++ b/simulations/vip-600/unichainsepolia.ts @@ -0,0 +1,274 @@ +import { expect } from "chai"; +import { Contract, Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + UNICHAINSEPOLIA_ACM_AGGREGATOR, + UNICHAINSEPOLIA_ACM_AGR_INDEX, + UNICHAINSEPOLIA_PERMISSIONS, + UNICHAIN_SEPOLIA_ACM, + UNICHAIN_SEPOLIA_CF_STEWARD, + UNICHAIN_SEPOLIA_COMPTROLLER, + UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + UNICHAIN_SEPOLIA_IRM_STEWARD, + UNICHAIN_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { unichainsepolia } = NETWORK_ADDRESSES; + +forking(41021745, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let unichainsepoliaMcSteward: Contract; + let unichainsepoliaCfSteward: Contract; + let unichainsepoliaIrmSteward: Contract; + + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(UNICHAIN_SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract( + UNICHAIN_SEPOLIA_COMPTROLLER, + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + acmAggregator = new ethers.Contract(UNICHAINSEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // UNICHAIN_SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + unichainsepoliaMcSteward = new ethers.Contract(UNICHAIN_SEPOLIA_MC_STEWARD, Owner_ABI, provider); + unichainsepoliaCfSteward = new ethers.Contract(UNICHAIN_SEPOLIA_CF_STEWARD, Owner_ABI, provider); + unichainsepoliaIrmSteward = new ethers.Contract(UNICHAIN_SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(UNICHAINSEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match UNICHAINSEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match UNICHAINSEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < UNICHAINSEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(UNICHAINSEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = UNICHAINSEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(UNICHAINSEPOLIA_PERMISSIONS.length); + // Out of bound + await expect( + acmAggregator.callStatic.grantPermissions(UNICHAINSEPOLIA_ACM_AGR_INDEX, UNICHAINSEPOLIA_PERMISSIONS.length), + ).to.be.reverted; + }); + }); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on Unichain Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [24], // Expected number of PermissionGranted events for Unichain Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, unichainsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, unichainsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, unichainsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, unichainsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, unichainsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to UNICHAIN_SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, UNICHAIN_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to UNICHAIN_SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, UNICHAIN_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to UNICHAIN_SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [UNICHAIN_SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, UNICHAIN_SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to UNICHAIN_SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, UNICHAIN_SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0x0CA7edfcCF5dbf8AFdeAFB2D918409d439E3320A"; + + before(async () => { + marketCapSteward = await initMainnetUser(UNICHAIN_SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(UNICHAIN_SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(UNICHAIN_SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow UNICHAIN_SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow UNICHAIN_SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow UNICHAIN_SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow UNICHAIN_SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0xAB28D51283Bd455bF1d3eE7e1B3f29fa23CBB89D"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("UNICHAIN_SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(unichainsepolia.NORMAL_TIMELOCK); + }); + + it("should set UNICHAIN_SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await unichainsepoliaMcSteward.owner()).to.equal(unichainsepolia.NORMAL_TIMELOCK); + }); + + it("should set UNICHAIN_SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await unichainsepoliaCfSteward.owner()).to.equal(unichainsepolia.NORMAL_TIMELOCK); + }); + + it("should set UNICHAIN_SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await unichainsepoliaIrmSteward.owner()).to.equal(unichainsepolia.NORMAL_TIMELOCK); + }); + }); + }); +}); diff --git a/simulations/vip-600/zksyncsepolia-2.ts b/simulations/vip-600/zksyncsepolia-2.ts new file mode 100644 index 000000000..be34080a4 --- /dev/null +++ b/simulations/vip-600/zksyncsepolia-2.ts @@ -0,0 +1,99 @@ +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { vip600 as vip600a } from "../../vips/vip-600/bsctestnet"; +import vip600, { + BSCTESTNET_EID, + FIVE_MINUTES, + RISK_STEWARD_RECEIVER, + TEN_MINUTES, + UPDATE_TYPES, + WHITELISTED_EXECUTORS, + ZK_SEPOLIA_CF_STEWARD, + ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ZK_SEPOLIA_IRM_STEWARD, + ZK_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet-2"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import STEWARD_ABI from "./abi/MarketCapSteward.json"; + +forking(6480660, async () => { + const provider = ethers.provider; + const destinationReceiverSteward = new ethers.Contract(ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + const zksyncsepoliaMcSteward = new ethers.Contract(ZK_SEPOLIA_MC_STEWARD, STEWARD_ABI, provider); + const zksyncsepoliaCfSteward = new ethers.Contract(ZK_SEPOLIA_CF_STEWARD, STEWARD_ABI, provider); + + testForkedNetworkVipCommands("vip600a Phase-1", await vip600a()); + + testForkedNetworkVipCommands("vip600 Phase-2 Configuring Risk Stewards on zkSync Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [DSR_ABI, STEWARD_ABI], + ["RiskParameterConfigUpdated", "RemoteDelaySet", "ExecutorStatusUpdated", "SafeDeltaBpsUpdated"], + [4, 1, 1, 2], + ); + }, + }); + + describe("Post-VIP Phase-2 behavior on zkSync Sepolia", () => { + describe("Destination Receiver Steward Configuration", () => { + it("should configure risk parameters for SupplyCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[0]); + expect(config.riskSteward).to.equal(ZK_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for BorrowCap on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[1]); + expect(config.riskSteward).to.equal(ZK_SEPOLIA_MC_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for CollateralFactors on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[2]); + expect(config.riskSteward).to.equal(ZK_SEPOLIA_CF_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should configure risk parameters for IRM on remote chain", async () => { + const config = await destinationReceiverSteward.getRiskParameterConfig(UPDATE_TYPES[3]); + expect(config.riskSteward).to.equal(ZK_SEPOLIA_IRM_STEWARD); + expect(config.debounce).to.equal(TEN_MINUTES); + expect(config.active).to.be.true; + }); + + it("should set remote delay to 5 minutes", async () => { + expect(await destinationReceiverSteward.remoteDelay()).to.equal(FIVE_MINUTES); + }); + + it("should whitelist executors on remote chain", async () => { + for (const executor of WHITELISTED_EXECUTORS) { + expect(await destinationReceiverSteward.whitelistedExecutors(executor)).to.be.true; + } + }); + }); + + describe("Remote Steward Safe Delta Configuration", () => { + it("should set safe delta BPS for zkSync Sepolia Market Cap Steward to 40%", async () => { + expect(await zksyncsepoliaMcSteward.safeDeltaBps()).to.equal(4000); + }); + + it("should set safe delta BPS for zkSync Sepolia Collateral Factor Steward to 40%", async () => { + expect(await zksyncsepoliaCfSteward.safeDeltaBps()).to.equal(4000); + }); + }); + + describe("Cross-chain peer connections", () => { + it("should set peer for ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER (DSR) to RISK_STEWARD_RECEIVER (RSR)", async () => { + const expectedPeer = ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32); + expect(await destinationReceiverSteward.peers(BSCTESTNET_EID)).to.equal(expectedPeer.toLowerCase()); + }); + }); + }); +}); diff --git a/simulations/vip-600/zksyncsepolia.ts b/simulations/vip-600/zksyncsepolia.ts new file mode 100644 index 000000000..18e5243b0 --- /dev/null +++ b/simulations/vip-600/zksyncsepolia.ts @@ -0,0 +1,270 @@ +import { expect } from "chai"; +import { Contract, Signer } 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, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip600, { + ZKSYNCSEPOLIA_ACM_AGGREGATOR, + ZKSYNCSEPOLIA_ACM_AGR_INDEX, + ZKSYNCSEPOLIA_PERMISSIONS, + ZK_SEPOLIA_ACM, + ZK_SEPOLIA_CF_STEWARD, + ZK_SEPOLIA_COMPTROLLER, + ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ZK_SEPOLIA_IRM_STEWARD, + ZK_SEPOLIA_MC_STEWARD, +} from "../../vips/vip-600/bsctestnet"; +import ACM_AGGREGATOR_ABI from "./abi/ACMAggregator.json"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import DSR_ABI from "./abi/DestinationStewardReceiver.json"; +import ISOLATED_VToken_ABI from "./abi/ILVToken.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import Owner_ABI from "./abi/OwnerMinimalAbi.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; + +forking(6480660, async () => { + let acm: Contract; + let isolatedPoolComptroller: Contract; + let acmAggregator: Contract; + let destinationReceiverSteward: Contract; + let zksyncsepoliaMcSteward: Contract; + let zksyncsepoliaCfSteward: Contract; + let zksyncsepoliaIrmSteward: Contract; + + before(async () => { + const provider = ethers.provider; + acm = new ethers.Contract(ZK_SEPOLIA_ACM, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract(ZK_SEPOLIA_COMPTROLLER, ISOLATED_POOL_COMPTROLLER_ABI, provider); + acmAggregator = new ethers.Contract(ZKSYNCSEPOLIA_ACM_AGGREGATOR, ACM_AGGREGATOR_ABI, provider); + + // ZKSYNC_SEPOLIA Risk Steward contracts + destinationReceiverSteward = new ethers.Contract(ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, DSR_ABI, provider); + zksyncsepoliaMcSteward = new ethers.Contract(ZK_SEPOLIA_MC_STEWARD, Owner_ABI, provider); + zksyncsepoliaCfSteward = new ethers.Contract(ZK_SEPOLIA_CF_STEWARD, Owner_ABI, provider); + zksyncsepoliaIrmSteward = new ethers.Contract(ZK_SEPOLIA_IRM_STEWARD, Owner_ABI, provider); + const signer = provider.getSigner(); + await acmAggregator.connect(signer).addGrantPermissions(ZKSYNCSEPOLIA_PERMISSIONS); + }); + + describe("Pre-VIP behavior", () => { + it("should verify stored permissions match ZKSYNCSEPOLIA_PERMISSIONS from buildRemoteChainPermissions", async () => { + // Retrieve all permissions from the aggregator using grantPermissions and verify they match ZKSYNCSEPOLIA_PERMISSIONS + const storedPermissions = []; + for (let i = 0; i < ZKSYNCSEPOLIA_PERMISSIONS.length; i++) { + const storedPermission = await acmAggregator.grantPermissions(ZKSYNCSEPOLIA_ACM_AGR_INDEX, i); + storedPermissions.push(storedPermission); + const expectedPermission = ZKSYNCSEPOLIA_PERMISSIONS[i]; + + expect(storedPermission.contractAddress.toLowerCase()).to.equal( + expectedPermission[0].toLowerCase(), + `Permission ${i} contractAddress mismatch`, + ); + expect(storedPermission.functionSig).to.equal(expectedPermission[1], `Permission ${i} functionSig mismatch`); + expect(storedPermission.account.toLowerCase()).to.equal( + expectedPermission[2].toLowerCase(), + `Permission ${i} account mismatch`, + ); + } + // Verify the count matches + expect(storedPermissions.length).to.equal(ZKSYNCSEPOLIA_PERMISSIONS.length); + // Out of bound + await expect( + acmAggregator.callStatic.grantPermissions(ZKSYNCSEPOLIA_ACM_AGR_INDEX, ZKSYNCSEPOLIA_PERMISSIONS.length), + ).to.be.reverted; + }); + }); + + testForkedNetworkVipCommands("vip600 Configuring Risk Stewards on zkSync Sepolia", await vip600(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI], + ["PermissionGranted"], + [24], // Expected number of PermissionGranted events for zkSync Sepolia commands + ); + }, + }); + + describe("Post-VIP behavior", () => { + describe("DESTINATION_RECEIVER_STEWARD permissions", () => { + it("should grant setRiskParameterConfig permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRiskParamRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)"], + ); + const setRiskParamRoleHash = ethers.utils.keccak256(setRiskParamRole); + expect(await acm.hasRole(setRiskParamRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRiskParamRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setConfigActive permission to all timelocks", async () => { + const setConfigActiveRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)"], + ); + const setConfigActiveRoleHash = ethers.utils.keccak256(setConfigActiveRole); + expect(await acm.hasRole(setConfigActiveRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, zksyncsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setConfigActiveRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setRemoteDelay permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const setRemoteDelayRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)"], + ); + const setRemoteDelayRoleHash = ethers.utils.keccak256(setRemoteDelayRole); + expect(await acm.hasRole(setRemoteDelayRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setRemoteDelayRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant setWhitelistedExecutor permission to all timelocks", async () => { + const setWhitelistedExecutorRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)"], + ); + const setWhitelistedExecutorRoleHash = ethers.utils.keccak256(setWhitelistedExecutorRole); + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, zksyncsepolia.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(setWhitelistedExecutorRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE_RS setSafeDeltaBps permissions", () => { + it("should grant MC_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const marketCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const marketCapRoleHash = ethers.utils.keccak256(marketCapRole); + expect(await acm.hasRole(marketCapRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(marketCapRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + + it("should grant CF_STEWARD setSafeDeltaBps permission to NORMAL_TIMELOCK, FAST_TRACK_TIMELOCK and GUARDIAN", async () => { + const cfRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)"], + ); + const cfRoleHash = ethers.utils.keccak256(cfRole); + expect(await acm.hasRole(cfRoleHash, zksyncsepolia.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, zksyncsepolia.FAST_TRACK_TIMELOCK)).to.be.true; + expect(await acm.hasRole(cfRoleHash, zksyncsepolia.GUARDIAN)).to.be.true; + }); + }); + + describe("REMOTE MARKETCAP_STEWARD permissions", () => { + it("should grant setMarketBorrowCaps permission to ZK_SEPOLIA_MC_STEWARD", async () => { + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, ZK_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setMarketSupplyCaps permission to ZK_SEPOLIA_MC_STEWARD", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, ZK_SEPOLIA_MC_STEWARD)).to.be.true; + }); + + it("should grant setCollateralFactor permission to ZK_SEPOLIA_CF_STEWARD", async () => { + const collateralFactorRole = ethers.utils.solidityPack( + ["address", "string"], + [ZK_SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)"], + ); + const collateralFactorRoleHash = ethers.utils.keccak256(collateralFactorRole); + expect(await acm.hasRole(collateralFactorRoleHash, ZK_SEPOLIA_CF_STEWARD)).to.be.true; + }); + }); + + describe("REMOTE IRM_STEWARD permissions", () => { + it("should grant setInterestRateModel permission to ZK_SEPOLIA_IRM_STEWARD", async () => { + const irmRole = ethers.utils.solidityPack( + ["address", "string"], + [ethers.constants.AddressZero, "setInterestRateModel(address)"], + ); + const irmRoleHash = ethers.utils.keccak256(irmRole); + expect(await acm.hasRole(irmRoleHash, ZK_SEPOLIA_IRM_STEWARD)).to.be.true; + }); + }); + + describe("Remote operations", () => { + let marketCapSteward: Signer; + let collateralFactorSteward: Signer; + let irmSteward: Signer; + const marketAddress = "0x853ed4e6ab3a6747d71Bb79eDbc0A64FF87D31BF"; + + before(async () => { + marketCapSteward = await initMainnetUser(ZK_SEPOLIA_MC_STEWARD, parseUnits("2")); + collateralFactorSteward = await initMainnetUser(ZK_SEPOLIA_CF_STEWARD, parseUnits("2")); + irmSteward = await initMainnetUser(ZK_SEPOLIA_IRM_STEWARD, parseUnits("2")); + }); + + it("should allow ZK_SEPOLIA_MC_STEWARD to set supply caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketSupplyCaps([marketAddress], [parseUnits("150000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + }); + + it("should allow ZK_SEPOLIA_MC_STEWARD to set borrow caps on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(marketCapSteward) + .setMarketBorrowCaps([marketAddress], [parseUnits("55000", 18)]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("should allow ZK_SEPOLIA_CF_STEWARD to set collateral factors on remote markets", async () => { + await expect( + isolatedPoolComptroller + .connect(collateralFactorSteward) + .setCollateralFactor(marketAddress, parseUnits("0.8", 18), parseUnits("0.85", 18)), + ).to.emit(isolatedPoolComptroller, "NewCollateralFactor"); + }); + + it("should allow ZK_SEPOLIA_IRM_STEWARD to set interest rate models on remote markets", async () => { + const irmAddress = "0x782D1BA04d28dbbf1Ff664B62993f69cd6225466"; + const market = new ethers.Contract(marketAddress, ISOLATED_VToken_ABI, ethers.provider); + + await expect(market.connect(irmSteward).setInterestRateModel(irmAddress)).to.emit( + market, + "NewMarketInterestRateModel", + ); + }); + }); + + describe("ZKSYNC_SEPOLIA Risk Steward Ownership", () => { + it("should set DESTINATION_RECEIVER_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await destinationReceiverSteward.owner()).to.equal(zksyncsepolia.NORMAL_TIMELOCK); + }); + + it("should set ZK_SEPOLIA_MC_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await zksyncsepoliaMcSteward.owner()).to.equal(zksyncsepolia.NORMAL_TIMELOCK); + }); + + it("should set ZK_SEPOLIA_CF_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await zksyncsepoliaCfSteward.owner()).to.equal(zksyncsepolia.NORMAL_TIMELOCK); + }); + + it("should set ZK_SEPOLIA_IRM_STEWARD owner to NORMAL_TIMELOCK", async () => { + expect(await zksyncsepoliaIrmSteward.owner()).to.equal(zksyncsepolia.NORMAL_TIMELOCK); + }); + }); + }); +}); diff --git a/vips/vip-600/bscmainnet.ts b/vips/vip-600/bscmainnet.ts index 1db09f2b5..5cb301b03 100644 --- a/vips/vip-600/bscmainnet.ts +++ b/vips/vip-600/bscmainnet.ts @@ -13,7 +13,7 @@ export const IRM_STEWARD = "0x8acaBc42Bb98E2e2b091902a7E23f60CcB730aaa"; export const WHITELISTED_EXECUTORS = ["0x1111111111111111111111111111111111111111"]; // TODO export const RISK_PARAMETER_SENDER = ["0x1111111111111111111111111111111111111111"]; // TODO -export const UPDATE_TYPES = ["SupplyCap", "BorrowCap", "CollateralFactor", "IRM"]; +export const UPDATE_TYPES = ["supplyCap", "borrowCap", "collateralFactors", "interestRateModel"]; export const DEBOUNCE = 259200; // THREE_DAYS export const TIMELOCK = 21600; // SIX_HOURS export const MC_STEWARD_SAFE_DELTA = 4000; // 40% diff --git a/vips/vip-600/bsctestnet-2.ts b/vips/vip-600/bsctestnet-2.ts index 015a6a8ea..44167559f 100644 --- a/vips/vip-600/bsctestnet-2.ts +++ b/vips/vip-600/bsctestnet-2.ts @@ -15,7 +15,7 @@ export const vUSDT_DEFI = "0x80CC30811e362aC9aB857C3d7875CbcCc0b65750"; export const vBTC = "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe"; // SEPOLIA -export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; export const SEPOLIA_CF_STEWARD = "0xBe9174A13577B016280aEc20a3b369C5BA272241"; export const SEPOLIA_IRM_STEWARD = "0xa7E80c303f2EcF9436F11Da14C512B09B44854f4"; @@ -23,9 +23,44 @@ export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; export const SEPOLIA_EID = 40161; -export const WHITELISTED_EXECUTORS = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing wallets -export const RISK_PARAMETER_SENDER = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing wallet -export const UPDATE_TYPES = ["SupplyCap", "BorrowCap", "CollateralFactor", "IRM"]; +// ARBITRUM_SEPOLIA +export const ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const ARBITRUM_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const ARBITRUM_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const ARBITRUM_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const ARBITRUM_SEPOLIA_EID = 40231; + +// BASE_SEPOLIA +export const BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const BASE_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const BASE_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const BASE_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const BASE_SEPOLIA_EID = 40245; + +// OPTIMISM_SEPOLIA +export const OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const OP_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const OP_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const OP_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const OP_SEPOLIA_EID = 40232; + +// UNICHAIN_SEPOLIA +export const UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const UNICHAIN_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const UNICHAIN_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const UNICHAIN_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const UNICHAIN_SEPOLIA_EID = 40333; + +// ZKSYNC_SEPOLIA +export const ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xAA087d8427F3DF6eb2225C3B889Cf888Bef374ac"; +export const ZK_SEPOLIA_MC_STEWARD = "0x0eb731161a5F4CAf533A4bb28E0Cef3d2d136b14"; +export const ZK_SEPOLIA_CF_STEWARD = "0xa156C9e7ED294CC6888212352A541fc512ef13F5"; +export const ZK_SEPOLIA_IRM_STEWARD = "0xEBdcF6518FCd8Cf70d64c5908463279030f6f0f0"; +export const ZK_SEPOLIA_EID = 40305; + +export const WHITELISTED_EXECUTORS = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing account +export const RISK_PARAMETER_SENDER = ["0xe2a089cA69a90f1E27E723EFD339Cff4c4701AcC"]; // testing account +export const UPDATE_TYPES = ["supplyCap", "borrowCap", "collateralFactors", "interestRateModel"]; export const TEN_MINUTES = 600; export const FIVE_MINUTES = 300; @@ -33,7 +68,7 @@ export const vip600 = async () => { const meta: ProposalMeta = { version: "v2", title: "VIP-600 Risk-Steward Phase-2", - description: `VIP-600 Risk-Steward Phase-2 enable for BSC and sepolia network`, + description: `VIP-600 Risk-Steward Phase-2 enable for BSC and all remote testnet networks`, 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", @@ -99,34 +134,34 @@ export const vip600 = async () => { params: [4000], }, - // DSR + // SEPOLIA DSR { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setRiskParameterConfig(string,address,uint256)", params: [UPDATE_TYPES[0], SEPOLIA_MC_STEWARD, TEN_MINUTES], dstChainId: LzChainId.sepolia, }, { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setRiskParameterConfig(string,address,uint256)", params: [UPDATE_TYPES[1], SEPOLIA_MC_STEWARD, TEN_MINUTES], dstChainId: LzChainId.sepolia, }, { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setRiskParameterConfig(string,address,uint256)", params: [UPDATE_TYPES[2], SEPOLIA_CF_STEWARD, TEN_MINUTES], dstChainId: LzChainId.sepolia, }, { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setRiskParameterConfig(string,address,uint256)", params: [UPDATE_TYPES[3], SEPOLIA_IRM_STEWARD, TEN_MINUTES], dstChainId: LzChainId.sepolia, }, { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setRemoteDelay(uint256)", params: [FIVE_MINUTES], dstChainId: LzChainId.sepolia, @@ -134,7 +169,7 @@ export const vip600 = async () => { ...WHITELISTED_EXECUTORS.map(executor => { return { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setWhitelistedExecutor(address,bool)", params: [executor, true], dstChainId: LzChainId.sepolia, @@ -153,18 +188,344 @@ export const vip600 = async () => { dstChainId: LzChainId.sepolia, }, + // ARBITRUM_SEPOLIA DSR + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], ARBITRUM_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], ARBITRUM_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], ARBITRUM_SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], ARBITRUM_SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.arbitrumsepolia, + }, + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.arbitrumsepolia, + }; + }), + { + target: ARBITRUM_SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.arbitrumsepolia, + }, + + // BASE_SEPOLIA DSR + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], BASE_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], BASE_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], BASE_SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], BASE_SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.basesepolia, + }, + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.basesepolia, + }; + }), + { + target: BASE_SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.basesepolia, + }, + + // OPTIMISM_SEPOLIA DSR + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], OP_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], OP_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], OP_SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], OP_SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.opsepolia, + }, + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.opsepolia, + }; + }), + { + target: OP_SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.opsepolia, + }, + + // UNICHAIN_SEPOLIA DSR + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], UNICHAIN_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], UNICHAIN_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], UNICHAIN_SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], UNICHAIN_SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.unichainsepolia, + }, + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.unichainsepolia, + }; + }), + { + target: UNICHAIN_SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.unichainsepolia, + }, + + // ZKSYNC_SEPOLIA DSR + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[0], ZK_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[1], ZK_SEPOLIA_MC_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[2], ZK_SEPOLIA_CF_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRiskParameterConfig(string,address,uint256)", + params: [UPDATE_TYPES[3], ZK_SEPOLIA_IRM_STEWARD, TEN_MINUTES], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setRemoteDelay(uint256)", + params: [FIVE_MINUTES], + dstChainId: LzChainId.zksyncsepolia, + }, + ...WHITELISTED_EXECUTORS.map(executor => { + return { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setWhitelistedExecutor(address,bool)", + params: [executor, true], + dstChainId: LzChainId.zksyncsepolia, + }; + }), + { + target: ZK_SEPOLIA_MC_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_CF_STEWARD, + signature: "setSafeDeltaBps(uint256)", + params: [4000], + dstChainId: LzChainId.zksyncsepolia, + }, + // Wire bridge connection + // SEPOLIA { target: RISK_STEWARD_RECEIVER, signature: "setPeer(uint32,bytes32)", - params: [SEPOLIA_EID, ethers.utils.hexZeroPad(DESTINATION_RECEIVER_STEWARD, 32)], + params: [SEPOLIA_EID, ethers.utils.hexZeroPad(SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], }, { - target: DESTINATION_RECEIVER_STEWARD, + target: SEPOLIA_DESTINATION_STEWARD_RECEIVER, signature: "setPeer(uint32,bytes32)", params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], dstChainId: LzChainId.sepolia, }, + + // ARBITRUM_SEPOLIA + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [ARBITRUM_SEPOLIA_EID, ethers.utils.hexZeroPad(ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], + }, + { + target: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.arbitrumsepolia, + }, + + // BASE_SEPOLIA + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BASE_SEPOLIA_EID, ethers.utils.hexZeroPad(BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], + }, + { + target: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.basesepolia, + }, + + // OPTIMISM_SEPOLIA + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [OP_SEPOLIA_EID, ethers.utils.hexZeroPad(OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], + }, + { + target: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.opsepolia, + }, + + // UNICHAIN_SEPOLIA + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [UNICHAIN_SEPOLIA_EID, ethers.utils.hexZeroPad(UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], + }, + { + target: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.unichainsepolia, + }, + + // ZKSYNC_SEPOLIA + { + target: RISK_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [ZK_SEPOLIA_EID, ethers.utils.hexZeroPad(ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, 32)], + }, + { + target: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + signature: "setPeer(uint32,bytes32)", + params: [BSCTESTNET_EID, ethers.utils.hexZeroPad(RISK_STEWARD_RECEIVER, 32)], + dstChainId: LzChainId.zksyncsepolia, + }, ], meta, ProposalType.REGULAR, diff --git a/vips/vip-600/bsctestnet.ts b/vips/vip-600/bsctestnet.ts index 25bfb3d73..0d7385b2d 100644 --- a/vips/vip-600/bsctestnet.ts +++ b/vips/vip-600/bsctestnet.ts @@ -3,23 +3,247 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { LzChainId, ProposalMeta, ProposalType } from "src/types"; import { makeProposal } from "src/utils"; -const { bsctestnet, sepolia } = NETWORK_ADDRESSES; +const { bsctestnet, sepolia, arbitrumsepolia, basesepolia, opsepolia, unichainsepolia, zksyncsepolia } = + NETWORK_ADDRESSES; export const CORE_COMPTROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; export const RISK_ORACLE = "0x4DEA4D1A9F6101D4adacE89f16064D780D2F241d"; export const RISK_STEWARD_RECEIVER = "0x2F6eb64826f3A067eBFFb5909De7AA4e0Cb31b81"; export const MARKETCAP_STEWARD = "0xecC583037338D1EFE2C15bb2c6ac81E0294375C2"; export const COLLATERALFACTORS_STEWARD = "0xBf821F512EA224201108303cc6dA200391Eb38aC"; export const IRM_STEWARD = "0xE7AcaF3d6CeBA793d94f867FFCE0A1e9a6b3977C"; -export const BSCTESTNET_EID = 40102; // SEPOLIA -export const DESTINATION_RECEIVER_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; export const SEPOLIA_MC_STEWARD = "0xcD598bDcfF0433395918512359745f83F5730C49"; export const SEPOLIA_CF_STEWARD = "0xBe9174A13577B016280aEc20a3b369C5BA272241"; export const SEPOLIA_IRM_STEWARD = "0xa7E80c303f2EcF9436F11Da14C512B09B44854f4"; export const SEPOLIA_ACM = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; export const SEPOLIA_COMPTROLLER = "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70"; -export const SEPOLIA_EID = 40161; + +// ARBITRUM_SEPOLIA +export const ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const ARBITRUM_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const ARBITRUM_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const ARBITRUM_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const ARBITRUM_SEPOLIA_ACM = "0xa36AD96441cB931D8dFEAAaC97D3FaB4B39E590F"; +export const ARBITRUM_SEPOLIA_COMPTROLLER = "0x006D44b6f5927b3eD83bD0c1C36Fb1A3BaCaC208"; + +// BASE_SEPOLIA +export const BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const BASE_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const BASE_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const BASE_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const BASE_SEPOLIA_ACM = "0x724138223D8F76b519fdE715f60124E7Ce51e051"; +export const BASE_SEPOLIA_COMPTROLLER = "0x272795dd6c5355CF25765F36043F34014454Eb5b"; + +// OPTIMISUM_SEPOLIA +export const OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const OP_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const OP_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const OP_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const OP_SEPOLIA_ACM = "0x1652E12C8ABE2f0D84466F0fc1fA4286491B3BC1"; +export const OP_SEPOLIA_COMPTROLLER = "0x59d10988974223B042767aaBFb6D926863069535"; + +// UNICHAIN_SEPOLIA +export const UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xCbab4C50D8458958515763dA4Db0Ba74769a5653"; +export const UNICHAIN_SEPOLIA_MC_STEWARD = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +export const UNICHAIN_SEPOLIA_CF_STEWARD = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const UNICHAIN_SEPOLIA_IRM_STEWARD = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const UNICHAIN_SEPOLIA_ACM = "0x854C064EA6b503A97980F481FA3B7279012fdeDd"; +export const UNICHAIN_SEPOLIA_COMPTROLLER = "0xFeD3eAA668a6179c9E5E1A84e3A7d6883F06f7c1"; + +// ZKSYNC_SEPOLIA +export const ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER = "0xAA087d8427F3DF6eb2225C3B889Cf888Bef374ac"; +export const ZK_SEPOLIA_MC_STEWARD = "0x0eb731161a5F4CAf533A4bb28E0Cef3d2d136b14"; +export const ZK_SEPOLIA_CF_STEWARD = "0xa156C9e7ED294CC6888212352A541fc512ef13F5"; +export const ZK_SEPOLIA_IRM_STEWARD = "0xEBdcF6518FCd8Cf70d64c5908463279030f6f0f0"; +export const ZK_SEPOLIA_ACM = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; +export const ZK_SEPOLIA_COMPTROLLER = "0xC527DE08E43aeFD759F7c0e6aE85433923064669"; + +export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; +export const SEPOLIA_ACM_AGGREGATOR = "0x0653830c55035d678e1287b2d4550519fd263d0e"; +export const ARBITRUMSEPOLIA_ACM_AGGREGATOR = "0x4fCbfE445396f31005b3Fd2F6DE2A986d6E2dCB5"; +export const BASESEPOLIA_ACM_AGGREGATOR = "0xd82A217713F6c61f3ed4199cdEEDfbB80e5E4562"; +export const OPTEMISUMSEPOLIA_ACM_AGGREGATOR = "0xEEeF13364fD22b8eA6932A9ed337e2638f8E0eD6"; +export const UNICHAINSEPOLIA_ACM_AGGREGATOR = "0xb0067C9CD83B00DE781e9b456Bf0Fec86D687Bb2"; +export const ZKSYNCSEPOLIA_ACM_AGGREGATOR = "0x920Bb18c4bd4D7bc41Bf39933BCAa3D078641502"; + +export const SEPOLIA_ACM_AGR_INDEX = 6; +export const ARBITRUMSEPOLIA_ACM_AGR_INDEX = 5; +export const BASESEPOLIA_ACM_AGR_INDEX = 4; +export const OPSEPOLIA_ACM_AGR_INDEX = 2; +export const UNICHAINSEPOLIA_ACM_AGR_INDEX = 5; +export const ZKSYNCSEPOLIA_ACM_AGR_INDEX = 2; + +export const SEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: sepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: sepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: sepolia.CRITICAL_TIMELOCK, + GUARDIAN: sepolia.GUARDIAN, + + MC_STEWARD: SEPOLIA_MC_STEWARD, + CF_STEWARD: SEPOLIA_CF_STEWARD, + IRM_STEWARD: SEPOLIA_IRM_STEWARD, + + COMPTROLLER: SEPOLIA_COMPTROLLER, +}); + +export const ARBITRUMSEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: arbitrumsepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: arbitrumsepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: arbitrumsepolia.CRITICAL_TIMELOCK, + GUARDIAN: arbitrumsepolia.GUARDIAN, + + MC_STEWARD: ARBITRUM_SEPOLIA_MC_STEWARD, + CF_STEWARD: ARBITRUM_SEPOLIA_CF_STEWARD, + IRM_STEWARD: ARBITRUM_SEPOLIA_IRM_STEWARD, + + COMPTROLLER: ARBITRUM_SEPOLIA_COMPTROLLER, +}); + +export const BASESEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: basesepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: basesepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: basesepolia.CRITICAL_TIMELOCK, + GUARDIAN: basesepolia.GUARDIAN, + + MC_STEWARD: BASE_SEPOLIA_MC_STEWARD, + CF_STEWARD: BASE_SEPOLIA_CF_STEWARD, + IRM_STEWARD: BASE_SEPOLIA_IRM_STEWARD, + + COMPTROLLER: BASE_SEPOLIA_COMPTROLLER, +}); + +export const OPSEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: opsepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: opsepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: opsepolia.CRITICAL_TIMELOCK, + GUARDIAN: opsepolia.GUARDIAN, + + MC_STEWARD: OP_SEPOLIA_MC_STEWARD, + CF_STEWARD: OP_SEPOLIA_CF_STEWARD, + IRM_STEWARD: OP_SEPOLIA_IRM_STEWARD, + + COMPTROLLER: OP_SEPOLIA_COMPTROLLER, +}); + +export const UNICHAINSEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: unichainsepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: unichainsepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: unichainsepolia.CRITICAL_TIMELOCK, + GUARDIAN: unichainsepolia.GUARDIAN, + + MC_STEWARD: UNICHAIN_SEPOLIA_MC_STEWARD, + CF_STEWARD: UNICHAIN_SEPOLIA_CF_STEWARD, + IRM_STEWARD: UNICHAIN_SEPOLIA_IRM_STEWARD, + + COMPTROLLER: UNICHAIN_SEPOLIA_COMPTROLLER, +}); + +export const ZKSYNCSEPOLIA_PERMISSIONS = buildRemoteChainPermissions({ + DESTINATION_STEWARD_RECEIVER: ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + + NORMAL_TIMELOCK: zksyncsepolia.NORMAL_TIMELOCK, + FAST_TRACK_TIMELOCK: zksyncsepolia.FAST_TRACK_TIMELOCK, + CRITICAL_TIMELOCK: zksyncsepolia.CRITICAL_TIMELOCK, + GUARDIAN: zksyncsepolia.GUARDIAN, + + MC_STEWARD: ZK_SEPOLIA_MC_STEWARD, + CF_STEWARD: ZK_SEPOLIA_CF_STEWARD, + IRM_STEWARD: ZK_SEPOLIA_IRM_STEWARD, + + COMPTROLLER: ZK_SEPOLIA_COMPTROLLER, +}); + +export interface RemoteChainPermissionsConfig { + DESTINATION_STEWARD_RECEIVER: string; + + NORMAL_TIMELOCK: string; + FAST_TRACK_TIMELOCK: string; + CRITICAL_TIMELOCK: string; + GUARDIAN: string; + + MC_STEWARD: string; + CF_STEWARD: string; + IRM_STEWARD: string; + + COMPTROLLER: string; +} + +// REMOTE CHIAN PERMISSIONS +export function buildRemoteChainPermissions(chain: RemoteChainPermissionsConfig): [string, string, string][] { + return [ + // ===================== + // DRSR – setRiskParameterConfig + // ===================== + [chain.DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)", chain.NORMAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)", chain.FAST_TRACK_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setRiskParameterConfig(string,address,uint256)", chain.GUARDIAN], + + // ===================== + // DRSR – setConfigActive + // ===================== + [chain.DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)", chain.NORMAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)", chain.FAST_TRACK_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)", chain.CRITICAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setConfigActive(string,bool)", chain.GUARDIAN], + + // ===================== + // DRSR – setRemoteDelay + // ===================== + [chain.DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)", chain.NORMAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)", chain.FAST_TRACK_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setRemoteDelay(uint256)", chain.GUARDIAN], + + // ===================== + // DRSR – setWhitelistedExecutor + // ===================== + [chain.DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", chain.NORMAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", chain.FAST_TRACK_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", chain.CRITICAL_TIMELOCK], + [chain.DESTINATION_STEWARD_RECEIVER, "setWhitelistedExecutor(address,bool)", chain.GUARDIAN], + + // ===================== + // REMOTE RS – MC + // ===================== + [chain.MC_STEWARD, "setSafeDeltaBps(uint256)", chain.NORMAL_TIMELOCK], + [chain.MC_STEWARD, "setSafeDeltaBps(uint256)", chain.FAST_TRACK_TIMELOCK], + [chain.MC_STEWARD, "setSafeDeltaBps(uint256)", chain.GUARDIAN], + + // ===================== + // REMOTE RS – CF + // ===================== + [chain.CF_STEWARD, "setSafeDeltaBps(uint256)", chain.NORMAL_TIMELOCK], + [chain.CF_STEWARD, "setSafeDeltaBps(uint256)", chain.FAST_TRACK_TIMELOCK], + [chain.CF_STEWARD, "setSafeDeltaBps(uint256)", chain.GUARDIAN], + + // ===================== + // REMOTE MARKET CAP STEWARD + // ===================== + [chain.COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])", chain.MC_STEWARD], + [chain.COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])", chain.MC_STEWARD], + + // ===================== + // REMOTE CF STEWARD + // ===================== + [chain.COMPTROLLER, "setCollateralFactor(address,uint256,uint256)", chain.CF_STEWARD], + + // ===================== + // REMOTE IRM STEWARD + // ===================== + [ethers.constants.AddressZero, "setInterestRateModel(address)", chain.IRM_STEWARD], + ]; +} export const vip600 = async () => { const meta: ProposalMeta = { @@ -34,7 +258,7 @@ export const vip600 = async () => { return makeProposal( [ // RISK ORACLE - ...[bsctestnet.NORMAL_TIMELOCK].map(timelock => { + ...[bsctestnet.NORMAL_TIMELOCK, bsctestnet.GUARDIAN].map(timelock => { return { target: bsctestnet.ACCESS_CONTROL_MANAGER, signature: "giveCallPermission(address,string,address)", @@ -160,97 +384,212 @@ export const vip600 = async () => { params: [ethers.constants.AddressZero, "_setInterestRateModel(address)", IRM_STEWARD], }, - // DRSR - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { - return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [DESTINATION_RECEIVER_STEWARD, "setRiskParameterConfig(string,address,uint256)", timelock], - dstChainId: LzChainId.sepolia, - }; - }), - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK, sepolia.CRITICAL_TIMELOCK, sepolia.GUARDIAN].map( - timelock => { + // ACM ON REMOTE CHAINS + // SEPOLIA + { + target: SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, SEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.sepolia, + }, + { + target: SEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [SEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.sepolia, + }, + { + target: SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, SEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.sepolia, + }, + + // ARBITRUM_SEPOLIA + { + target: ARBITRUM_SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ARBITRUMSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUMSEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [ARBITRUMSEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: ARBITRUM_SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ARBITRUMSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.arbitrumsepolia, + }, + + // BASE_SEPOLIA + { + target: BASE_SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, BASESEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASESEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [BASESEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.basesepolia, + }, + { + target: BASE_SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, BASESEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.basesepolia, + }, + + // OPTIMISM_SEPOLIA + { + target: OP_SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, OPTEMISUMSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.opsepolia, + }, + { + target: OPTEMISUMSEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [OPSEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.opsepolia, + }, + { + target: OP_SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, OPTEMISUMSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.opsepolia, + }, + + // UNICHAIN_SEPOLIA + { + target: UNICHAIN_SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, UNICHAINSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAINSEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [UNICHAINSEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: UNICHAIN_SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, UNICHAINSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.unichainsepolia, + }, + + // ZKSYNC_SEPOLIA + { + target: ZK_SEPOLIA_ACM, + signature: "grantRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZKSYNCSEPOLIA_ACM_AGGREGATOR, + signature: "executeGrantPermissions(uint256)", + params: [ZKSYNCSEPOLIA_ACM_AGR_INDEX], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: ZK_SEPOLIA_ACM, + signature: "revokeRole(bytes32,address)", + params: [DEFAULT_ADMIN_ROLE, ZKSYNCSEPOLIA_ACM_AGGREGATOR], + dstChainId: LzChainId.zksyncsepolia, + }, + + // accept ownerships + // SEPOLIA + ...[SEPOLIA_DESTINATION_STEWARD_RECEIVER, SEPOLIA_MC_STEWARD, SEPOLIA_CF_STEWARD, SEPOLIA_IRM_STEWARD].map( + target => { return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [DESTINATION_RECEIVER_STEWARD, "setConfigActive(string,bool)", timelock], + target, + signature: "acceptOwnership()", + params: [], dstChainId: LzChainId.sepolia, }; }, ), - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + + // ARBITRUM_SEPOLIA + ...[ + ARBITRUM_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ARBITRUM_SEPOLIA_MC_STEWARD, + ARBITRUM_SEPOLIA_CF_STEWARD, + ARBITRUM_SEPOLIA_IRM_STEWARD, + ].map(target => { return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [DESTINATION_RECEIVER_STEWARD, "setRemoteDelay(uint256)", timelock], - dstChainId: LzChainId.sepolia, + target, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.arbitrumsepolia, }; }), - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK, sepolia.CRITICAL_TIMELOCK, sepolia.GUARDIAN].map( - timelock => { - return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [DESTINATION_RECEIVER_STEWARD, "setWhitelistedExecutor(address,bool)", timelock], - dstChainId: LzChainId.sepolia, - }; - }, - ), - // REMOTE RS - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + // BASE_SEPOLIA + ...[ + BASE_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + BASE_SEPOLIA_MC_STEWARD, + BASE_SEPOLIA_CF_STEWARD, + BASE_SEPOLIA_IRM_STEWARD, + ].map(target => { return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [SEPOLIA_MC_STEWARD, "setSafeDeltaBps(uint256)", timelock], - dstChainId: LzChainId.sepolia, + target, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.basesepolia, }; }), - ...[sepolia.NORMAL_TIMELOCK, sepolia.FAST_TRACK_TIMELOCK].map(timelock => { + + // OPTIMISM_SEPOLIA + ...[ + OP_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + OP_SEPOLIA_MC_STEWARD, + OP_SEPOLIA_CF_STEWARD, + OP_SEPOLIA_IRM_STEWARD, + ].map(target => { return { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [SEPOLIA_CF_STEWARD, "setSafeDeltaBps(uint256)", timelock], - dstChainId: LzChainId.sepolia, + target, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.opsepolia, }; }), - // REMOTE MARKETCAP_STEWARD - { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [SEPOLIA_COMPTROLLER, "setMarketBorrowCaps(address[],uint256[])", SEPOLIA_MC_STEWARD], - dstChainId: LzChainId.sepolia, - }, - { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [SEPOLIA_COMPTROLLER, "setMarketSupplyCaps(address[],uint256[])", SEPOLIA_MC_STEWARD], - dstChainId: LzChainId.sepolia, - }, - // REMOTE CF_STEWARD - { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [SEPOLIA_COMPTROLLER, "setCollateralFactor(address,uint256,uint256)", SEPOLIA_CF_STEWARD], - dstChainId: LzChainId.sepolia, - }, - // REMOTE IRM_STEWARD - { - target: SEPOLIA_ACM, - signature: "giveCallPermission(address,string,address)", - params: [ethers.constants.AddressZero, "setInterestRateModel(address)", SEPOLIA_IRM_STEWARD], - dstChainId: LzChainId.sepolia, - }, + // UNICHAIN_SEPOLIA + ...[ + UNICHAIN_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + UNICHAIN_SEPOLIA_MC_STEWARD, + UNICHAIN_SEPOLIA_CF_STEWARD, + UNICHAIN_SEPOLIA_IRM_STEWARD, + ].map(target => { + return { + target, + signature: "acceptOwnership()", + params: [], + dstChainId: LzChainId.unichainsepolia, + }; + }), - // accept ownerships - ...[DESTINATION_RECEIVER_STEWARD, SEPOLIA_MC_STEWARD, SEPOLIA_CF_STEWARD, SEPOLIA_IRM_STEWARD].map(target => { + // ZKSYNC_SEPOLIA + ...[ + ZK_SEPOLIA_DESTINATION_STEWARD_RECEIVER, + ZK_SEPOLIA_MC_STEWARD, + ZK_SEPOLIA_CF_STEWARD, + ZK_SEPOLIA_IRM_STEWARD, + ].map(target => { return { target, signature: "acceptOwnership()", params: [], - dstChainId: LzChainId.sepolia, + dstChainId: LzChainId.zksyncsepolia, }; }),