diff --git a/simulations/vip-544/abi/AccessControlManager.json b/simulations/vip-544/abi/AccessControlManager.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/simulations/vip-544/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-544/abi/Comproller.json b/simulations/vip-544/abi/Comproller.json new file mode 100644 index 000000000..9b9336f70 --- /dev/null +++ b/simulations/vip-544/abi/Comproller.json @@ -0,0 +1,3091 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum ComptrollerTypes.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": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowDelegatedBorrows", + "type": "bool" + } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DistributedVAIVaultVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledForUserUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": 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": "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": 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": "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 PriceOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract PriceOracle", + "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": "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": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusSupplySpeedUpdated", + "type": "event" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_grantXVS", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "_setAccessControl", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum ComptrollerTypes.Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "_setActionsPaused", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "_setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "_setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptrollerLens_", + "type": "address" + } + ], + "name": "_setComptrollerLens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidationForUser", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "_setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newLiquidatorContract_", + "type": "address" + } + ], + "name": "_setLiquidatorContract", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketBorrowCaps", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketSupplyCaps", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "_setPauseGuardian", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract PriceOracle", + "name": "newOracle", + "type": "address" + } + ], + "name": "_setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "_setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "_setProtocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "vaiController_", + "type": "address" + } + ], + "name": "_setVAIController", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "_setVAIMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReleaseAmount_", + "type": "uint256" + } + ], + "name": "_setVAIVaultInfo", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "_setVenusSpeeds", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "venusVAIVaultRate_", + "type": "uint256" + } + ], + "name": "_setVenusVAIVaultRate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "_supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerTypes.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowVerify", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimVenus", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenus", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenusAsCollateral", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getXVSAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getXVSVTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract PriceOracle", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setMintedVAIOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowBorrows", + "type": "bool" + } + ], + "name": "updateDelegate", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "venusInitialIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-544/abi/Diamond.json b/simulations/vip-544/abi/Diamond.json new file mode 100644 index 000000000..3c6f08008 --- /dev/null +++ b/simulations/vip-544/abi/Diamond.json @@ -0,0 +1,957 @@ +[ + { + "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" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "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": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "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" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract PriceOracle", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-544/abi/IsolatedPoolComptroller.json b/simulations/vip-544/abi/IsolatedPoolComptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/simulations/vip-544/abi/IsolatedPoolComptroller.json @@ -0,0 +1,1496 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "poolRegistry_", + "type": "address" + }, + { + "internalType": "address", + "name": "accessControl_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "ActionPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedLessThanOrEqualTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { + "inputs": [], + "name": "ComptrollerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralToSeize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableCollateral", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientShortfall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCollateralFactor", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLiquidationThreshold", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedGreaterThan", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { + "inputs": [], + "name": "NonzeroBorrowBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PriceError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "TooMuchRepay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedSender", + "type": "address" + }, + { + "internalType": "address", + "name": "actualSender", + "type": "address" + } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinLiquidatableCollateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardsDistributor", + "type": "address" + } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControl", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RewardsDistributor", + "name": "_rewardsDistributor", + "type": "address" + } + ], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [ + { + "internalType": "contract RewardsDistributor[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "supplySpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowSpeed", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isDeprecated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract VToken", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensToSeize", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract PriceOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "skipLiquidityCheck", + "type": "bool" + } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "seizerContract", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "marketsList", + "type": "address[]" + }, + { + "internalType": "enum ComptrollerStorage.Action[]", + "name": "actionsList", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PriceOracle", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-544/abi/OmnichainGovernanceExecutor.json b/simulations/vip-544/abi/OmnichainGovernanceExecutor.json new file mode 100644 index 000000000..b40c3cf44 --- /dev/null +++ b/simulations/vip-544/abi/OmnichainGovernanceExecutor.json @@ -0,0 +1,539 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "endpoint_", "type": "address" }, + { "internalType": "address", "name": "guardian_", "type": "address" }, + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { "inputs": [], "name": "InvalidProposalId", "type": "error" }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "_payload", "type": "bytes" }, + { "indexed": false, "internalType": "bytes", "name": "_reason", "type": "bytes" } + ], + "name": "MessageFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldGuardian", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newGuardian", "type": "address" } + ], + "name": "NewGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "eta", "type": "uint256" } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, + { "indexed": false, "internalType": "address[]", "name": "targets", "type": "address[]" }, + { "indexed": false, "internalType": "uint256[]", "name": "values", "type": "uint256[]" }, + { "indexed": false, "internalType": "string[]", "name": "signatures", "type": "string[]" }, + { "indexed": false, "internalType": "bytes[]", "name": "calldatas", "type": "bytes[]" }, + { "indexed": false, "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "name": "ProposalReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "srcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "bytes", "name": "srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes", "name": "reason", "type": "bytes" } + ], + "name": "ReceivePayloadFailed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "indexed": false, "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "indexed": false, "internalType": "bytes32", "name": "_payloadHash", "type": "bytes32" } + ], + "name": "RetryMessageSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMaxLimit", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMaxLimit", "type": "uint256" } + ], + "name": "SetMaxDailyReceiveLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "indexed": false, "internalType": "uint16", "name": "_type", "type": "uint16" }, + { "indexed": false, "internalType": "uint256", "name": "_minDstGas", "type": "uint256" } + ], + "name": "SetMinDstGas", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "precrime", "type": "address" }], + "name": "SetPrecrime", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "uint16", "name": "oldSrcChainId", "type": "uint16" }, + { "indexed": true, "internalType": "uint16", "name": "newSrcChainId", "type": "uint16" } + ], + "name": "SetSrcChainId", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "", "type": "address" }, + { "indexed": false, "internalType": "uint8", "name": "", "type": "uint8" } + ], + "name": "SetTimelockPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "SetTrustedRemote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "indexed": false, "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "SetTrustedRemoteAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint8", "name": "routeType", "type": "uint8" }, + { "indexed": true, "internalType": "address", "name": "oldTimelock", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newTimelock", "type": "address" } + ], + "name": "TimelockAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_PAYLOAD_SIZE_LIMIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "contract ITimelock[]", "name": "timelocks_", "type": "address[]" }], + "name": "addTimelocks", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "cancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "execute", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "bytes", "name": "", "type": "bytes" }, + { "internalType": "uint64", "name": "", "type": "uint64" } + ], + "name": "failedMessages", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "forceResumeReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" } + ], + "name": "getConfig", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }], + "name": "getTrustedRemoteAddress", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "guardian", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" } + ], + "name": "isTrustedRemote", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourCommandsReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "last24HourReceiveWindowStart", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastProposalReceived", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lzEndpoint", + "outputs": [{ "internalType": "contract ILayerZeroEndpoint", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxDailyReceiveLimit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "", "type": "uint16" }, + { "internalType": "uint16", "name": "", "type": "uint16" } + ], + "name": "minDstGasLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_srcChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_srcAddress", "type": "bytes" }, + { "internalType": "uint64", "name": "_nonce", "type": "uint64" }, + { "internalType": "bytes", "name": "_payload", "type": "bytes" } + ], + "name": "nonblockingLzReceive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "payloadSizeLimitLookup", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "precrime", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposalTimelocks", + "outputs": [{ "internalType": "contract ITimelock", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "proposals", + "outputs": [ + { "internalType": "uint256", "name": "id", "type": "uint256" }, + { "internalType": "uint256", "name": "eta", "type": "uint256" }, + { "internalType": "bool", "name": "canceled", "type": "bool" }, + { "internalType": "bool", "name": "executed", "type": "bool" }, + { "internalType": "uint8", "name": "proposalType", "type": "uint8" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "queued", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }, + { "internalType": "bytes", "name": "srcAddress_", "type": "bytes" }, + { "internalType": "uint64", "name": "nonce_", "type": "uint64" }, + { "internalType": "bytes", "name": "payload_", "type": "bytes" } + ], + "name": "retryMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_version", "type": "uint16" }, + { "internalType": "uint16", "name": "_chainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_configType", "type": "uint256" }, + { "internalType": "bytes", "name": "_config", "type": "bytes" } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newGuardian", "type": "address" }], + "name": "setGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "limit_", "type": "uint256" }], + "name": "setMaxDailyReceiveLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint16", "name": "_packetType", "type": "uint16" }, + { "internalType": "uint256", "name": "_minGas", "type": "uint256" } + ], + "name": "setMinDstGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_dstChainId", "type": "uint16" }, + { "internalType": "uint256", "name": "_size", "type": "uint256" } + ], + "name": "setPayloadSizeLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_precrime", "type": "address" }], + "name": "setPrecrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setReceiveVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "_version", "type": "uint16" }], + "name": "setSendVersion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "srcChainId_", "type": "uint16" }], + "name": "setSrcChainId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "pendingAdmin_", "type": "address" }, + { "internalType": "uint8", "name": "proposalType_", "type": "uint8" } + ], + "name": "setTimelockPendingAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_path", "type": "bytes" } + ], + "name": "setTrustedRemote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint16", "name": "_remoteChainId", "type": "uint16" }, + { "internalType": "bytes", "name": "_remoteAddress", "type": "bytes" } + ], + "name": "setTrustedRemoteAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "srcChainId", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "proposalId_", "type": "uint256" }], + "name": "state", + "outputs": [{ "internalType": "enum OmnichainGovernanceExecutor.ProposalState", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "name": "trustedRemoteLookup", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/simulations/vip-544/abi/VenusRiskStewardReceiver.json b/simulations/vip-544/abi/VenusRiskStewardReceiver.json new file mode 100644 index 000000000..ecdc55c4b --- /dev/null +++ b/simulations/vip-544/abi/VenusRiskStewardReceiver.json @@ -0,0 +1,645 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "ConfigAlreadyProcessed", + "type": "error" + }, + { + "inputs": [], + "name": "ConfigNotActive", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDebounce", + "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": "UpdateTooFrequent", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "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": "RiskParameterConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "RiskParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ToggleConfigActive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "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": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "marketUpdateType", + "type": "bytes" + } + ], + "name": "lastProcessedTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "processUpdateById", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "processUpdateByParameterAndMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "updateId", + "type": "uint256" + } + ], + "name": "processedUpdates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "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": "address", + "name": "riskSteward", + "type": "address" + }, + { + "internalType": "uint256", + "name": "debounce", + "type": "uint256" + } + ], + "name": "setRiskParameterConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "updateType", + "type": "string" + } + ], + "name": "toggleConfigActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } +] diff --git a/simulations/vip-544/arbitrumsepolia.ts b/simulations/vip-544/arbitrumsepolia.ts new file mode 100644 index 000000000..b4078e94f --- /dev/null +++ b/simulations/vip-544/arbitrumsepolia.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip544, { + ACCESS_CONTROL_MANAGER_ARBITRUMSEPOLIA, + ANY_TARGET_CONTRACT, + MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA, +} from "../../vips/vip-544/bsctestnet1"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { arbitrumsepolia } = NETWORK_ADDRESSES; + +forking(138822251, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_ARBITRUMSEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x006D44b6f5927b3eD83bD0c1C36Fb1A3BaCaC208", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + arbitrumsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA)) + .setMarketSupplyCaps(["0xdEFbf0F9Ab6CdDd0a1FdDC894b358D0c0a39B052"], ["160000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA)) + .setMarketBorrowCaps(["0xdEFbf0F9Ab6CdDd0a1FdDC894b358D0c0a39B052"], ["150000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/basesepolia.ts b/simulations/vip-544/basesepolia.ts new file mode 100644 index 000000000..fe6fdd4cc --- /dev/null +++ b/simulations/vip-544/basesepolia.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { ANY_TARGET_CONTRACT } from "../../vips/vip-544/bsctestnet1"; +import vip544, { + ACCESS_CONTROL_MANAGER_BASESEPOLIA, + MARKET_CAP_RISK_STEWARD_BASESEPOLIA, +} from "../../vips/vip-544/bsctestnet2"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { basesepolia } = NETWORK_ADDRESSES; + +forking(23964088, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_BASESEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x272795dd6c5355CF25765F36043F34014454Eb5b", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + basesepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_BASESEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_BASESEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_BASESEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_BASESEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BASESEPOLIA)) + .setMarketSupplyCaps(["0xA31D67c056Aadc2501535f2776bF1157904f810e"], ["180000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BASESEPOLIA)) + .setMarketBorrowCaps(["0xA31D67c056Aadc2501535f2776bF1157904f810e"], ["150000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/bscmainnet.ts b/simulations/vip-544/bscmainnet.ts new file mode 100644 index 000000000..d9bf7f0a5 --- /dev/null +++ b/simulations/vip-544/bscmainnet.ts @@ -0,0 +1,277 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { parseUnits } from "@ethersproject/units"; +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip544, { + MARKET_CAP_RISK_STEWARD_BSCMAINNET, + RISK_STEWARD_RECEIVER_BSCMAINNET, +} from "../../vips/vip-544/bscmainnet"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import COMPTROLLER_ABI from "./abi/Comproller.json"; +import DIAMOND_ABI from "./abi/Diamond.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { bscmainnet } = NETWORK_ADDRESSES; + +const OLD_SETTER_FACET = "0x9B0D9D7c50d90f23449c4BbCAA671Ce7cd19DbCf"; +const OLD_MARKET_FACET = "0x4b093a3299F39615bA6b34B7897FDedCe7b83D63"; +const OLD_POLICY_FACET = "0x93e7Ff7c87B496aE76fFb22d437c9d46461A9B51"; + +const NEW_SETTER_FACET = "0x9D1fdD581Bd6E638A7b98ac5567248A0c4E88f64"; +const NEW_MARKET_FACET = "0x94573965fbCCAC5cD4558208A8cCB3F18E71B7Db"; +const NEW_POLICY_FACET = "0x5bb2Dfe996629E558Cd5BDBfC4c0eC7367BB96E9"; + +const UNCHANGED_REWARD_FACET = "0xc2F6bDCEa4907E8CB7480d3d315bc01c125fb63C"; + +const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; + +forking(61240501, async () => { + const provider = ethers.provider; + let unitroller: Contract; + let acm: Contract; + let isolatedPoolComptroller: Contract; + + let marketFacetFunctionSelectors: string[]; + let policyFacetFunctionSelectors: string[]; + let rewardFacetFuntionSelectors: string[]; + let setterFacetFuntionSelectors: string[]; + + before(async () => { + unitroller = new ethers.Contract(bscmainnet.UNITROLLER, COMPTROLLER_ABI, provider); + rewardFacetFuntionSelectors = await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET); + setterFacetFuntionSelectors = await unitroller.facetFunctionSelectors(OLD_SETTER_FACET); + marketFacetFunctionSelectors = await unitroller.facetFunctionSelectors(OLD_MARKET_FACET); + policyFacetFunctionSelectors = await unitroller.facetFunctionSelectors(OLD_POLICY_FACET); + + acm = new ethers.Contract(bscmainnet.ACCESS_CONTROL_MANAGER, ACCESS_CONTROL_MANAGER_ABI, provider); + isolatedPoolComptroller = new ethers.Contract( + "0x1b43ea8622e76627B81665B1eCeBB4867566B963", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + }); + + describe("Pre-VIP behaviour", async () => { + it("market facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal(marketFacetFunctionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal(policyFacetFunctionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal(setterFacetFuntionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET)).to.deep.equal( + rewardFacetFuntionSelectors, + ); + }); + + it("unitroller should contain only old facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_MARKET_FACET); + expect(await unitroller.facetAddresses()).to.include(UNCHANGED_REWARD_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(NEW_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.not.include(NEW_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.not.include(NEW_MARKET_FACET); + }); + + it("normal timelock is not owner of risk steward receiver", async () => { + const riskStewardReceiver = new ethers.Contract( + RISK_STEWARD_RECEIVER_BSCMAINNET, + VENUS_RISK_STEWARD_RECEIVER_ABI, + provider, + ); + expect(await riskStewardReceiver.owner()).to.not.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("normal timelock is not owner of market cap risk steward", async () => { + const marketCapRiskSteward = new ethers.Contract( + MARKET_CAP_RISK_STEWARD_BSCMAINNET, + VENUS_RISK_STEWARD_RECEIVER_ABI, + provider, + ); + expect(await marketCapRiskSteward.owner()).to.not.equal(bscmainnet.NORMAL_TIMELOCK); + }); + }); + + testVip("vip-544", await vip544(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents( + txResponse, + [DIAMOND_ABI, ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["DiamondCut", "RiskParameterConfigSet", "RoleGranted"], + [1, 2, 17], + ); + }, + }); + + describe("Post-VIP behavior", async () => { + it("market facet function selectors should be updated for new facet address", async () => { + const newMarketFacetFunctionSelectors = ["0x3d98a1e5", "0xcab4f84c"]; + + const expectSelectors = [...marketFacetFunctionSelectors, ...newMarketFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be updated for new facet address", async () => { + const newPolicyFacetFunctionSelectors = ["0x528a174c"]; + + const expectSelectors = [...policyFacetFunctionSelectors, ...newPolicyFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be updated for new facet address", async () => { + const newSetterFacetFunctionSelectors = [ + "0x8b3113f6", + "0xc32094c7", + "0x24aaa220", + "0xd136af44", + "0x186db48f", + "0xa8431081", + "0x5cc4fdeb", + "0x12348e96", + "0x530e784f", + ]; + + const expectSelectors = [...setterFacetFuntionSelectors, ...newSetterFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should not be changed", async () => { + expect(await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET)).to.deep.equal( + rewardFacetFuntionSelectors, + ); + }); + + it("unitroller should contain the new and old facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_MARKET_FACET); + expect(await unitroller.facetAddresses()).to.include(UNCHANGED_REWARD_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(OLD_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_MARKET_FACET); + }); + + it("grants Market Cap Risk Steward permissions to call setMarketSupplyCaps and setMarketBorrowCaps on any target contract (Isolated Pools)", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [DEFAULT_ADMIN_ROLE, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_BSCMAINNET)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [DEFAULT_ADMIN_ROLE, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_BSCMAINNET)).to.be.true; + }); + + it("does not grant permissions for Market Cap Risk Steward to call CORE pool comptlorer", async () => { + const supplyCapCorePoolRole = ethers.utils.solidityPack( + ["address", "string"], + [bscmainnet.UNITROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapCorePoolRoleHash = ethers.utils.keccak256(supplyCapCorePoolRole); + expect(await acm.hasRole(supplyCapCorePoolRoleHash, MARKET_CAP_RISK_STEWARD_BSCMAINNET)).to.be.false; + + const borrowCapCorePoolRole = ethers.utils.solidityPack( + ["address", "string"], + [bscmainnet.UNITROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapCorePoolRoleHash = ethers.utils.keccak256(borrowCapCorePoolRole); + expect(await acm.hasRole(borrowCapCorePoolRoleHash, MARKET_CAP_RISK_STEWARD_BSCMAINNET)).to.be.false; + }); + + it("grants timelocks and guardian permissions to pause and unpause Risk Steward Receiver", async () => { + const pauseRole = ethers.utils.solidityPack(["address", "string"], [RISK_STEWARD_RECEIVER_BSCMAINNET, "pause()"]); + const pauseRoleHash = ethers.utils.keccak256(pauseRole); + expect(await acm.hasRole(pauseRoleHash, bscmainnet.GUARDIAN)).to.be.true; + expect(await acm.hasRole(pauseRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(pauseRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(pauseRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + + const unpauseRole = ethers.utils.solidityPack( + ["address", "string"], + [RISK_STEWARD_RECEIVER_BSCMAINNET, "unpause()"], + ); + const unpauseRoleHash = ethers.utils.keccak256(unpauseRole); + expect(await acm.hasRole(unpauseRoleHash, bscmainnet.GUARDIAN)).to.be.true; + expect(await acm.hasRole(unpauseRoleHash, bscmainnet.NORMAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(unpauseRoleHash, bscmainnet.CRITICAL_TIMELOCK)).to.be.true; + expect(await acm.hasRole(unpauseRoleHash, bscmainnet.FAST_TRACK_TIMELOCK)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_BSCMAINNET); + await setBalance(MARKET_CAP_RISK_STEWARD_BSCMAINNET, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSCMAINNET)) + .setMarketSupplyCaps(["0xef470AbC365F88e4582D8027172a392C473A5B53"], ["150000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSCMAINNET)) + .setMarketBorrowCaps(["0xef470AbC365F88e4582D8027172a392C473A5B53"], ["55000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + + it("normal timelock is owner of risk steward receiver", async () => { + const riskStewardReceiver = new ethers.Contract( + RISK_STEWARD_RECEIVER_BSCMAINNET, + VENUS_RISK_STEWARD_RECEIVER_ABI, + provider, + ); + expect(await riskStewardReceiver.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("normal timelock is owner of market cap risk steward", async () => { + const marketCapRiskSteward = new ethers.Contract( + MARKET_CAP_RISK_STEWARD_BSCMAINNET, + VENUS_RISK_STEWARD_RECEIVER_ABI, + provider, + ); + expect(await marketCapRiskSteward.owner()).to.equal(bscmainnet.NORMAL_TIMELOCK); + }); + + it("Risk Steward Receiver should be paused", async () => { + const riskStewardReceiver = new ethers.Contract( + RISK_STEWARD_RECEIVER_BSCMAINNET, + VENUS_RISK_STEWARD_RECEIVER_ABI, + provider, + ); + expect(await riskStewardReceiver.paused()).to.be.true; + }); + }); +}); diff --git a/simulations/vip-544/bsctestnet-addendum.ts b/simulations/vip-544/bsctestnet-addendum.ts new file mode 100644 index 000000000..53d664cac --- /dev/null +++ b/simulations/vip-544/bsctestnet-addendum.ts @@ -0,0 +1,135 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { vip544_Addendum } from "./../../vips/vip-544/bsctestnet-addendum"; +import COMPTROLLER_ABI from "./abi/Comproller.json"; +import DIAMOND_ABI from "./abi/Diamond.json"; + +const { bsctestnet } = NETWORK_ADDRESSES; + +const OLD_SETTER_FACET = "0x490DFD07f592452307817C4283866035BDb3b275"; +const OLD_MARKET_FACET = "0x00a949FfDa9B216fBA9C4E5b40ef561Af0FDb723"; +const OLD_POLICY_FACET = "0x085C8d0133291348004AabFfbE7CAc2097aF2aa1"; + +const NEW_SETTER_FACET = "0xb619F7ce96c0a6E3F0b44e993f663522F79f294A"; +const NEW_MARKET_FACET = "0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd"; +const NEW_POLICY_FACET = "0x671B787AEDB6769972f081C6ee4978146F7D92E6"; + +const UNCHANGED_REWARD_FACET = "0x905006DCD5DbAa9B67359bcB341a0C49AfC8d0A6"; + +forking(56931937, async () => { + const provider = ethers.provider; + let unitroller: Contract; + let marketFacetFunctionSelectors: string[]; + let policyFacetFunctionSelectors: string[]; + let rewardFacetFuntionSelectors: string[]; + let setterFacetFuntionSelectors: string[]; + + before(async () => { + unitroller = new ethers.Contract(bsctestnet.UNITROLLER, COMPTROLLER_ABI, provider); + rewardFacetFuntionSelectors = await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET); + setterFacetFuntionSelectors = await unitroller.facetFunctionSelectors(OLD_SETTER_FACET); + marketFacetFunctionSelectors = await unitroller.facetFunctionSelectors(OLD_MARKET_FACET); + policyFacetFunctionSelectors = await unitroller.facetFunctionSelectors(OLD_POLICY_FACET); + }); + + describe("Pre-VIP behaviour", async () => { + it("market facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal(marketFacetFunctionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal(policyFacetFunctionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal(setterFacetFuntionSelectors); + expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should be correct", async () => { + expect(await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET)).to.deep.equal( + rewardFacetFuntionSelectors, + ); + }); + + it("unitroller should contain only old facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_MARKET_FACET); + expect(await unitroller.facetAddresses()).to.include(UNCHANGED_REWARD_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(NEW_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.not.include(NEW_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.not.include(NEW_MARKET_FACET); + }); + }); + + testVip("vip-544-addendum", await vip544_Addendum(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents(txResponse, [DIAMOND_ABI], ["DiamondCut"], [1]); + }, + }); + + describe("Post-VIP behavior", async () => { + it("market facet function selectors should be updated for new facet address", async () => { + const newMarketFacetFunctionSelectors = ["0x3d98a1e5", "0xcab4f84c"]; + + const expectSelectors = [...marketFacetFunctionSelectors, ...newMarketFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be updated for new facet address", async () => { + const newPolicyFacetFunctionSelectors = ["0x528a174c"]; + + const expectSelectors = [...policyFacetFunctionSelectors, ...newPolicyFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be updated for new facet address", async () => { + const newSetterFacetFunctionSelectors = [ + "0x8b3113f6", + "0xc32094c7", + "0x24aaa220", + "0xd136af44", + "0x186db48f", + "0xa8431081", + "0x5cc4fdeb", + "0x12348e96", + "0x530e784f", + ]; + + const expectSelectors = [...setterFacetFuntionSelectors, ...newSetterFacetFunctionSelectors].sort(); + const updatedSelectors = [...(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET))].sort(); + + expect(updatedSelectors).to.deep.equal(expectSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should not be changed", async () => { + expect(await unitroller.facetFunctionSelectors(UNCHANGED_REWARD_FACET)).to.deep.equal( + rewardFacetFuntionSelectors, + ); + }); + + it("unitroller should contain the new and old facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET, OLD_SETTER_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_POLICY_FACET, OLD_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_MARKET_FACET, OLD_MARKET_FACET); + expect(await unitroller.facetAddresses()).to.include(UNCHANGED_REWARD_FACET); + }); + }); +}); diff --git a/simulations/vip-544/bsctestnet.ts b/simulations/vip-544/bsctestnet.ts new file mode 100644 index 000000000..a1b65cc94 --- /dev/null +++ b/simulations/vip-544/bsctestnet.ts @@ -0,0 +1,104 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import vip544, { + ACCESS_CONTROL_MANAGER_BSC_TESTNET, + ANY_TARGET_CONTRACT, + BSC_TESTNET_CORE_COMPTROLLER, + MARKET_CAP_RISK_STEWARD_BSC_TESTNET, + NORMAL_TIMELOCK_BSC_TESTNET, +} from "../../vips/vip-544/bsctestnet1"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import COMPTROLLER_ABI from "./abi/Comproller.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +forking(48650752, async () => { + const provider = ethers.provider; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_BSC_TESTNET, ACCESS_CONTROL_MANAGER_ABI, provider); + const comptroller = new ethers.Contract(BSC_TESTNET_CORE_COMPTROLLER, COMPTROLLER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x1F4f0989C51f12DAcacD4025018176711f3Bf289", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + await setBalance(NORMAL_TIMELOCK_BSC_TESTNET, parseUnits("1000000", 18)); + await setBalance("0xCfD34AEB46b1CB4779c945854d405E91D27A1899", parseUnits("1000000", 18)); + }); + + testVip("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [18, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_BSC_TESTNET)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketBorrowCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_BSC_TESTNET)).to.be.true; + + const supplyCapCorePoolRole = ethers.utils.solidityPack( + ["address", "string"], + [BSC_TESTNET_CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapCorePoolRoleHash = ethers.utils.keccak256(supplyCapCorePoolRole); + expect(await acm.hasRole(supplyCapCorePoolRoleHash, MARKET_CAP_RISK_STEWARD_BSC_TESTNET)).to.be.true; + + const borrowCapCorePoolRole = ethers.utils.solidityPack( + ["address", "string"], + [BSC_TESTNET_CORE_COMPTROLLER, "_setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapCorePoolRoleHash = ethers.utils.keccak256(borrowCapCorePoolRole); + expect(await acm.hasRole(borrowCapCorePoolRoleHash, MARKET_CAP_RISK_STEWARD_BSC_TESTNET)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_BSC_TESTNET); + await setBalance(MARKET_CAP_RISK_STEWARD_BSC_TESTNET, parseUnits("1000000", 18)); + await expect( + comptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSC_TESTNET)) + ._setMarketSupplyCaps(["0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6"], ["150000000000000000000000"]), + ).to.emit(comptroller, "NewSupplyCap"); + await expect( + comptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSC_TESTNET)) + ._setMarketBorrowCaps(["0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6"], ["55000000000000000000000"]), + ).to.emit(comptroller, "NewBorrowCap"); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSC_TESTNET)) + .setMarketSupplyCaps(["0xef470AbC365F88e4582D8027172a392C473A5B53"], ["150000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_BSC_TESTNET)) + .setMarketBorrowCaps(["0xef470AbC365F88e4582D8027172a392C473A5B53"], ["55000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/opbnbtestnet.ts b/simulations/vip-544/opbnbtestnet.ts new file mode 100644 index 000000000..6160e76b3 --- /dev/null +++ b/simulations/vip-544/opbnbtestnet.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip544, { + ACCESS_CONTROL_MANAGER_OPBNBTESTNET, + ANY_TARGET_CONTRACT, + MARKET_CAP_RISK_STEWARD_OPBNBTESTNET, +} from "../../vips/vip-544/bsctestnet1"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { opbnbtestnet } = NETWORK_ADDRESSES; + +forking(56951686, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_OPBNBTESTNET, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x2FCABb31E57F010D623D8d68e1E18Aed11d5A388", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + opbnbtestnet.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_OPBNBTESTNET)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_OPBNBTESTNET)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_OPBNBTESTNET); + await setBalance(MARKET_CAP_RISK_STEWARD_OPBNBTESTNET, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_OPBNBTESTNET)) + .setMarketSupplyCaps(["0xe3923805f6E117E51f5387421240a86EF1570abC"], ["15000000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_OPBNBTESTNET)) + .setMarketBorrowCaps(["0xe3923805f6E117E51f5387421240a86EF1570abC"], ["9500000000000000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/opsepolia.ts b/simulations/vip-544/opsepolia.ts new file mode 100644 index 000000000..458bdb021 --- /dev/null +++ b/simulations/vip-544/opsepolia.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { ANY_TARGET_CONTRACT } from "../../vips/vip-544/bsctestnet1"; +import vip544, { + ACCESS_CONTROL_MANAGER_OPSEPOLIA, + MARKET_CAP_RISK_STEWARD_OPSEPOLIA, +} from "../../vips/vip-544/bsctestnet2"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { opsepolia } = NETWORK_ADDRESSES; + +forking(25946983, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_OPSEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x59d10988974223B042767aaBFb6D926863069535", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + opsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_OPSEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_OPSEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_OPSEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_OPSEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_OPSEPOLIA)) + .setMarketSupplyCaps(["0x2419606690B08060ebFd7581e0a6Ae45f1915ee9"], ["180000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_OPSEPOLIA)) + .setMarketBorrowCaps(["0x2419606690B08060ebFd7581e0a6Ae45f1915ee9"], ["150000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/sepolia.ts b/simulations/vip-544/sepolia.ts new file mode 100644 index 000000000..af9707573 --- /dev/null +++ b/simulations/vip-544/sepolia.ts @@ -0,0 +1,94 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import vip544, { + ACCESS_CONTROL_MANAGER_SEPOLIA, + ANY_TARGET_CONTRACT, + MARKET_CAP_RISK_STEWARD_SEPOLIA, +} from "../../vips/vip-544/bsctestnet1"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { sepolia } = NETWORK_ADDRESSES; + +forking(8043152, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_SEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0x7Aa39ab4BcA897F403425C9C6FDbd0f882Be0D70", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract(sepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, provider); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_SEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_SEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_SEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_SEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_SEPOLIA)) + .setMarketSupplyCaps(["0x19252AFD0B2F539C400aEab7d460CBFbf74c17ff"], ["160000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_SEPOLIA)) + .setMarketBorrowCaps(["0x19252AFD0B2F539C400aEab7d460CBFbf74c17ff"], ["150000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/unichainsepolia.ts b/simulations/vip-544/unichainsepolia.ts new file mode 100644 index 000000000..fec5b12f6 --- /dev/null +++ b/simulations/vip-544/unichainsepolia.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { ANY_TARGET_CONTRACT } from "../../vips/vip-544/bsctestnet1"; +import vip544, { + ACCESS_CONTROL_MANAGER_UNICHAINSEPOLIA, + MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA, +} from "../../vips/vip-544/bsctestnet2"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { unichainsepolia } = NETWORK_ADDRESSES; + +forking(16844634, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_UNICHAINSEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0xFeD3eAA668a6179c9E5E1A84e3A7d6883F06f7c1", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + unichainsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA)) + .setMarketSupplyCaps(["0x2d8814e1358D71B6B271295893F7409E3127CBBf"], ["25000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA)) + .setMarketBorrowCaps(["0x2d8814e1358D71B6B271295893F7409E3127CBBf"], ["19000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/simulations/vip-544/utils/cur-params-bscmainnet.json b/simulations/vip-544/utils/cur-params-bscmainnet.json new file mode 100644 index 000000000..1020370a7 --- /dev/null +++ b/simulations/vip-544/utils/cur-params-bscmainnet.json @@ -0,0 +1,91 @@ +{ + "cutParams": [ + [ + "0x94573965fbCCAC5cD4558208A8cCB3F18E71B7Db", + 1, + [ + "0xa76b3fda", + "0x929fe9a1", + "0xc2998238", + "0xede4edd0", + "0xb0772d0b", + "0xabfceffc", + "0x007e3dd2", + "0xc488847b", + "0xa78dc775", + "0x0686dab6", + "0xddbf54fd", + "0xc5b4db55" + ] + ], + ["0x94573965fbCCAC5cD4558208A8cCB3F18E71B7Db", 0, ["0x3d98a1e5", "0xcab4f84c"]], + [ + "0x5bb2Dfe996629E558Cd5BDBfC4c0eC7367BB96E9", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ], + ["0x5bb2Dfe996629E558Cd5BDBfC4c0eC7367BB96E9", 0, ["0x528a174c"]], + [ + "0x9D1fdD581Bd6E638A7b98ac5567248A0c4E88f64", + 1, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0xe4028eee", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0x4fd42e17", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0xfd51a3ad" + ] + ], + [ + "0x9D1fdD581Bd6E638A7b98ac5567248A0c4E88f64", + 0, + [ + "0x8b3113f6", + "0xc32094c7", + "0x24aaa220", + "0xd136af44", + "0x186db48f", + "0xa8431081", + "0x5cc4fdeb", + "0x12348e96", + "0x530e784f" + ] + ] + ] +} diff --git a/simulations/vip-544/utils/cur-params-bsctestnet.json b/simulations/vip-544/utils/cur-params-bsctestnet.json new file mode 100644 index 000000000..ab6aac869 --- /dev/null +++ b/simulations/vip-544/utils/cur-params-bsctestnet.json @@ -0,0 +1,91 @@ +{ + "cutParams": [ + [ + "0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd", + 1, + [ + "0xa76b3fda", + "0x929fe9a1", + "0xc2998238", + "0xede4edd0", + "0xb0772d0b", + "0xabfceffc", + "0x007e3dd2", + "0xc488847b", + "0xa78dc775", + "0x0686dab6", + "0xddbf54fd", + "0xc5b4db55" + ] + ], + ["0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd", 0, ["0x3d98a1e5", "0xcab4f84c"]], + [ + "0x671B787AEDB6769972f081C6ee4978146F7D92E6", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ], + ["0x671B787AEDB6769972f081C6ee4978146F7D92E6", 0, ["0x528a174c"]], + [ + "0xb619F7ce96c0a6E3F0b44e993f663522F79f294A", + 1, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0xe4028eee", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0x4fd42e17", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0xfd51a3ad" + ] + ], + [ + "0xb619F7ce96c0a6E3F0b44e993f663522F79f294A", + 0, + [ + "0x8b3113f6", + "0xc32094c7", + "0x24aaa220", + "0xd136af44", + "0x186db48f", + "0xa8431081", + "0x5cc4fdeb", + "0x12348e96", + "0x530e784f" + ] + ] + ] +} diff --git a/simulations/vip-544/zksyncsepolia.ts b/simulations/vip-544/zksyncsepolia.ts new file mode 100644 index 000000000..3959db71e --- /dev/null +++ b/simulations/vip-544/zksyncsepolia.ts @@ -0,0 +1,98 @@ +import { impersonateAccount, setBalance } from "@nomicfoundation/hardhat-network-helpers"; +import { expect } from "chai"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents } from "src/utils"; +import { forking, pretendExecutingVip, testForkedNetworkVipCommands } from "src/vip-framework"; + +import { ANY_TARGET_CONTRACT } from "../../vips/vip-544/bsctestnet1"; +import vip544, { + ACCESS_CONTROL_MANAGER_ZKSYNCSEPOLIA, + MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA, +} from "../../vips/vip-544/bsctestnet2"; +import ACCESS_CONTROL_MANAGER_ABI from "./abi/AccessControlManager.json"; +import ISOLATED_POOL_COMPTROLLER_ABI from "./abi/IsolatedPoolComptroller.json"; +import OMNICHAIN_GOVERNANCE_EXECUTOR_ABI from "./abi/OmnichainGovernanceExecutor.json"; +import VENUS_RISK_STEWARD_RECEIVER_ABI from "./abi/VenusRiskStewardReceiver.json"; + +const { zksyncsepolia } = NETWORK_ADDRESSES; + +forking(4898583, async () => { + const provider = ethers.provider; + let executor: Contract; + let lastProposalReceived: BigNumber; + const acm = new ethers.Contract(ACCESS_CONTROL_MANAGER_ZKSYNCSEPOLIA, ACCESS_CONTROL_MANAGER_ABI, provider); + + const isolatedPoolComptroller = new ethers.Contract( + "0xC527DE08E43aeFD759F7c0e6aE85433923064669", + ISOLATED_POOL_COMPTROLLER_ABI, + provider, + ); + + before(async () => { + executor = new ethers.Contract( + zksyncsepolia.OMNICHAIN_GOVERNANCE_EXECUTOR, + OMNICHAIN_GOVERNANCE_EXECUTOR_ABI, + provider, + ); + + lastProposalReceived = await executor.lastProposalReceived(); + await pretendExecutingVip(await vip544()); + }); + + testForkedNetworkVipCommands("vip544 Configuring Risk Stewards", await vip544(), { + callbackAfterExecution: async txResponse => { + await expectEvents( + txResponse, + [ACCESS_CONTROL_MANAGER_ABI, VENUS_RISK_STEWARD_RECEIVER_ABI], + ["PermissionGranted", "RiskParameterConfigSet"], + [16, 2], + ); + }, + }); + + describe("Post-VIP behavior", () => { + it("Proposal id should be incremented", async () => { + expect(await executor.lastProposalReceived()).to.be.equals(lastProposalReceived.add(1)); + }); + + it("proposal should be executed", async () => { + const pId = await executor.lastProposalReceived(); + expect(await executor.state(pId)).to.be.equals(2); + }); + + it("Grants timelock permissions to setRiskParameterConfig on Market Cap Risk Steward", async () => { + const supplyCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const supplyCapRoleHash = ethers.utils.keccak256(supplyCapRole); + expect(await acm.hasRole(supplyCapRoleHash, MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA)).to.be.true; + + const borrowCapRole = ethers.utils.solidityPack( + ["address", "string"], + [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])"], + ); + const borrowCapRoleHash = ethers.utils.keccak256(borrowCapRole); + expect(await acm.hasRole(borrowCapRoleHash, MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA)).to.be.true; + }); + + it("Market Cap Risk Steward should be able to set supply and borrow caps on markets", async () => { + await impersonateAccount(MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA); + await setBalance(MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA, parseUnits("1000000", 18)); + + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA)) + .setMarketSupplyCaps(["0x7Bfd185eF8380a72027bF65bFEEAb0242b147778"], ["25000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewSupplyCap"); + await expect( + isolatedPoolComptroller + .connect(await ethers.getSigner(MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA)) + .setMarketBorrowCaps(["0x7Bfd185eF8380a72027bF65bFEEAb0242b147778"], ["20000000000000"]), + ).to.emit(isolatedPoolComptroller, "NewBorrowCap"); + }); + }); +}); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index 4d5736a64..89e6c36f6 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -79,6 +79,7 @@ export const NETWORK_ADDRESSES = { FAST_TRACK_TIMELOCK: "0x8764F50616B62a99A997876C2DEAaa04554C5B2E", CRITICAL_TIMELOCK: "0xeB9b85342c34F65af734C7bd4a149c86c472bC00", GUARDIAN: "0x285960C5B22fD66A736C7136967A3eB15e93CC67", + ACCESS_CONTROL_MANAGER: "0x230058da2D23eb8836EC5DB7037ef7250c56E25E", VTREASURY: ethereumDeployedContracts.addresses.VTreasuryV8, POOL_REGISTRY: ilEthereumDeployedContracts.addresses.PoolRegistry, RESILIENT_ORACLE: oracleEthereumContracts.addresses.ResilientOracle, diff --git a/vips/vip-544/bscmainnet.ts b/vips/vip-544/bscmainnet.ts new file mode 100644 index 000000000..37143e142 --- /dev/null +++ b/vips/vip-544/bscmainnet.ts @@ -0,0 +1,219 @@ +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { cutParams as params } from "../../simulations/vip-544/utils/cur-params-bscmainnet.json"; + +const { bscmainnet } = NETWORK_ADDRESSES; + +export const RISK_STEWARD_RECEIVER_BSCMAINNET = "0xBa2a43279a228cf9cD94d072777d8d98e7e0a229"; +export const MARKET_CAP_RISK_STEWARD_BSCMAINNET = "0xE7252dccd79F2A555E314B9cdd440745b697D562"; +export const ANY_TARGET_CONTRACT = ethers.constants.AddressZero; + +export const MORE_THAN_1_DAY = 86401; // 24 hours + 1 second +export const cutParams = params; + +export const vip544 = () => { + const meta = { + version: "v2", + title: "VIP-544 [BNB Chain] Chaos Labs' Risk Oracle integration (1/2)", + description: `#### Summary + +If passed, following the community proposal “[Integrate Chaos Labs’ Risk Oracle to Venus Protocol](https://community.venus.io/t/integrate-chaos-labs-risk-oracle-to-venus-protocol/4569)” ([snapshot](https://snapshot.box/#/s:venus-xvs.eth/proposal/0x6d84d48a17981a84e3eb320139552306f70fd006d7f3d9df131e20002e98620c)), this VIP will integrate the Chaos Labs’ Risk Oracle into Venus Protocol on BNB Chain, allowing the update of the supply and borrow caps of the Venus markets (on Isolated Pools) on this chain without VIP’s, considering Chaos Labs recommendations. + +Moreover, this VIP would upgrade the implementation of the [Comptroller contract for the Core pool on BNB Chain](https://bscscan.com/address/0xfD36E2c2a6789Db23113685031d7F16329158384), aligning its interface with the Comptroller contract used in the Isolated Pools. This change will simplify future interactions with both Comptroller contracts. + +#### Description + +[Chaos Labs’ Risk Oracle](https://github.com/ChaosLabsInc/risk-oracle) is a system composed of off-chain artifacts, where simulations and recommendations are defined, and a smart contract where [Chaos Labs](https://chaoslabs.xyz/) will submit recommendations for the Venus Protocol. These recommendations will be processed by the Venus Risk Steward contracts, performing some checks before applying them in the affected markets. + +Main characteristics of the Risk Stewards enabled in this VIP: + +- Only the supply and borrow caps can be adjusted—either increased or decreased. All other risk parameters cannot be updated +- The new caps cannot be greater or lower than 50% of the current caps. For example, given the current supply cap of the market [WBNB on the Liquid Staked BNB pool](https://app.venus.io/#/pool/0xd933909A4a2b7A4638903028f44D1d38ce27c352/market/0xe10E80B7FD3a29fE46E16C30CC8F4dd938B742e2?chainId=56&tab=supply) is 15K WBNB, Risk Stewards will be only able to set a new supply cap between 7.5K and 22.5K WBNB in one transaction. This limit can be modified with a VIP. +- Risk Stewards can only update the supply cap for a specific market once every 24 hours. The same rule applies to borrow cap updates. This constraint can be modified with a VIP. +- Risk Stewards will initially only be allowed to update markets in the Isolated Pools. In a separate VIP, they’ll also be granted permission to update markets in the Core Pool. This phased rollout is part of the overall security strategy. + +#### Next steps + +A new VIP will be proposed in the coming days to enable this integration for the markets in the Core pool on BNB Chain. Markets on other supported networks will be integrated at a later stage. + +#### Security and additional considerations + +We applied the following security procedures for this upgrade: + +- **Audits:** [Certik](https://www.certik.com/), [Quanstamp](https://quantstamp.com/) and [Fairyproof](https://www.fairyproof.com/) have audited the deployed code +- **VIP execution simulation**: in a simulation environment, validating the expected permissions are configured and the Risk Steward can update the caps as expected +- **Deployment on testnet**: the same commands have been executed on every testnet, and used in the Venus Protocol testnet deployment + +#### Audit reports + +- [Certik audit audit report](https://github.com/VenusProtocol/governance-contracts/blob/210d1e54f0c9136a805977b41077567b0883a4e0/audits/120_risk_stewards_v1_certik_20250219.pdf) (2025/02/19) +- [Quantstamp](https://github.com/VenusProtocol/governance-contracts/blob/210d1e54f0c9136a805977b41077567b0883a4e0/audits/121_risk_stewards_v1_quantstamp_20250213.pdf) (2025/02/13) +- [Fairyproof audit report](https://github.com/VenusProtocol/governance-contracts/blob/210d1e54f0c9136a805977b41077567b0883a4e0/audits/122_risk_stewards_v1_fairyproof_20250226.pdf) (2025/02/26) + +#### Deployed contracts + +- BNB Chain + - [RiskStewardReceiver](https://bscscan.com/address/0xBa2a43279a228cf9cD94d072777d8d98e7e0a229) + - [MarketCapsRiskSteward](https://bscscan.com/address/0xE7252dccd79F2A555E314B9cdd440745b697D562) + - [RiskOracle (managed by Chaos Labs)](https://bscscan.com/address/0x66A8cb6c4230B044378aC3676D47Ed4fE18e3cFB) + - New facets + - [MarketFacet](https://bscscan.com/address/0x94573965fbCCAC5cD4558208A8cCB3F18E71B7Db) + - [PolicyFacet](https://bscscan.com/address/0x5bb2Dfe996629E558Cd5BDBfC4c0eC7367BB96E9) + - [SetterFacet](https://bscscan.com/address/0x9D1fdD581Bd6E638A7b98ac5567248A0c4E88f64) +- BNB Chain testnet + - [RiskStewardReceiver](https://testnet.bscscan.com/address/0x31DEb4D1326838522697f7a012992f0824d80f2b) + - [MarketCapsRiskSteward](https://testnet.bscscan.com/address/0x9b40390771cAeEa69DE55EEd176aeDC72d70cA3E) + - [RiskOracle (managed by Chaos Labs)](https://testnet.bscscan.com/address/0x7BD97DD6C199532d11Cf5f55E13a120dB6dd0F4F) + - New facets + - [MarketFacet](https://testnet.bscscan.com/address/0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd) + - [PolicyFacet](https://testnet.bscscan.com/address/0x671B787AEDB6769972f081C6ee4978146F7D92E6) + - [SetterFacet](https://testnet.bscscan.com/address/0xb619F7ce96c0a6E3F0b44e993f663522F79f294A) + +#### References + +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/520) +- [Codebase of the new facets for the Core pool Comptroller on BNB Chain](https://github.com/VenusProtocol/venus-protocol/pull/548) +- [Codebase of the Risk Steward contracts](https://github.com/VenusProtocol/governance-contracts/pull/115) +- [Codebase of the RiskOracle contract, by Chaos Labs](https://github.com/ChaosLabsInc/risk-oracle)`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + // Update diamond cut + { + target: bscmainnet.UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [cutParams], + }, + // Permissions + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ + RISK_STEWARD_RECEIVER_BSCMAINNET, + "setRiskParameterConfig(string,address,uint256)", + bscmainnet.NORMAL_TIMELOCK, + ], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])", MARKET_CAP_RISK_STEWARD_BSCMAINNET], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setMarketBorrowCaps(address[],uint256[])", MARKET_CAP_RISK_STEWARD_BSCMAINNET], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "toggleConfigActive(string)", bscmainnet.NORMAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "toggleConfigActive(string)", bscmainnet.CRITICAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "toggleConfigActive(string)", bscmainnet.FAST_TRACK_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "pause()", bscmainnet.NORMAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "pause()", bscmainnet.CRITICAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "pause()", bscmainnet.FAST_TRACK_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "pause()", bscmainnet.GUARDIAN], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "unpause()", bscmainnet.NORMAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "unpause()", bscmainnet.CRITICAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "unpause()", bscmainnet.FAST_TRACK_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [RISK_STEWARD_RECEIVER_BSCMAINNET, "unpause()", bscmainnet.GUARDIAN], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [MARKET_CAP_RISK_STEWARD_BSCMAINNET, "setMaxDeltaBps(uint256)", bscmainnet.NORMAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [MARKET_CAP_RISK_STEWARD_BSCMAINNET, "setMaxDeltaBps(uint256)", bscmainnet.CRITICAL_TIMELOCK], + }, + { + target: bscmainnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [MARKET_CAP_RISK_STEWARD_BSCMAINNET, "setMaxDeltaBps(uint256)", bscmainnet.FAST_TRACK_TIMELOCK], + }, + // Set risk parameter configurations + { + target: RISK_STEWARD_RECEIVER_BSCMAINNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_BSCMAINNET, MORE_THAN_1_DAY], + }, + { + target: RISK_STEWARD_RECEIVER_BSCMAINNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_BSCMAINNET, MORE_THAN_1_DAY], + }, + // Accept ownership of Risk Steward Receiver + { + target: RISK_STEWARD_RECEIVER_BSCMAINNET, + signature: "acceptOwnership()", + params: [], + }, + // Accept ownership of Market Cap Risk Steward + { + target: MARKET_CAP_RISK_STEWARD_BSCMAINNET, + signature: "acceptOwnership()", + params: [], + }, + // Pause Risk Steward Receiver + { + target: RISK_STEWARD_RECEIVER_BSCMAINNET, + signature: "pause()", + params: [], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip544; diff --git a/vips/vip-544/bsctestnet-addendum.ts b/vips/vip-544/bsctestnet-addendum.ts new file mode 100644 index 000000000..ccb8627b7 --- /dev/null +++ b/vips/vip-544/bsctestnet-addendum.ts @@ -0,0 +1,36 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { cutParams as params } from "../../simulations/vip-544/utils/cur-params-bsctestnet.json"; + +export const cutParams = params; + +const { bsctestnet } = NETWORK_ADDRESSES; + +export const vip544_Addendum = () => { + const meta = { + version: "v2", + title: "Configure Remote Risk Stewards", + description: `#### Summary +Configure Remote Risk Stewards +`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: bsctestnet.UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [cutParams], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip544_Addendum; diff --git a/vips/vip-544/bsctestnet1.ts b/vips/vip-544/bsctestnet1.ts new file mode 100644 index 000000000..aba4b90cc --- /dev/null +++ b/vips/vip-544/bsctestnet1.ts @@ -0,0 +1,271 @@ +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +export const RISK_STEWARD_RECEIVER_BSC_TESTNET = "0x31DEb4D1326838522697f7a012992f0824d80f2b"; +export const MARKET_CAP_RISK_STEWARD_BSC_TESTNET = "0x9b40390771cAeEa69DE55EEd176aeDC72d70cA3E"; +export const ACCESS_CONTROL_MANAGER_BSC_TESTNET = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; +export const NORMAL_TIMELOCK_BSC_TESTNET = "0xce10739590001705F7FF231611ba4A48B2820327"; +export const BSC_TESTNET_CORE_COMPTROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; +export const CRITIAL_TIMELOCK_BSC_TESTNET = "0x23B893a7C45a5Eb8c8C062b9F32d0D2e43eD286D"; +export const FAST_TRACK_TIMELOCK_BSC_TESTNET = "0x3CFf21b7AF8390fE68799D58727d3b4C25a83cb6"; + +export const RISK_STEWARD_RECEIVER_SEPOLIA = "0xDF1807d323Dd2E2871e8b394c8F7595E097e1C73"; +export const MARKET_CAP_RISK_STEWARD_SEPOLIA = "0xEa687c54321Db5b20CA544f38f08E429a4bfCBc8"; +export const ACCESS_CONTROL_MANAGER_SEPOLIA = "0xbf705C00578d43B6147ab4eaE04DBBEd1ccCdc96"; +export const NORMAL_TIMELOCK_SEPOLIA = "0xc332F7D8D5eA72cf760ED0E1c0485c8891C6E0cF"; +export const CRITIAL_TIMELOCK_SEPOLIA = "0xA24A7A65b8968a749841988Bd7d05F6a94329fDe"; +export const FAST_TRACK_TIMELOCK_SEPOLIA = "0x7F043F43Adb392072a3Ba0cC9c96e894C6f7e182"; + +export const RISK_STEWARD_RECEIVER_OPBNBTESTNET = "0x3f0e45aC20048cE0a803c439913a638A8208602e"; +export const MARKET_CAP_RISK_STEWARD_OPBNBTESTNET = "0x155F16CB2b5f69F66d4359d81C6cA55E8Be5a253"; +export const ACCESS_CONTROL_MANAGER_OPBNBTESTNET = "0x049f77F7046266d27C3bC96376f53C17Ef09c986"; +export const NORMAL_TIMELOCK_OPBNBTESTNET = "0x1c4e015Bd435Efcf4f58D82B0d0fBa8fC4F81120"; +export const CRITIAL_TIMELOCK_OPBNBTESTNET = "0xBd06aCDEF38230F4EdA0c6FD392905Ad463e42E3"; +export const FAST_TRACK_TIMELOCK_OPBNBTESTNET = "0xB2E6268085E75817669479b22c73C2AfEaADF7A6"; + +export const RISK_STEWARD_RECEIVER_ARBITRUMSEPOLIA = "0xE6b7B1846106605fdfaB3a9F407dd64bed6917a6"; +export const MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA = "0xe739ff9CFa2CFA24fb7816133e1CBe7046A37Ecc"; +export const ACCESS_CONTROL_MANAGER_ARBITRUMSEPOLIA = "0xa36AD96441cB931D8dFEAAaC97D3FaB4B39E590F"; +export const NORMAL_TIMELOCK_ARBITRUMSEPOLIA = "0x794BCA78E606f3a462C31e5Aba98653Efc1322F8"; +export const CRITIAL_TIMELOCK_ARBITRUMSEPOLIA = "0x0b32Be083f7041608E023007e7802430396a2123"; +export const FAST_TRACK_TIMELOCK_ARBITRUMSEPOLIA = "0x14642991184F989F45505585Da52ca6A6a7dD4c8"; + +export const ANY_TARGET_CONTRACT = "0x0000000000000000000000000000000000000000"; + +export const permissions = ( + chain: LzChainId | undefined, + acm: string, + riskStewardReceiver: string, + marketCapRiskSteward: string, + normalTimelock: string, + fastTrackTimelock: string, + criticalTimelock: string, +) => { + return [ + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "setRiskParameterConfig(string,address,uint256)", normalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setMarketSupplyCaps(address[],uint256[])", marketCapRiskSteward], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [ANY_TARGET_CONTRACT, "setMarketBorrowCaps(address[],uint256[])", marketCapRiskSteward], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "toggleConfigActive(string)", normalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "toggleConfigActive(string)", criticalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "toggleConfigActive(string)", fastTrackTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "pause()", normalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "pause()", criticalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "pause()", fastTrackTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "unpause()", normalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "unpause()", criticalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [riskStewardReceiver, "unpause()", fastTrackTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [marketCapRiskSteward, "processUpdate(RiskParameterUpdate)", riskStewardReceiver], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [marketCapRiskSteward, "setMaxDeltaBps(uint256)", normalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [marketCapRiskSteward, "setMaxDeltaBps(uint256)", criticalTimelock], + dstChainId: chain, + }, + { + target: acm, + signature: "giveCallPermission(address,string,address)", + params: [marketCapRiskSteward, "setMaxDeltaBps(uint256)", fastTrackTimelock], + dstChainId: chain, + }, + ]; +}; + +const vip544 = () => { + const meta = { + version: "v2", + title: "Configure Remote Risk Stewards", + description: `#### Summary +Configure Remote Risk Stewards +`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + // bsc testnet + ...permissions( + undefined, + ACCESS_CONTROL_MANAGER_BSC_TESTNET, + RISK_STEWARD_RECEIVER_BSC_TESTNET, + MARKET_CAP_RISK_STEWARD_BSC_TESTNET, + NORMAL_TIMELOCK_BSC_TESTNET, + FAST_TRACK_TIMELOCK_BSC_TESTNET, + CRITIAL_TIMELOCK_BSC_TESTNET, + ), + { + target: RISK_STEWARD_RECEIVER_BSC_TESTNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_BSC_TESTNET, 86401], + }, + { + target: RISK_STEWARD_RECEIVER_BSC_TESTNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_BSC_TESTNET, 86401], + }, + { + target: ACCESS_CONTROL_MANAGER_BSC_TESTNET, + signature: "giveCallPermission(address,string,address)", + params: [ + BSC_TESTNET_CORE_COMPTROLLER, + "_setMarketSupplyCaps(address[],uint256[])", + MARKET_CAP_RISK_STEWARD_BSC_TESTNET, + ], + }, + { + target: ACCESS_CONTROL_MANAGER_BSC_TESTNET, + signature: "giveCallPermission(address,string,address)", + params: [ + BSC_TESTNET_CORE_COMPTROLLER, + "_setMarketBorrowCaps(address[],uint256[])", + MARKET_CAP_RISK_STEWARD_BSC_TESTNET, + ], + }, + + // sepolia + ...permissions( + LzChainId.sepolia, + ACCESS_CONTROL_MANAGER_SEPOLIA, + RISK_STEWARD_RECEIVER_SEPOLIA, + MARKET_CAP_RISK_STEWARD_SEPOLIA, + NORMAL_TIMELOCK_SEPOLIA, + FAST_TRACK_TIMELOCK_SEPOLIA, + CRITIAL_TIMELOCK_SEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_SEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_SEPOLIA, 86401], + dstChainId: LzChainId.sepolia, + }, + { + target: RISK_STEWARD_RECEIVER_SEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_SEPOLIA, 86401], + dstChainId: LzChainId.sepolia, + }, + + // opbnbtestnet + ...permissions( + LzChainId.opbnbtestnet, + ACCESS_CONTROL_MANAGER_OPBNBTESTNET, + RISK_STEWARD_RECEIVER_OPBNBTESTNET, + MARKET_CAP_RISK_STEWARD_OPBNBTESTNET, + NORMAL_TIMELOCK_OPBNBTESTNET, + FAST_TRACK_TIMELOCK_OPBNBTESTNET, + CRITIAL_TIMELOCK_OPBNBTESTNET, + ), + { + target: RISK_STEWARD_RECEIVER_OPBNBTESTNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_OPBNBTESTNET, 86401], + dstChainId: LzChainId.opbnbtestnet, + }, + { + target: RISK_STEWARD_RECEIVER_OPBNBTESTNET, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_OPBNBTESTNET, 86401], + dstChainId: LzChainId.opbnbtestnet, + }, + + // arbitrumsepolia + ...permissions( + LzChainId.arbitrumsepolia, + ACCESS_CONTROL_MANAGER_ARBITRUMSEPOLIA, + RISK_STEWARD_RECEIVER_ARBITRUMSEPOLIA, + MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA, + NORMAL_TIMELOCK_ARBITRUMSEPOLIA, + FAST_TRACK_TIMELOCK_ARBITRUMSEPOLIA, + CRITIAL_TIMELOCK_ARBITRUMSEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_ARBITRUMSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA, 86401], + dstChainId: LzChainId.arbitrumsepolia, + }, + { + target: RISK_STEWARD_RECEIVER_ARBITRUMSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_ARBITRUMSEPOLIA, 86401], + dstChainId: LzChainId.arbitrumsepolia, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip544; diff --git a/vips/vip-544/bsctestnet2.ts b/vips/vip-544/bsctestnet2.ts new file mode 100644 index 000000000..ac96f1884 --- /dev/null +++ b/vips/vip-544/bsctestnet2.ts @@ -0,0 +1,145 @@ +import { LzChainId, ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { permissions } from "./bsctestnet1"; + +export const RISK_STEWARD_RECEIVER_OPSEPOLIA = "0x4fCbfE445396f31005b3Fd2F6DE2A986d6E2dCB5"; +export const MARKET_CAP_RISK_STEWARD_OPSEPOLIA = "0x7831156A181288ce76B5952624Df6C842F4Cc0c1"; +export const ACCESS_CONTROL_MANAGER_OPSEPOLIA = "0x1652E12C8ABE2f0D84466F0fc1fA4286491B3BC1"; +export const NORMAL_TIMELOCK_OPSEPOLIA = "0xdDe31d7eEEAD7Cf9790F833C4FF4c6e61404402a"; +export const CRITIAL_TIMELOCK_OPSEPOLIA = "0x45d2263c6E0dbF84eBffB1Ee0b80aC740607990B"; +export const FAST_TRACK_TIMELOCK_OPSEPOLIA = "0xe0Fa35b6279dd802C382ae54c50C8B16deaC0885"; + +export const RISK_STEWARD_RECEIVER_BASESEPOLIA = "0xf69fd7757c8A59DFA5c35622d9D44B31dB21B0a2"; +export const MARKET_CAP_RISK_STEWARD_BASESEPOLIA = "0xE03E243AC1f3239ed6a0793C25E79C951339a915"; +export const ACCESS_CONTROL_MANAGER_BASESEPOLIA = "0x724138223D8F76b519fdE715f60124E7Ce51e051"; +export const NORMAL_TIMELOCK_BASESEPOLIA = "0xCc84f6122649eDc48f4a426814e6b6C6fF9bBe0a"; +export const CRITIAL_TIMELOCK_BASESEPOLIA = "0xbeDb7F2d0617292364bA4D73cf016c0f6BB5542E"; +export const FAST_TRACK_TIMELOCK_BASESEPOLIA = "0x3dFA652D3aaDcb93F9EA7d160d674C441AaA8EE2"; + +export const RISK_STEWARD_RECEIVER_UNICHAINSEPOLIA = "0x4fCbfE445396f31005b3Fd2F6DE2A986d6E2dCB5"; +export const MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA = "0x6edbFE9a95dB5f0CdDcE446A0Fe75D7832Cf8DDB"; +export const ACCESS_CONTROL_MANAGER_UNICHAINSEPOLIA = "0x854C064EA6b503A97980F481FA3B7279012fdeDd"; +export const NORMAL_TIMELOCK_UNICHAINSEPOLIA = "0x5e20F5A2e23463D39287185DF84607DF7068F314"; +export const CRITIAL_TIMELOCK_UNICHAINSEPOLIA = "0x86C093266e824FA4345484a7B9109e9567923DA6"; +export const FAST_TRACK_TIMELOCK_UNICHAINSEPOLIA = "0x668cDb1A414006D0a26e9e13881D4Cd30B8b2a4A"; + +export const RISK_STEWARD_RECEIVER_ZKSYNCSEPOLIA = "0x25483111881c431492D010a9071Ce6C84C3b90A6"; +export const MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA = "0xe88C01daAd0b931af68C9fD70bfa9bde8142FF64"; +export const ACCESS_CONTROL_MANAGER_ZKSYNCSEPOLIA = "0xD07f543d47c3a8997D6079958308e981AC14CD01"; +export const NORMAL_TIMELOCK_ZKSYNCSEPOLIA = "0x1730527a0f0930269313D77A317361b42971a67E"; +export const CRITIAL_TIMELOCK_ZKSYNCSEPOLIA = "0x0E6138bE0FA1915efC73670a20A10EFd720a6Cc8"; +export const FAST_TRACK_TIMELOCK_ZKSYNCSEPOLIA = "0xb055e028b27d53a455a6c040a6952e44E9E615c4"; + +const vip544 = () => { + const meta = { + version: "v2", + title: "Configure Remote Risk Stewards", + description: `#### Summary +Configure Remote Risk Stewards +`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + // opsepolia + ...permissions( + LzChainId.opsepolia, + ACCESS_CONTROL_MANAGER_OPSEPOLIA, + RISK_STEWARD_RECEIVER_OPSEPOLIA, + MARKET_CAP_RISK_STEWARD_OPSEPOLIA, + NORMAL_TIMELOCK_OPSEPOLIA, + FAST_TRACK_TIMELOCK_OPSEPOLIA, + CRITIAL_TIMELOCK_OPSEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_OPSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_OPSEPOLIA, 86401], + dstChainId: LzChainId.opsepolia, + }, + { + target: RISK_STEWARD_RECEIVER_OPSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_OPSEPOLIA, 86401], + dstChainId: LzChainId.opsepolia, + }, + + // basesepolia + ...permissions( + LzChainId.basesepolia, + ACCESS_CONTROL_MANAGER_BASESEPOLIA, + RISK_STEWARD_RECEIVER_BASESEPOLIA, + MARKET_CAP_RISK_STEWARD_BASESEPOLIA, + NORMAL_TIMELOCK_BASESEPOLIA, + FAST_TRACK_TIMELOCK_BASESEPOLIA, + CRITIAL_TIMELOCK_BASESEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_BASESEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_BASESEPOLIA, 86401], + dstChainId: LzChainId.basesepolia, + }, + { + target: RISK_STEWARD_RECEIVER_BASESEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_BASESEPOLIA, 86401], + dstChainId: LzChainId.basesepolia, + }, + + // unichainsepolia + ...permissions( + LzChainId.unichainsepolia, + ACCESS_CONTROL_MANAGER_UNICHAINSEPOLIA, + RISK_STEWARD_RECEIVER_UNICHAINSEPOLIA, + MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA, + NORMAL_TIMELOCK_UNICHAINSEPOLIA, + FAST_TRACK_TIMELOCK_UNICHAINSEPOLIA, + CRITIAL_TIMELOCK_UNICHAINSEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_UNICHAINSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA, 86401], + dstChainId: LzChainId.unichainsepolia, + }, + { + target: RISK_STEWARD_RECEIVER_UNICHAINSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_UNICHAINSEPOLIA, 86401], + dstChainId: LzChainId.unichainsepolia, + }, + + // zksyncsepolia + ...permissions( + LzChainId.zksyncsepolia, + ACCESS_CONTROL_MANAGER_ZKSYNCSEPOLIA, + RISK_STEWARD_RECEIVER_ZKSYNCSEPOLIA, + MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA, + NORMAL_TIMELOCK_ZKSYNCSEPOLIA, + FAST_TRACK_TIMELOCK_ZKSYNCSEPOLIA, + CRITIAL_TIMELOCK_ZKSYNCSEPOLIA, + ), + { + target: RISK_STEWARD_RECEIVER_ZKSYNCSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["supplyCap", MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA, 86401], + dstChainId: LzChainId.zksyncsepolia, + }, + { + target: RISK_STEWARD_RECEIVER_ZKSYNCSEPOLIA, + signature: "setRiskParameterConfig(string,address,uint256)", + params: ["borrowCap", MARKET_CAP_RISK_STEWARD_ZKSYNCSEPOLIA, 86401], + dstChainId: LzChainId.zksyncsepolia, + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip544;