From 77f7a4884e3168c5e8d6a541f85fe08474da33dc Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 25 Aug 2025 20:55:50 +0530 Subject: [PATCH 01/24] feat: add vip to configure emode in BNB core pool --- .../vip-550/utils/bsctestnet-cut-params.json | 120 +++++++ vips/vip-550/bsctestnet.ts | 309 ++++++++++++++++++ 2 files changed, 429 insertions(+) create mode 100644 simulations/vip-550/utils/bsctestnet-cut-params.json create mode 100644 vips/vip-550/bsctestnet.ts diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json new file mode 100644 index 000000000..1af78fadb --- /dev/null +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -0,0 +1,120 @@ +{ + "cutParams": [ + [ + "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + 1, + [ + "0xa76b3fda", + "0x89c13be0", + "0x929fe9a1", + "0xd0d13036", + "0xc2998238", + "0xf9682732", + "0xede4edd0", + "0xb0772d0b", + "0xabfceffc", + "0x23617585", + "0xafd3783b", + "0x19ef3e8b", + "0xd686e9ee", + "0x7b86e42c", + "0x63e0d634", + "0xf02fdf97", + "0x007e3dd2", + "0x3d98a1e5", + "0x0ef332ca", + "0xc488847b", + "0xa78dc775", + "0x8e8f294b", + "0x3093c11e", + "0xd137f36e", + "0xcab4f84c", + "0x0686dab6", + "0xddbf54fd" + ] + ], + [ + "0x284d000665296515280a4fB066a887EFF6A3bD9E", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x528a174c", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ], + [ + "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB", + 1, + [ + "0xa7604b41", + "0xe85a2960", + "0x70bf66f0", + "0x86df31ee", + "0xadcd5fb9", + "0xd09c54ba", + "0x7858524d", + "0xd463654c", + "0x4d99c776", + "0xbf32442d", + "0xededbae6", + "0x655f0725", + "0xc5b4db55" + ] + ], + [ + "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + 1, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0x24aaa220", + "0x12348e96", + "0x5cc4fdeb", + "0x9159b177", + "0x8b3113f6", + "0xa89766dd", + "0x35439240", + "0x9bd8f6e8", + "0x186db48f", + "0xd136af44", + "0xfd51a3ad", + "0x530e784f", + "0xc32094c7" + ] + ], + ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17"]] + ] +} diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts new file mode 100644 index 000000000..ccf8aa492 --- /dev/null +++ b/vips/vip-550/bsctestnet.ts @@ -0,0 +1,309 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { cutParams as params } from "../../simulations/vip-550/utils/bsctestnet-cut-params.json"; + +export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; +export const VAI_UNITROLLER = "0xf70C3C6b749BbAb89C081737334E74C9aFD4BE16"; +export const LIQUIDATOR = "0x55AEABa76ecf144031Ef64E222166eb28Cb4865F"; +export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; + +export const NEW_VAI_CONTROLLER = "0x5361EeCB35Dbbf239F0AB3600e460bFdBa14c592"; +export const NEW_DIAMOND = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; +export const NEW_COMPTROLLER_LENS = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; +export const NEW_VBEP20_DELEGATE = "0xf292c8F321fF1BC49A3FeADf4D0971E519485e19"; +export const NEW_LIQUIDATOR_IMPL = "0x0F30B2a844339b7bD2Be0D82298e82f44286A0cA"; + +export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); +export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); + +export const NEW_COMPT_METHODS = [ + "createPool(string)", + "addPoolMarket(uint96,address)", + "removePoolMarket(uint96,address)", + "setCollateralFactor(address,uint256,uint256)", + "setCollateralFactor(uint96,address,uint256,uint256)", + "setLiquidationIncentive(address,uint256)", + "setLiquidationIncentive(uint96,address,uint256)", + "setIsBorrowAllowed(uint96,address,bool)", +]; + +export const CORE_MARKETS = [ + { + symbol: "vUSDC", + address: "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", + collateralFactor: 810000000000000000n, + }, + { + symbol: "vUSDT", + address: "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vBUSD", + address: "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", + collateralFactor: 0n, + }, + { + symbol: "vSXP", + address: "0x74469281310195A04840Daf6EdF576F559a3dE80", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vBNB", + address: "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", + collateralFactor: 800000000000000000n, + }, + { + symbol: "Venus XVS", + address: "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vETH", + address: "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vLTC", + address: "0xAfc13BC065ABeE838540823431055D2ea52eBA52", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vXRP", + address: "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vBTC", + address: "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vADA", + address: "0x37C28DE42bA3d22217995D146FC684B2326Ede64", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vDOGE", + address: "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vCAKE", + address: "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vMATIC", + address: "0x3619bdDc61189F33365CC572DF3a68FB3b316516", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vAAVE", + address: "0x714db6c38A17883964B68a07d56cE331501d9eb6", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vTUSDOLD", + address: "0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vTRXOLD", + address: "0x369Fea97f6fB7510755DCA389088d9E2e2819278", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vTRX", + address: "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vWBETH", + address: "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vTUSD", + address: "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", + collateralFactor: 0n, + }, + { + symbol: "vUNI", + address: "0x171B468b52d7027F12cEF90cd065d6776a25E24e", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vFDUSD", + address: "0xF06e662a00796c122AaAE935EC4F0Be3F74f5636", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vSolvBTC", + address: "0xA38110ae4451A86ab754695057d5B5a9BEAd0387", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vTWT", + address: "0x95DaED37fdD3F557b3A5cCEb7D50Be65b36721DF", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vTHE", + address: "0x39A239F5117BFaC7a1b0b3A517c454113323451d", + collateralFactor: 530000000000000000n, + }, + { + symbol: "vSOL", + address: "0xbd9EB061444665Df7282Ec0888b72D60aC41Eb8C", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vlisUSD", + address: "0x9447b1D4Bd192f25416B6aCc3B7f06be2f7D6309", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vPT-sUSDE-26JUN2025", + address: "0x90535B06ddB00453a5e5f2bC094d498F1cc86032", + collateralFactor: 700000000000000000n, + }, + { + symbol: "vsUSDe", + address: "0x8c8A1a0b6e1cb8058037F7bF24de6b79Aca5B7B0", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vUSDe", + address: "0x86f8DfB7CA84455174EE9C3edd94867b51Da46BD", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vUSD1", + address: "0x519e61D2CDA04184FB086bbD2322C1bfEa0917Cf", + collateralFactor: 0n, + }, + { + symbol: "vxSolvBTC", + address: "0x97cB97B05697c377C0bd09feDce67DBd86B7aB1e", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vasBNB", + address: "0x73F506Aefd5e169D48Ea21A373B9B0a200E37585", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vUSDF", + address: "0x140d5Da2cE9fb9A8725cabdDB2Fe8ea831342C78", + collateralFactor: 600000000000000000n, + }, +]; + +export const vip550 = () => { + const meta = { + version: "v2", + title: "Emode in the BNB Core Pool", + description: `Emode in the BNB Core Pool`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_DIAMOND], + }, + { + target: NEW_DIAMOND, + signature: "_become(address)", + params: [UNITROLLER], + }, + { + target: UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [params], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "_setCollateralFactor(address,uint256)", NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "_setLiquidationIncentive(uint256)", NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], + }, + ...NEW_COMPT_METHODS.map(method => { + return { + target: UNITROLLER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], + }; + }), + { + target: UNITROLLER, + signature: "_setComptrollerLens(address)", + params: [NEW_COMPTROLLER_LENS], + }, + ...CORE_MARKETS.map(vToken => { + return { + target: vToken.address, + signature: "_setImplementation(address,bool,bytes)", + params: [NEW_VBEP20_DELEGATE, false, "0x"], + }; + }), + ...CORE_MARKETS.map(vToken => { + return { + target: UNITROLLER, + signature: "setCollateralFactor(address,uint256,uint256)", + params: [vToken.address, vToken.collateralFactor, vToken.collateralFactor], + }; + }), + ...CORE_MARKETS.map(vToken => { + return { + target: UNITROLLER, + signature: "setLiquidationIncentive(address,uint256)", + params: [vToken.address, CURRENT_LIQUIDATION_INCENTIVE], + }; + }), + ...CORE_MARKETS.map(vToken => { + return { + target: UNITROLLER, + signature: "setIsBorrowAllowed(uint96,address,bool)", + params: [0, vToken, true], + }; + }), + { + target: VAI_UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_VAI_CONTROLLER], + }, + { + target: NEW_VAI_CONTROLLER, + signature: "_become(address)", + params: [VAI_UNITROLLER], + }, + { + target: LIQUIDATOR, + signature: "upgradeTo(address)", + params: [NEW_LIQUIDATOR_IMPL], + }, + { + target: LIQUIDATOR, + signature: "setTreasuryPercent(uint256)", + params: [LIQUIDATOR_TREASURTY_PERCENT], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip550; From afe194f2ef919b0e93853e3fca07a2278aeafa2d Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 26 Aug 2025 11:03:20 +0530 Subject: [PATCH 02/24] chore: update diamondcut facet selectors --- .../vip-550/utils/bscmainnet-cut-params.json | 132 ++++++++++++++++++ .../vip-550/utils/bsctestnet-cut-params.json | 51 +++---- 2 files changed, 159 insertions(+), 24 deletions(-) create mode 100644 simulations/vip-550/utils/bscmainnet-cut-params.json diff --git a/simulations/vip-550/utils/bscmainnet-cut-params.json b/simulations/vip-550/utils/bscmainnet-cut-params.json new file mode 100644 index 000000000..12cac7547 --- /dev/null +++ b/simulations/vip-550/utils/bscmainnet-cut-params.json @@ -0,0 +1,132 @@ +{ + "cutParams": [ + [ + "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + 1, + [ + "0xa76b3fda", + "0x929fe9a1", + "0xc2998238", + "0xede4edd0", + "0xb0772d0b", + "0xabfceffc", + "0x007e3dd2", + "0xc488847b", + "0xa78dc775", + "0x0686dab6", + "0xddbf54fd", + "0xc5b4db55" + ] + ], + [ + "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + 0, + [ + "0xd463654c", + "0x4d99c776", + "0x3d98a1e5", + "0xcab4f84c", + "0x89c13be0", + "0xd0d13036", + "0xf9682732", + "0x23617585", + "0xafd3783b", + "0x19ef3e8b", + "0xd686e9ee", + "0x7b86e42c", + "0x63e0d634", + "0xf02fdf97", + "0x0ef332ca", + "0x8e8f294b", + "0x3093c11e", + "0xd137f36e" + ] + ], + [ + "0x284d000665296515280a4fB066a887EFF6A3bD9E", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ], + ["0x284d000665296515280a4fB066a887EFF6A3bD9E", 0, ["0x528a174c"]], + [ + "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB", + 1, + [ + "0xa7604b41", + "0xe85a2960", + "0x70bf66f0", + "0x86df31ee", + "0xadcd5fb9", + "0xd09c54ba", + "0x7858524d", + "0xbf32442d", + "0xededbae6", + "0x655f0725" + ] + ], + [ + "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + 1, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0xfd51a3ad" + ] + ], + [ + "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + 0, + [ + "0x24aaa220", + "0x5cc4fdeb", + "0x8b3113f6", + "0x12348e96", + "0xc32094c7", + "0x530e784f", + "0x9159b177", + "0xa89766dd", + "0x35439240", + "0x9bd8f6e8", + "0x186db48f", + "0xd136af44" + ] + ], + ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17"]] + ] +} diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json index 1af78fadb..bb1e0c310 100644 --- a/simulations/vip-550/utils/bsctestnet-cut-params.json +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -5,14 +5,28 @@ 1, [ "0xa76b3fda", - "0x89c13be0", "0x929fe9a1", - "0xd0d13036", "0xc2998238", - "0xf9682732", "0xede4edd0", "0xb0772d0b", "0xabfceffc", + "0x007e3dd2", + "0xc488847b", + "0xa78dc775", + "0x0686dab6", + "0xddbf54fd", + "0x3d98a1e5", + "0xcab4f84c", + "0xc5b4db55" + ] + ], + [ + "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + 0, + [ + "0x89c13be0", + "0xd0d13036", + "0xf9682732", "0x23617585", "0xafd3783b", "0x19ef3e8b", @@ -20,17 +34,12 @@ "0x7b86e42c", "0x63e0d634", "0xf02fdf97", - "0x007e3dd2", - "0x3d98a1e5", "0x0ef332ca", - "0xc488847b", - "0xa78dc775", "0x8e8f294b", "0x3093c11e", "0xd137f36e", - "0xcab4f84c", - "0x0686dab6", - "0xddbf54fd" + "0xd463654c", + "0x4d99c776" ] ], [ @@ -68,12 +77,9 @@ "0xadcd5fb9", "0xd09c54ba", "0x7858524d", - "0xd463654c", - "0x4d99c776", "0xbf32442d", "0xededbae6", - "0x655f0725", - "0xc5b4db55" + "0x655f0725" ] ], [ @@ -102,19 +108,16 @@ "0x4ef233fc", "0x24aaa220", "0x12348e96", - "0x5cc4fdeb", - "0x9159b177", - "0x8b3113f6", - "0xa89766dd", - "0x35439240", - "0x9bd8f6e8", - "0x186db48f", - "0xd136af44", "0xfd51a3ad", + "0x8b3113f6", + "0xc32094c7", "0x530e784f", - "0xc32094c7" + "0x5cc4fdeb", + "0x186db48f", + "0xd136af44" ] ], - ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17"]] + ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 0, ["0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8"]], + ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17", "0xa8431081"]] ] } From aeb551185dbdb3dd6d9727f3da514249e64c9631 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 26 Aug 2025 20:28:12 +0530 Subject: [PATCH 03/24] feat: add testnet vip simulations --- .../vip-550/abi/AccessControlManager.json | 157 + simulations/vip-550/abi/Comptroller.json | 3830 +++++++++++++++++ simulations/vip-550/abi/Diamond.json | 509 +++ simulations/vip-550/abi/Liquidator.json | 451 ++ simulations/vip-550/abi/LiquidatorProxy.json | 72 + simulations/vip-550/abi/VAIController.json | 34 + simulations/vip-550/abi/VAIUnitroller.json | 122 + simulations/vip-550/abi/VBEP20Delegator.json | 688 +++ simulations/vip-550/bsctestnet.ts | 186 + .../vip-550/utils/bsctestnet-cut-params.json | 2 +- vips/vip-550/bsctestnet.ts | 233 +- 11 files changed, 6167 insertions(+), 117 deletions(-) create mode 100644 simulations/vip-550/abi/AccessControlManager.json create mode 100644 simulations/vip-550/abi/Comptroller.json create mode 100644 simulations/vip-550/abi/Diamond.json create mode 100644 simulations/vip-550/abi/Liquidator.json create mode 100644 simulations/vip-550/abi/LiquidatorProxy.json create mode 100644 simulations/vip-550/abi/VAIController.json create mode 100644 simulations/vip-550/abi/VAIUnitroller.json create mode 100644 simulations/vip-550/abi/VBEP20Delegator.json create mode 100644 simulations/vip-550/bsctestnet.ts diff --git a/simulations/vip-550/abi/AccessControlManager.json b/simulations/vip-550/abi/AccessControlManager.json new file mode 100644 index 000000000..2ef119947 --- /dev/null +++ b/simulations/vip-550/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-550/abi/Comptroller.json b/simulations/vip-550/abi/Comptroller.json new file mode 100644 index 000000000..666c24cbe --- /dev/null +++ b/simulations/vip-550/abi/Comptroller.json @@ -0,0 +1,3830 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AlreadyInSelectedPool", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowNotAllowedInPool", + "type": "error" + }, + { + "inputs": [], + "name": "CorePoolModificationNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPoolLabel", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleBorrowedAssets", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum WeightFunction", + "name": "strategy", + "type": "uint8" + } + ], + "name": "InvalidWeightingStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "name": "LiquidityCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [], + "name": "MarketConfigNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "MarketNotListedInCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "PoolDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "ActionProtocolPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isAllowed", + "type": "bool" + } + ], + "name": "BorrowAllowedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "approver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DistributedVAIVaultVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledForUserUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "NewAccessControl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldComptrollerLens", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newComptrollerLens", + "type": "address" + } + ], + "name": "NewComptrollerLens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldLiquidatorContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLiquidatorContract", + "type": "address" + } + ], + "name": "NewLiquidatorContract", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IPrime", + "name": "oldPrimeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IPrime", + "name": "newPrimeToken", + "type": "address" + } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + } + ], + "name": "NewTreasuryAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + } + ], + "name": "NewTreasuryGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldTreasuryPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "NewTreasuryPercent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "oldVAIController", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "newVAIController", + "type": "address" + } + ], + "name": "NewVAIController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVAIMintRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "NewVAIMintRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseInterval_", + "type": "uint256" + } + ], + "name": "NewVAIVaultInfo", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVenusVAIVaultRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVenusVAIVaultRate", + "type": "uint256" + } + ], + "name": "NewVenusVAIVaultRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVS", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVS", + "type": "address" + } + ], + "name": "NewXVSToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVToken", + "type": "address" + } + ], + "name": "NewXVSVToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "PoolMarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "previousPoolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "newPoolId", + "type": "uint96" + } + ], + "name": "PoolSelected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusSeized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusSupplySpeedUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_grantXVS", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "_setAccessControl", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "_setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "_setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptrollerLens_", + "type": "address" + } + ], + "name": "_setComptrollerLens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidationForUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLiquidatorContract_", + "type": "address" + } + ], + "name": "_setLiquidatorContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "_setPauseGuardian", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "_setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "_setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "_setProtocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + }, + { + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "_setTreasuryData", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "vaiController_", + "type": "address" + } + ], + "name": "_setVAIController", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "_setVAIMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReleaseAmount_", + "type": "uint256" + } + ], + "name": "_setVAIVaultInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "_setVenusSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "venusVAIVaultRate_", + "type": "uint256" + } + ], + "name": "_setVenusVAIVaultRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvs_", + "type": "address" + } + ], + "name": "_setXVSToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVToken_", + "type": "address" + } + ], + "name": "_setXVSVToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "_supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96[]", + "name": "poolIds", + "type": "uint96[]" + }, + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "addPoolMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "collateral", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenusAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "corePoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "enterPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBorrowingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getEffectiveLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "enum WeightFunction", + "name": "weightingStrategy", + "type": "uint8" + } + ], + "name": "getEffectiveLtvFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getPoolMarketIndex", + "outputs": [ + { + "internalType": "PoolMarketId", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "getPoolVTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSVTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "targetPoolId", + "type": "uint96" + } + ], + "name": "hasValidPoolBorrows", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "liquidateBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateVAICalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualMintAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oldLiquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "poolMarkets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "removePoolMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowerIndex", + "type": "uint256" + } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "seizeVenus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "borrowAllowed", + "type": "bool" + } + ], + "name": "setIsBorrowAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setMintedVAIOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "unlistMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusInitialIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/abi/Diamond.json b/simulations/vip-550/abi/Diamond.json new file mode 100644 index 000000000..16cf31e4a --- /dev/null +++ b/simulations/vip-550/abi/Diamond.json @@ -0,0 +1,509 @@ +[ + { + "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-550/abi/Liquidator.json b/simulations/vip-550/abi/Liquidator.json new file mode 100644 index 000000000..abd6265bb --- /dev/null +++ b/simulations/vip-550/abi/Liquidator.json @@ -0,0 +1,451 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "comptroller_", "type": "address" }, + { "internalType": "address payable", "name": "vBnb_", "type": "address" }, + { "internalType": "address", "name": "wBNB_", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "AllowlistEntryNotFound", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "AlreadyAllowed", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "borrower", "type": "address" }], + "name": "AlreadyRestricted", + "type": "error" + }, + { + "inputs": [{ "internalType": "uint256", "name": "errorCode", "type": "uint256" }], + "name": "LiquidationFailed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "LiquidationNotAllowed", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [{ "internalType": "address", "name": "borrower", "type": "address" }], + "name": "NoRestrictionsExist", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "maxTreasuryPercentMantissa", "type": "uint256" }, + { "internalType": "uint256", "name": "treasuryPercentMantissa_", "type": "uint256" } + ], + "name": "TreasuryPercentTooHigh", + "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": "uint256", "name": "vaiDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "minLiquidatableVAI", "type": "uint256" } + ], + "name": "VAIDebtTooHigh", + "type": "error" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "VTokenTransferFailed", + "type": "error" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "expected", "type": "uint256" }, + { "internalType": "uint256", "name": "actual", "type": "uint256" } + ], + "name": "WrongTransactionAmount", + "type": "error" + }, + { "inputs": [], "name": "ZeroAddressNotAllowed", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "AllowlistEntryAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "AllowlistEntryRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], + "name": "ForceVAILiquidationPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], + "name": "ForceVAILiquidationResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "liquidator", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "vTokenBorrowed", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "seizeTokensForTreasury", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "seizeTokensForLiquidator", "type": "uint256" } + ], + "name": "LiquidateBorrowedTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }], + "name": "LiquidationRestricted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "borrower", "type": "address" }], + "name": "LiquidationRestrictionsDisabled", + "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": false, "internalType": "uint256", "name": "oldPercent", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newPercent", "type": "uint256" } + ], + "name": "NewLiquidationTreasuryPercent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldMinLiquidatableVAI", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newMinLiquidatableVAI", "type": "uint256" } + ], + "name": "NewMinLiquidatableVAI", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldPendingRedeemChunkLength", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newPendingRedeemChunkLength", "type": "uint256" } + ], + "name": "NewPendingRedeemChunkLength", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "oldProtocolShareReserve", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newProtocolShareReserves", "type": "address" } + ], + "name": "NewProtocolShareReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reducedAmount", "type": "uint256" } + ], + "name": "ProtocolLiquidationIncentiveTransferred", + "type": "event" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "addToAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowedLiquidatorsByAccount", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptroller", + "outputs": [{ "internalType": "contract IComptroller", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "forceVAILiquidate", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "treasuryPercentMantissa_", "type": "uint256" }, + { "internalType": "address", "name": "accessControlManager_", "type": "address" }, + { "internalType": "address", "name": "protocolShareReserve_", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "vToken", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "contract IVToken", "name": "vTokenCollateral", "type": "address" } + ], + "name": "liquidateBorrow", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "liquidationRestricted", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableVAI", + "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": "pauseForceVAILiquidate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "pendingRedeem", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolShareReserve", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "reduceReserves", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "address", "name": "liquidator", "type": "address" } + ], + "name": "removeFromAllowlist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "borrower", "type": "address" }], + "name": "restrictLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeForceVAILiquidate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "minLiquidatableVAI_", "type": "uint256" }], + "name": "setMinLiquidatableVAI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newLength_", "type": "uint256" }], + "name": "setPendingRedeemChunkLength", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address payable", "name": "protocolShareReserve_", "type": "address" }], + "name": "setProtocolShareReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "newTreasuryPercentMantissa", "type": "uint256" }], + "name": "setTreasuryPercent", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryPercentMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "borrower", "type": "address" }], + "name": "unrestrictLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBnb", + "outputs": [{ "internalType": "contract IVBNB", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiController", + "outputs": [{ "internalType": "contract IVAIController", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wBNB", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/simulations/vip-550/abi/LiquidatorProxy.json b/simulations/vip-550/abi/LiquidatorProxy.json new file mode 100644 index 000000000..249ab61da --- /dev/null +++ b/simulations/vip-550/abi/LiquidatorProxy.json @@ -0,0 +1,72 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_logic", "type": "address" }, + { "internalType": "address", "name": "admin_", "type": "address" }, + { "internalType": "bytes", "name": "_data", "type": "bytes" } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "previousAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "beacon", "type": "address" }], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], + "name": "Upgraded", + "type": "event" + }, + { "stateMutability": "payable", "type": "fallback" }, + { + "inputs": [], + "name": "admin", + "outputs": [{ "internalType": "address", "name": "admin_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newAdmin", "type": "address" }], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [{ "internalType": "address", "name": "implementation_", "type": "address" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newImplementation", "type": "address" }, + { "internalType": "bytes", "name": "data", "type": "bytes" } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { "stateMutability": "payable", "type": "receive" } +] diff --git a/simulations/vip-550/abi/VAIController.json b/simulations/vip-550/abi/VAIController.json new file mode 100644 index 000000000..281d7e3dd --- /dev/null +++ b/simulations/vip-550/abi/VAIController.json @@ -0,0 +1,34 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "NewImplementation", + "type": "event" + }, + { + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/abi/VAIUnitroller.json b/simulations/vip-550/abi/VAIUnitroller.json new file mode 100644 index 000000000..99d02ff85 --- /dev/null +++ b/simulations/vip-550/abi/VAIUnitroller.json @@ -0,0 +1,122 @@ +[ + { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "error", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "info", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "detail", "type": "uint256" } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldImplementation", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newImplementation", "type": "address" } + ], + "name": "NewImplementation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldPendingAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingAdmin", "type": "address" } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldPendingImplementation", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingImplementation", "type": "address" } + ], + "name": "NewPendingImplementation", + "type": "event" + }, + { "payable": true, "stateMutability": "payable", "type": "fallback" }, + { + "constant": false, + "inputs": [], + "name": "_acceptAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "_acceptImplementation", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newPendingAdmin", "type": "address" }], + "name": "_setPendingAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newPendingImplementation", "type": "address" }], + "name": "_setPendingImplementation", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "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": "pendingVAIControllerImplementation", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "vaiControllerImplementation", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/abi/VBEP20Delegator.json b/simulations/vip-550/abi/VBEP20Delegator.json new file mode 100644 index 000000000..c0187a7ca --- /dev/null +++ b/simulations/vip-550/abi/VBEP20Delegator.json @@ -0,0 +1,688 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "underlying_", "type": "address" }, + { "internalType": "contract ComptrollerInterface", "name": "comptroller_", "type": "address" }, + { "internalType": "contract InterestRateModel", "name": "interestRateModel_", "type": "address" }, + { "internalType": "uint256", "name": "initialExchangeRateMantissa_", "type": "uint256" }, + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" }, + { "internalType": "uint8", "name": "decimals_", "type": "uint8" }, + { "internalType": "address payable", "name": "admin_", "type": "address" }, + { "internalType": "address", "name": "implementation_", "type": "address" }, + { "internalType": "bytes", "name": "becomeImplementationData", "type": "bytes" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "cashPrior", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "interestAccumulated", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "borrowIndex", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "AccrueInterest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "error", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "info", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "detail", "type": "uint256" } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "liquidator", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "vTokenCollateral", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "LiquidateBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "minter", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "mintAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "mintTokens", "type": "uint256" } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ComptrollerInterface", + "name": "oldComptroller", + "type": "address" + }, + { "indexed": false, "internalType": "contract ComptrollerInterface", "name": "newComptroller", "type": "address" } + ], + "name": "NewComptroller", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldImplementation", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newImplementation", "type": "address" } + ], + "name": "NewImplementation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract InterestRateModel", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "NewMarketInterestRateModel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldPendingAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingAdmin", "type": "address" } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "oldReserveFactorMantissa", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newReserveFactorMantissa", "type": "uint256" } + ], + "name": "NewReserveFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "redeemer", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "redeemTokens", "type": "uint256" } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "payer", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "borrower", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "accountBorrows", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalBorrows", "type": "uint256" } + ], + "name": "RepayBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "benefactor", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "addAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } + ], + "name": "ReservesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "admin", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "reduceAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "newTotalReserves", "type": "uint256" } + ], + "name": "ReservesReduced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { "payable": true, "stateMutability": "payable", "type": "fallback" }, + { + "constant": false, + "inputs": [], + "name": "_acceptAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "addAmount", "type": "uint256" }], + "name": "_addReserves", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "reduceAmount", "type": "uint256" }], + "name": "_reduceReserves", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "contract ComptrollerInterface", "name": "newComptroller", "type": "address" }], + "name": "_setComptroller", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "implementation_", "type": "address" }, + { "internalType": "bool", "name": "allowResign", "type": "bool" }, + { "internalType": "bytes", "name": "becomeImplementationData", "type": "bytes" } + ], + "name": "_setImplementation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "contract InterestRateModel", "name": "newInterestRateModel", "type": "address" }], + "name": "_setInterestRateModel", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address payable", "name": "newPendingAdmin", "type": "address" }], + "name": "_setPendingAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "newReserveFactorMantissa", "type": "uint256" }], + "name": "_setReserveFactor", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "accrueInterest", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "balanceOfUnderlying", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "borrowAmount", "type": "uint256" }], + "name": "borrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "borrowBalanceCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "borrowBalanceStored", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "comptroller", + "outputs": [{ "internalType": "contract ComptrollerInterface", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], + "name": "delegateToImplementation", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }], + "name": "delegateToViewImplementation", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "exchangeRateStored", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "getAccountSnapshot", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCash", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "implementation", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "interestRateModel", + "outputs": [{ "internalType": "contract InterestRateModel", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isVToken", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" }, + { "internalType": "contract VTokenInterface", "name": "vTokenCollateral", "type": "address" } + ], + "name": "liquidateBorrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "mintAmount", "type": "uint256" }], + "name": "mint", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "pendingAdmin", + "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "redeemTokens", "type": "uint256" }], + "name": "redeem", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "redeemAmount", "type": "uint256" }], + "name": "redeemUnderlying", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "uint256", "name": "repayAmount", "type": "uint256" }], + "name": "repayBorrow", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "repayAmount", "type": "uint256" } + ], + "name": "repayBorrowBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "liquidator", "type": "address" }, + { "internalType": "address", "name": "borrower", "type": "address" }, + { "internalType": "uint256", "name": "seizeTokens", "type": "uint256" } + ], + "name": "seize", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalBorrows", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalReserves", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { "internalType": "address", "name": "src", "type": "address" }, + { "internalType": "address", "name": "dst", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "underlying", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "payable": false, + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts new file mode 100644 index 000000000..4b5ed25cf --- /dev/null +++ b/simulations/vip-550/bsctestnet.ts @@ -0,0 +1,186 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { expectEvents, initMainnetUser } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { + ACM, + CORE_MARKETS, + CURRENT_LIQUIDATION_INCENTIVE, + LIQUIDATOR, + NEW_COMPTROLLER_LENS, + NEW_COMPT_METHODS, + NEW_DIAMOND, + NEW_LIQUIDATOR_IMPL, + NEW_VAI_CONTROLLER, + NEW_VBEP20_DELEGATE, + OLD_COMPTROLLER_LENS, + OLD_DIAMOND, + OLD_LIQUIDATOR_IMPL, + OLD_VAI_CONTROLLER, + PROXY_ADMIN, + UNITROLLER, + VAI_UNITROLLER, + vip550, +} from "../../vips/vip-550/bsctestnet"; +import ACM_ABI from "./abi/AccessControlManager.json"; +import COMPTROLLER_ABI from "./abi/Comptroller.json"; +import UNITROLLER_ABI from "./abi/Diamond.json"; +import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; +import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; +import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; +import { cutParams as params } from "./utils/bsctestnet-cut-params.json"; + +type CutParam = [string, number, string[]]; +const cutParams = params as unknown as CutParam[]; + +const OLD_SETTER_FACET = "0xb619F7ce96c0a6E3F0b44e993f663522F79f294A"; +const OLD_REWARD_FACET = "0x905006DCD5DbAa9B67359bcB341a0C49AfC8d0A6"; +const OLD_MARKET_FACET = "0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd"; +const OLD_POLICY_FACET = "0x671B787AEDB6769972f081C6ee4978146F7D92E6"; + +const NEW_SETTER_FACET = "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c"; +const NEW_REWARD_FACET = "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB"; +const NEW_MARKET_FACET = "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75"; +const NEW_POLICY_FACET = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; + +forking(63158889, async () => { + let unitroller: Contract; + let comptroller: Contract; + let accessControlManager: Contract; + let vaiUnitroller: Contract; + let liquidator: Contract; + let proxyAdmin: SignerWithAddress; + + before(async () => { + unitroller = await ethers.getContractAt(UNITROLLER_ABI, UNITROLLER); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, UNITROLLER); + accessControlManager = await ethers.getContractAt(ACM_ABI, ACM); + vaiUnitroller = await ethers.getContractAt(VAI_UNITROLLR_ABI, VAI_UNITROLLER); + liquidator = await ethers.getContractAt(LIQUIDATOR_PROXY_ABI, LIQUIDATOR); + proxyAdmin = await initMainnetUser(PROXY_ADMIN, parseUnits("2", 18)); + }); + + describe("Pre-VIP state", async () => { + it("unitroller should have old implementation", async () => { + expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(OLD_DIAMOND.toLowerCase()); + }); + + it("comptroller should have old comptrollerLens", async () => { + expect((await comptroller.comptrollerLens()).toLowerCase()).to.equal(OLD_COMPTROLLER_LENS.toLowerCase()); + }); + + it("VAI Unitroller should point to old VAI Controller", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(OLD_VAI_CONTROLLER); + }); + + it("Liquidator should point to old implementation", async () => { + const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); + expect(impl.toLowerCase()).to.equal(OLD_LIQUIDATOR_IMPL.toLowerCase()); + }); + }); + + testVip("VIP-550", await vip550(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents(txResponse, [UNITROLLER_ABI], ["DiamondCut"], [1]); + }, + }); + + describe("Post-VIP state", async () => { + it("unitroller should have new implementation", async () => { + expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(NEW_DIAMOND.toLowerCase()); + }); + + it("market facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[0][2], ...cutParams[1][2]]; + expect(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[2][2]]; + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[3][2]]; + + expect(await unitroller.facetFunctionSelectors(NEW_REWARD_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_REWARD_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[4][2], ...cutParams[5][2]]; + + expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); + }); + + it("unitroller should contain the new facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET, NEW_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_MARKET_FACET, NEW_POLICY_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(OLD_SETTER_FACET, OLD_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_MARKET_FACET, OLD_POLICY_FACET); + }); + + it("Check removed permission", async () => { + expect( + await accessControlManager.hasPermission( + NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, + UNITROLLER, + "_setCollateralFactor(address,uint256)", + ), + ).to.equal(false); + expect( + await accessControlManager.hasPermission( + NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, + UNITROLLER, + "_setLiquidationIncentive(uint256)", + ), + ).to.equal(false); + }); + + it("Check new permission", async () => { + for (const method of NEW_COMPT_METHODS) { + expect( + await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method), + ).to.equal(true); + } + }); + + it("comptroller should have new comptrollerLens", async () => { + expect((await comptroller.comptrollerLens()).toLowerCase()).to.equal(NEW_COMPTROLLER_LENS.toLowerCase()); + }); + + it("markets should have new implemenation", async () => { + for (const market of CORE_MARKETS) { + const marketContract = await ethers.getContractAt(VBEP20_DELEGATOR_ABI, market.address); + expect((await marketContract.implementation()).toLowerCase()).to.equal(NEW_VBEP20_DELEGATE.toLowerCase()); + } + }); + it("comptroller should have correct markets value", async () => { + for (const market of CORE_MARKETS) { + const data = await comptroller.markets(market.address); + expect(data[1]).to.be.equal(market.collateralFactor); + expect(data[3]).to.be.equal(market.collateralFactor); // same LT + expect(data[4]).to.be.equal(CURRENT_LIQUIDATION_INCENTIVE); + expect(data[5]).to.be.equal(0); // corePool + expect(data[6]).to.be.equal(true); // isBorrowAllowed + } + }); + it("VAI Controller should point to new impl", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(NEW_VAI_CONTROLLER); + }); + it("Liquidator should point to new implementation", async () => { + const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); + expect(impl.toLowerCase()).to.equal(NEW_LIQUIDATOR_IMPL.toLowerCase()); + }); + }); +}); diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json index bb1e0c310..ced97a326 100644 --- a/simulations/vip-550/utils/bsctestnet-cut-params.json +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -118,6 +118,6 @@ ] ], ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 0, ["0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8"]], - ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17", "0xa8431081"]] + ["0x0000000000000000000000000000000000000000", 2, ["0xe4028eee", "0x4fd42e17", "0xa8431081"]] ] } diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index ccf8aa492..86e814954 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -9,6 +9,7 @@ export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; export const VAI_UNITROLLER = "0xf70C3C6b749BbAb89C081737334E74C9aFD4BE16"; export const LIQUIDATOR = "0x55AEABa76ecf144031Ef64E222166eb28Cb4865F"; export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; +export const PROXY_ADMIN = "0x1469AeB2768931f979a1c957692e32Aa802dd55a"; export const NEW_VAI_CONTROLLER = "0x5361EeCB35Dbbf239F0AB3600e460bFdBa14c592"; export const NEW_DIAMOND = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; @@ -16,121 +17,121 @@ export const NEW_COMPTROLLER_LENS = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6" export const NEW_VBEP20_DELEGATE = "0xf292c8F321fF1BC49A3FeADf4D0971E519485e19"; export const NEW_LIQUIDATOR_IMPL = "0x0F30B2a844339b7bD2Be0D82298e82f44286A0cA"; +export const OLD_VAI_CONTROLLER = "0xDFcbfb82a416B5CEbB80FECFbBF4E055299931FF"; +export const OLD_DIAMOND = "0x1D5F9752bA40cF7047db2E24Cb6Aa196E3c334DA"; +export const OLD_COMPTROLLER_LENS = "0x350d56985A269C148648207E4Cea9f87656E762a"; +export const OLD_VBEP20_DELEGATE = "0xad6aa8Bb4829560412A94AA930745f407BF8000B"; +export const OLD_LIQUIDATOR_IMPL = "0x83372155dd4a4306af82795d5a27d40188ed1f3b"; + export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); export const NEW_COMPT_METHODS = [ - "createPool(string)", - "addPoolMarket(uint96,address)", - "removePoolMarket(uint96,address)", - "setCollateralFactor(address,uint256,uint256)", - "setCollateralFactor(uint96,address,uint256,uint256)", "setLiquidationIncentive(address,uint256)", - "setLiquidationIncentive(uint96,address,uint256)", "setIsBorrowAllowed(uint96,address,bool)", ]; export const CORE_MARKETS = [ - { - symbol: "vUSDC", - address: "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", - collateralFactor: 810000000000000000n, - }, - { - symbol: "vUSDT", - address: "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", - collateralFactor: 800000000000000000n, - }, - { - symbol: "vBUSD", - address: "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", - collateralFactor: 0n, - }, - { - symbol: "vSXP", - address: "0x74469281310195A04840Daf6EdF576F559a3dE80", - collateralFactor: 500000000000000000n, - }, - { - symbol: "vBNB", - address: "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", - collateralFactor: 800000000000000000n, - }, - { - symbol: "Venus XVS", - address: "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vETH", - address: "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", - collateralFactor: 800000000000000000n, - }, - { - symbol: "vLTC", - address: "0xAfc13BC065ABeE838540823431055D2ea52eBA52", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vXRP", - address: "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vBTC", - address: "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", - collateralFactor: 800000000000000000n, - }, - { - symbol: "vADA", - address: "0x37C28DE42bA3d22217995D146FC684B2326Ede64", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vDOGE", - address: "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", - collateralFactor: 800000000000000000n, - }, - { - symbol: "vCAKE", - address: "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vMATIC", - address: "0x3619bdDc61189F33365CC572DF3a68FB3b316516", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vAAVE", - address: "0x714db6c38A17883964B68a07d56cE331501d9eb6", - collateralFactor: 550000000000000000n, - }, + // { + // symbol: "vUSDC", + // address: "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", + // collateralFactor: 810000000000000000n, + // }, + // { + // symbol: "vUSDT", + // address: "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", + // collateralFactor: 800000000000000000n, + // }, + // { + // symbol: "vBUSD", + // address: "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", + // collateralFactor: 0n, + // }, + // { + // symbol: "vSXP", + // address: "0x74469281310195A04840Daf6EdF576F559a3dE80", + // collateralFactor: 500000000000000000n, + // }, + // { + // symbol: "vBNB", + // address: "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", + // collateralFactor: 800000000000000000n, + // }, + // { + // symbol: "Venus XVS", + // address: "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vETH", + // address: "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", + // collateralFactor: 800000000000000000n, + // }, + // { + // symbol: "vLTC", + // address: "0xAfc13BC065ABeE838540823431055D2ea52eBA52", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vXRP", + // address: "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vBTC", + // address: "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", + // collateralFactor: 800000000000000000n, + // }, + // { + // symbol: "vADA", + // address: "0x37C28DE42bA3d22217995D146FC684B2326Ede64", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vDOGE", + // address: "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", + // collateralFactor: 800000000000000000n, + // }, + // { + // symbol: "vCAKE", + // address: "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vMATIC", + // address: "0x3619bdDc61189F33365CC572DF3a68FB3b316516", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vAAVE", + // address: "0x714db6c38A17883964B68a07d56cE331501d9eb6", + // collateralFactor: 550000000000000000n, + // }, { symbol: "vTUSDOLD", address: "0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0", collateralFactor: 550000000000000000n, }, - { - symbol: "vTRXOLD", - address: "0x369Fea97f6fB7510755DCA389088d9E2e2819278", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vTRX", - address: "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", - collateralFactor: 600000000000000000n, - }, - { - symbol: "vWBETH", - address: "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", - collateralFactor: 500000000000000000n, - }, - { - symbol: "vTUSD", - address: "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", - collateralFactor: 0n, - }, + // { + // symbol: "vTRXOLD", + // address: "0x369Fea97f6fB7510755DCA389088d9E2e2819278", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vTRX", + // address: "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", + // collateralFactor: 600000000000000000n, + // }, + // { + // symbol: "vWBETH", + // address: "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", + // collateralFactor: 500000000000000000n, + // }, + // { + // symbol: "vTUSD", + // address: "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", + // collateralFactor: 0n, + // }, { symbol: "vUNI", address: "0x171B468b52d7027F12cEF90cd065d6776a25E24e", @@ -191,16 +192,16 @@ export const CORE_MARKETS = [ address: "0x97cB97B05697c377C0bd09feDce67DBd86B7aB1e", collateralFactor: 720000000000000000n, }, - { - symbol: "vasBNB", - address: "0x73F506Aefd5e169D48Ea21A373B9B0a200E37585", - collateralFactor: 720000000000000000n, - }, - { - symbol: "vUSDF", - address: "0x140d5Da2cE9fb9A8725cabdDB2Fe8ea831342C78", - collateralFactor: 600000000000000000n, - }, + // { + // symbol: "vasBNB", + // address: "0x73F506Aefd5e169D48Ea21A373B9B0a200E37585", + // collateralFactor: 720000000000000000n, + // }, + // { + // symbol: "vUSDF", + // address: "0x140d5Da2cE9fb9A8725cabdDB2Fe8ea831342C78", + // collateralFactor: 600000000000000000n, + // }, ]; export const vip550 = () => { @@ -242,7 +243,7 @@ export const vip550 = () => { }, ...NEW_COMPT_METHODS.map(method => { return { - target: UNITROLLER, + target: ACM, signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], }; @@ -277,7 +278,7 @@ export const vip550 = () => { return { target: UNITROLLER, signature: "setIsBorrowAllowed(uint96,address,bool)", - params: [0, vToken, true], + params: [0, vToken.address, true], }; }), { @@ -291,9 +292,9 @@ export const vip550 = () => { params: [VAI_UNITROLLER], }, { - target: LIQUIDATOR, - signature: "upgradeTo(address)", - params: [NEW_LIQUIDATOR_IMPL], + target: PROXY_ADMIN, + signature: "upgrade(address,address)", + params: [LIQUIDATOR, NEW_LIQUIDATOR_IMPL], }, { target: LIQUIDATOR, From 2f3f989c4939d5e71b83855fab76b80428267497 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 1 Sep 2025 19:49:21 +0530 Subject: [PATCH 04/24] fix: resolve oracle price and command limit errors --- simulations/vip-550/abi/Unitroller.json | 122 ++++++++ simulations/vip-550/bsctestnet.ts | 90 +++++- vips/vip-550/bsctestnet.ts | 369 +++++++++++++++--------- 3 files changed, 431 insertions(+), 150 deletions(-) create mode 100644 simulations/vip-550/abi/Unitroller.json diff --git a/simulations/vip-550/abi/Unitroller.json b/simulations/vip-550/abi/Unitroller.json new file mode 100644 index 000000000..ab07e1b7c --- /dev/null +++ b/simulations/vip-550/abi/Unitroller.json @@ -0,0 +1,122 @@ +[ + { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "error", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "info", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "detail", "type": "uint256" } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAdmin", "type": "address" } + ], + "name": "NewAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldImplementation", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newImplementation", "type": "address" } + ], + "name": "NewImplementation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldPendingAdmin", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingAdmin", "type": "address" } + ], + "name": "NewPendingAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldPendingImplementation", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newPendingImplementation", "type": "address" } + ], + "name": "NewPendingImplementation", + "type": "event" + }, + { "payable": true, "stateMutability": "payable", "type": "fallback" }, + { + "constant": false, + "inputs": [], + "name": "_acceptAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "_acceptImplementation", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newPendingAdmin", "type": "address" }], + "name": "_setPendingAdmin", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [{ "internalType": "address", "name": "newPendingImplementation", "type": "address" }], + "name": "_setPendingImplementation", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "admin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "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": "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" + } +] diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 4b5ed25cf..1f0b89660 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -5,14 +5,22 @@ import { Contract } from "ethers"; import { parseUnits } from "ethers/lib/utils"; import { ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "src/networkAddresses"; -import { expectEvents, initMainnetUser } from "src/utils"; +import { + expectEvents, + initMainnetUser, + setMaxStalePeriodInBinanceOracle, + setMaxStalePeriodInChainlinkOracle, +} from "src/utils"; import { forking, testVip } from "src/vip-framework"; import { ACM, CORE_MARKETS, + CORE_MARKETS_WITHOUT_VBNB, CURRENT_LIQUIDATION_INCENTIVE, LIQUIDATOR, + LIQUIDATOR_PROXY_ADMIN, + MARKET_CONFIGURATION_AGGREGATOR, NEW_COMPTROLLER_LENS, NEW_COMPT_METHODS, NEW_DIAMOND, @@ -23,15 +31,16 @@ import { OLD_DIAMOND, OLD_LIQUIDATOR_IMPL, OLD_VAI_CONTROLLER, - PROXY_ADMIN, UNITROLLER, VAI_UNITROLLER, vip550, } from "../../vips/vip-550/bsctestnet"; import ACM_ABI from "./abi/AccessControlManager.json"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; -import UNITROLLER_ABI from "./abi/Diamond.json"; +import DIAMOND_ABI from "./abi/Diamond.json"; +import LIQUIDATOR_ABI from "./abi/Liquidator.json"; import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; +import UNITROLLER_ABI from "./abi/Unitroller.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; import { cutParams as params } from "./utils/bsctestnet-cut-params.json"; @@ -49,7 +58,7 @@ const NEW_REWARD_FACET = "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB"; const NEW_MARKET_FACET = "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75"; const NEW_POLICY_FACET = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; -forking(63158889, async () => { +forking(63848748, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; @@ -58,12 +67,34 @@ forking(63158889, async () => { let proxyAdmin: SignerWithAddress; before(async () => { - unitroller = await ethers.getContractAt(UNITROLLER_ABI, UNITROLLER); + unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); comptroller = await ethers.getContractAt(COMPTROLLER_ABI, UNITROLLER); accessControlManager = await ethers.getContractAt(ACM_ABI, ACM); vaiUnitroller = await ethers.getContractAt(VAI_UNITROLLR_ABI, VAI_UNITROLLER); liquidator = await ethers.getContractAt(LIQUIDATOR_PROXY_ABI, LIQUIDATOR); - proxyAdmin = await initMainnetUser(PROXY_ADMIN, parseUnits("2", 18)); + proxyAdmin = await initMainnetUser(LIQUIDATOR_PROXY_ADMIN, parseUnits("2", 18)); + console.log(`Setting max stale period...`); + for (const market of CORE_MARKETS) { + // Call function with default feed = AddressZero (so it fetches from oracle.tokenConfigs) + await setMaxStalePeriodInChainlinkOracle( + NETWORK_ADDRESSES.bsctestnet.CHAINLINK_ORACLE, + market.asset, + ethers.constants.AddressZero, + NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, + 315360000, + ); + + await setMaxStalePeriodInChainlinkOracle( + NETWORK_ADDRESSES.bsctestnet.REDSTONE_ORACLE, + market.asset, + ethers.constants.AddressZero, + NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, + 315360000, + ); + } + await setMaxStalePeriodInBinanceOracle(NETWORK_ADDRESSES.bsctestnet.BINANCE_ORACLE, "WBETH", 315360000); + await setMaxStalePeriodInBinanceOracle(NETWORK_ADDRESSES.bsctestnet.BINANCE_ORACLE, "TWT", 315360000); + await setMaxStalePeriodInBinanceOracle(NETWORK_ADDRESSES.bsctestnet.BINANCE_ORACLE, "lisUSD", 315360000); }); describe("Pre-VIP state", async () => { @@ -87,13 +118,25 @@ forking(63158889, async () => { testVip("VIP-550", await vip550(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { - await expectEvents(txResponse, [UNITROLLER_ABI], ["DiamondCut"], [1]); + const totalMarkets = CORE_MARKETS_WITHOUT_VBNB.length; + const totalNewMethods = NEW_COMPT_METHODS.length; + await expectEvents(txResponse, [UNITROLLER_ABI], ["NewPendingImplementation"], [4]); + await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 2]); // +2 for unitroller and VAI + await expectEvents(txResponse, [DIAMOND_ABI], ["DiamondCut"], [1]); + await expectEvents(txResponse, [ACM_ABI], ["PermissionGranted", "PermissionRevoked"], [totalNewMethods + 3, 5]); + await expectEvents( + txResponse, + [COMPTROLLER_ABI], + ["NewLiquidationThreshold", "NewLiquidationIncentive", "BorrowAllowedUpdated"], + [totalMarkets - 2, totalMarkets + 1, totalMarkets + 1], // +1 for vBNB, -3 for markets with 0 collateral factor + ); + await expectEvents(txResponse, [LIQUIDATOR_ABI], ["NewLiquidationTreasuryPercent"], [1]); }, }); describe("Post-VIP state", async () => { it("unitroller should have new implementation", async () => { - expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(NEW_DIAMOND.toLowerCase()); + expect(await unitroller.comptrollerImplementation()).equals(NEW_DIAMOND); }); it("market facet function selectors should be replaced with new facet address", async () => { @@ -160,11 +203,12 @@ forking(63158889, async () => { }); it("markets should have new implemenation", async () => { - for (const market of CORE_MARKETS) { + for (const market of CORE_MARKETS_WITHOUT_VBNB) { const marketContract = await ethers.getContractAt(VBEP20_DELEGATOR_ABI, market.address); - expect((await marketContract.implementation()).toLowerCase()).to.equal(NEW_VBEP20_DELEGATE.toLowerCase()); + expect(await marketContract.implementation()).equals(NEW_VBEP20_DELEGATE); } }); + it("comptroller should have correct markets value", async () => { for (const market of CORE_MARKETS) { const data = await comptroller.markets(market.address); @@ -175,12 +219,38 @@ forking(63158889, async () => { expect(data[6]).to.be.equal(true); // isBorrowAllowed } }); + it("VAI Controller should point to new impl", async () => { expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(NEW_VAI_CONTROLLER); }); + it("Liquidator should point to new implementation", async () => { const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); expect(impl.toLowerCase()).to.equal(NEW_LIQUIDATOR_IMPL.toLowerCase()); }); + + it("MarketConfigurationAggregator should not have ACM permissions", async () => { + expect( + await accessControlManager.hasPermission( + MARKET_CONFIGURATION_AGGREGATOR, + UNITROLLER, + "setCollateralFactor(address,uint256,uint256)", + ), + ).to.equal(false); + expect( + await accessControlManager.hasPermission( + MARKET_CONFIGURATION_AGGREGATOR, + UNITROLLER, + "setLiquidationIncentive(address,uint256)", + ), + ).to.equal(false); + expect( + await accessControlManager.hasPermission( + MARKET_CONFIGURATION_AGGREGATOR, + UNITROLLER, + "setIsBorrowAllowed(uint96,address,bool)", + ), + ).to.equal(false); + }); }); }); diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 86e814954..0d05d9c6a 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -9,7 +9,7 @@ export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; export const VAI_UNITROLLER = "0xf70C3C6b749BbAb89C081737334E74C9aFD4BE16"; export const LIQUIDATOR = "0x55AEABa76ecf144031Ef64E222166eb28Cb4865F"; export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; -export const PROXY_ADMIN = "0x1469AeB2768931f979a1c957692e32Aa802dd55a"; +export const LIQUIDATOR_PROXY_ADMIN = "0x1469AeB2768931f979a1c957692e32Aa802dd55a"; export const NEW_VAI_CONTROLLER = "0x5361EeCB35Dbbf239F0AB3600e460bFdBa14c592"; export const NEW_DIAMOND = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; @@ -22,6 +22,8 @@ export const OLD_DIAMOND = "0x1D5F9752bA40cF7047db2E24Cb6Aa196E3c334DA"; export const OLD_COMPTROLLER_LENS = "0x350d56985A269C148648207E4Cea9f87656E762a"; export const OLD_VBEP20_DELEGATE = "0xad6aa8Bb4829560412A94AA930745f407BF8000B"; export const OLD_LIQUIDATOR_IMPL = "0x83372155dd4a4306af82795d5a27d40188ed1f3b"; +export const MARKET_CONFIGURATION_AGGREGATOR = "0x091bF95157928D8008C5c1D605b483B5F46F6305"; +export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); @@ -29,181 +31,235 @@ export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); export const NEW_COMPT_METHODS = [ "setLiquidationIncentive(address,uint256)", "setIsBorrowAllowed(uint96,address,bool)", + "createPool(string)", + "addPoolMarket(uint96,address)", + "removePoolMarket(uint96,address)", + "setCollateralFactor(uint96,address,uint256,uint256)", + "setLiquidationIncentive(uint96,address,uint256)", ]; export const CORE_MARKETS = [ - // { - // symbol: "vUSDC", - // address: "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", - // collateralFactor: 810000000000000000n, - // }, - // { - // symbol: "vUSDT", - // address: "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", - // collateralFactor: 800000000000000000n, - // }, - // { - // symbol: "vBUSD", - // address: "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", - // collateralFactor: 0n, - // }, - // { - // symbol: "vSXP", - // address: "0x74469281310195A04840Daf6EdF576F559a3dE80", - // collateralFactor: 500000000000000000n, - // }, - // { - // symbol: "vBNB", - // address: "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", - // collateralFactor: 800000000000000000n, - // }, - // { - // symbol: "Venus XVS", - // address: "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vETH", - // address: "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", - // collateralFactor: 800000000000000000n, - // }, - // { - // symbol: "vLTC", - // address: "0xAfc13BC065ABeE838540823431055D2ea52eBA52", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vXRP", - // address: "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vBTC", - // address: "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", - // collateralFactor: 800000000000000000n, - // }, - // { - // symbol: "vADA", - // address: "0x37C28DE42bA3d22217995D146FC684B2326Ede64", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vDOGE", - // address: "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", - // collateralFactor: 800000000000000000n, - // }, - // { - // symbol: "vCAKE", - // address: "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vMATIC", - // address: "0x3619bdDc61189F33365CC572DF3a68FB3b316516", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vAAVE", - // address: "0x714db6c38A17883964B68a07d56cE331501d9eb6", - // collateralFactor: 550000000000000000n, - // }, + { + symbol: "vUSDC", + address: "0xD5C4C2e2facBEB59D0216D0595d63FcDc6F9A1a7", + asset: "0x16227D60f7a0e586C66B005219dfc887D13C9531", + collateralFactor: 810000000000000000n, + }, + { + symbol: "vUSDT", + address: "0xb7526572FFE56AB9D7489838Bf2E18e3323b441A", + asset: "0xA11c8D9DC9b66E209Ef60F0C8D969D3CD988782c", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vBUSD", + address: "0x08e0A5575De71037aE36AbfAfb516595fE68e5e4", + asset: "0x8301F2213c0eeD49a7E28Ae4c3e91722919B8B47", + collateralFactor: 0n, + }, + { + symbol: "vSXP", + address: "0x74469281310195A04840Daf6EdF576F559a3dE80", + asset: "0x75107940Cf1121232C0559c747A986DEfbc69DA9", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vBNB", + address: "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", + asset: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + collateralFactor: 800000000000000000n, + }, + { + symbol: "Venus XVS", + address: "0x6d6F697e34145Bb95c54E77482d97cc261Dc237E", + asset: "0xB9e0E753630434d7863528cc73CB7AC638a7c8ff", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vETH", + address: "0x162D005F0Fff510E54958Cfc5CF32A3180A84aab", + asset: "0x98f7A83361F7Ac8765CcEBAB1425da6b341958a7", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vLTC", + address: "0xAfc13BC065ABeE838540823431055D2ea52eBA52", + asset: "0x969F147B6b8D81f86175de33206A4FD43dF17913", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vXRP", + address: "0x488aB2826a154da01CC4CC16A8C83d4720D3cA2C", + asset: "0x3022A32fdAdB4f02281E8Fab33e0A6811237aab0", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vBTC", + address: "0xb6e9322C49FD75a367Fcb17B0Fcd62C5070EbCBe", + asset: "0xA808e341e8e723DC6BA0Bb5204Bafc2330d7B8e4", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vADA", + address: "0x37C28DE42bA3d22217995D146FC684B2326Ede64", + asset: "0xcD34BC54106bd45A04Ed99EBcC2A6a3e70d7210F", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vDOGE", + address: "0xF912d3001CAf6DC4ADD366A62Cc9115B4303c9A9", + asset: "0x67D262CE2b8b846d9B94060BC04DC40a83F0e25B", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vCAKE", + address: "0xeDaC03D29ff74b5fDc0CC936F6288312e1459BC6", + asset: "0xe8bd7cCC165FAEb9b81569B05424771B9A20cbEF", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vMATIC", + address: "0x3619bdDc61189F33365CC572DF3a68FB3b316516", + asset: "0xcfeb0103d4BEfa041EA4c2dACce7B3E83E1aE7E3", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vAAVE", + address: "0x714db6c38A17883964B68a07d56cE331501d9eb6", + asset: "0x4B7268FC7C727B88c5Fc127D41b491BfAe63e144", + collateralFactor: 550000000000000000n, + }, { symbol: "vTUSDOLD", address: "0x3A00d9B02781f47d033BAd62edc55fBF8D083Fb0", + asset: "0xFeC3A63401Eb9C1476200d7C32c4009Be0154169", collateralFactor: 550000000000000000n, }, - // { - // symbol: "vTRXOLD", - // address: "0x369Fea97f6fB7510755DCA389088d9E2e2819278", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vTRX", - // address: "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", - // collateralFactor: 600000000000000000n, - // }, - // { - // symbol: "vWBETH", - // address: "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", - // collateralFactor: 500000000000000000n, - // }, - // { - // symbol: "vTUSD", - // address: "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", - // collateralFactor: 0n, - // }, + { + symbol: "vTRXOLD", + address: "0x369Fea97f6fB7510755DCA389088d9E2e2819278", + asset: "0x19E7215abF8B2716EE807c9f4b83Af0e7f92653F", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vTRX", + address: "0x6AF3Fdb3282c5bb6926269Db10837fa8Aec67C04", + asset: "0x7D21841DC10BA1C5797951EFc62fADBBDD06704B", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vWBETH", + address: "0x35566ED3AF9E537Be487C98b1811cDf95ad0C32b", + asset: "0xf9F98365566F4D55234f24b99caA1AfBE6428D44", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vTUSD", + address: "0xEFAACF73CE2D38ED40991f29E72B12C74bd4cf23", + asset: "0xB32171ecD878607FFc4F8FC0bCcE6852BB3149E0", + collateralFactor: 0n, + }, { symbol: "vUNI", address: "0x171B468b52d7027F12cEF90cd065d6776a25E24e", + asset: "0x8D2f061C75780d8D91c10A7230B907411aCBC8fC", collateralFactor: 550000000000000000n, }, { symbol: "vFDUSD", address: "0xF06e662a00796c122AaAE935EC4F0Be3F74f5636", + asset: "0xcF27439fA231af9931ee40c4f27Bb77B83826F3C", collateralFactor: 750000000000000000n, }, { symbol: "vSolvBTC", address: "0xA38110ae4451A86ab754695057d5B5a9BEAd0387", + asset: "0x6855E14A6df91b8E4D55163d068E9ef2530fd4CE", collateralFactor: 750000000000000000n, }, { + // Binance symbol: "vTWT", address: "0x95DaED37fdD3F557b3A5cCEb7D50Be65b36721DF", + asset: "0xb99c6b26fdf3678c6e2aff8466e3625a0e7182f8", collateralFactor: 500000000000000000n, }, { symbol: "vTHE", address: "0x39A239F5117BFaC7a1b0b3A517c454113323451d", + asset: "0x952653d23cB9bef19E442D2BF8fBc8843A968052", collateralFactor: 530000000000000000n, }, { symbol: "vSOL", address: "0xbd9EB061444665Df7282Ec0888b72D60aC41Eb8C", + asset: "0xC337Dd0390FdFD0Ee5D2b682E425986EDD7b59da", collateralFactor: 720000000000000000n, }, { + // BINANCE symbol: "vlisUSD", address: "0x9447b1D4Bd192f25416B6aCc3B7f06be2f7D6309", + asset: "0xe73774DfCD551BF75650772dC2cC56a2B6323453", collateralFactor: 550000000000000000n, }, + { - symbol: "vPT-sUSDE-26JUN2025", - address: "0x90535B06ddB00453a5e5f2bC094d498F1cc86032", - collateralFactor: 700000000000000000n, + symbol: "vUSDe", + address: "0x86f8DfB7CA84455174EE9C3edd94867b51Da46BD", + asset: "0x986C30591f5aAb401ea3aa63aFA595608721B1B9", + collateralFactor: 750000000000000000n, }, { symbol: "vsUSDe", address: "0x8c8A1a0b6e1cb8058037F7bF24de6b79Aca5B7B0", + asset: "0xcFec590e417Abb378cfEfE6296829E35fa25cEbd", collateralFactor: 750000000000000000n, }, { - symbol: "vUSDe", - address: "0x86f8DfB7CA84455174EE9C3edd94867b51Da46BD", - collateralFactor: 750000000000000000n, + symbol: "vPT-sUSDE-26JUN2025", + address: "0x90535B06ddB00453a5e5f2bC094d498F1cc86032", + asset: "0x95e58161BA2423c3034658d957F3f5b94DeAbf81", + collateralFactor: 700000000000000000n, }, { symbol: "vUSD1", address: "0x519e61D2CDA04184FB086bbD2322C1bfEa0917Cf", + asset: "0x7792af341a10ccc4B1CDd7B317F0460a37346a0A", collateralFactor: 0n, }, { symbol: "vxSolvBTC", address: "0x97cB97B05697c377C0bd09feDce67DBd86B7aB1e", + asset: "0x3ea87323806586A0282b50377e0FEa76070F532B", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vasBNB", + address: "0x73F506Aefd5e169D48Ea21A373B9B0a200E37585", + asset: "0xc625f060ad25f4A6c2d9eBF30C133dB61B7AF072", collateralFactor: 720000000000000000n, }, - // { - // symbol: "vasBNB", - // address: "0x73F506Aefd5e169D48Ea21A373B9B0a200E37585", - // collateralFactor: 720000000000000000n, - // }, - // { - // symbol: "vUSDF", - // address: "0x140d5Da2cE9fb9A8725cabdDB2Fe8ea831342C78", - // collateralFactor: 600000000000000000n, - // }, + { + symbol: "vUSDF", + address: "0x140d5Da2cE9fb9A8725cabdDB2Fe8ea831342C78", + asset: "0xC7a2b79432Fd3e3d5bd2d96A456c734AB93A0484", + collateralFactor: 600000000000000000n, + }, ]; +export const CORE_MARKETS_WITHOUT_VBNB = CORE_MARKETS.filter(market => market.symbol != "vBNB"); + +export const MARKETS_CF_LT = CORE_MARKETS.map(market => [ + market.address, + market.collateralFactor, + market.collateralFactor, +]); + +export const MARKETS_LI = CORE_MARKETS.map(market => [market.address, CURRENT_LIQUIDATION_INCENTIVE]); + +export const MARKETS_BA = CORE_MARKETS.map(market => [0, market.address, true]); + export const vip550 = () => { const meta = { version: "v2", @@ -241,6 +297,12 @@ export const vip550 = () => { signature: "revokeCallPermission(address,string,address)", params: [UNITROLLER, "_setLiquidationIncentive(uint256)", NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], }, + { + target: UNITROLLER, + signature: "_setComptrollerLens(address)", + params: [NEW_COMPTROLLER_LENS], + }, + ...NEW_COMPT_METHODS.map(method => { return { target: ACM, @@ -248,39 +310,66 @@ export const vip550 = () => { params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], }; }), - { - target: UNITROLLER, - signature: "_setComptrollerLens(address)", - params: [NEW_COMPTROLLER_LENS], - }, - ...CORE_MARKETS.map(vToken => { + + ...CORE_MARKETS_WITHOUT_VBNB.map(vToken => { return { target: vToken.address, signature: "_setImplementation(address,bool,bytes)", params: [NEW_VBEP20_DELEGATE, false, "0x"], }; }), - ...CORE_MARKETS.map(vToken => { - return { - target: UNITROLLER, - signature: "setCollateralFactor(address,uint256,uint256)", - params: [vToken.address, vToken.collateralFactor, vToken.collateralFactor], - }; - }), - ...CORE_MARKETS.map(vToken => { - return { - target: UNITROLLER, - signature: "setLiquidationIncentive(address,uint256)", - params: [vToken.address, CURRENT_LIQUIDATION_INCENTIVE], - }; - }), - ...CORE_MARKETS.map(vToken => { - return { - target: UNITROLLER, - signature: "setIsBorrowAllowed(uint96,address,bool)", - params: [0, vToken.address, true], - }; - }), + + // give temporary permission + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setCollateralFactor(address,uint256,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setLiquidationIncentive(address,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setIsBorrowAllowed(uint96,address,bool)", MARKET_CONFIGURATION_AGGREGATOR], + }, + + // execute in batch + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeCollateralFactorBatch((address,uint256,uint256)[])", + params: [MARKETS_CF_LT], + }, + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeLiquidationIncentiveBatch((address,uint256)[])", + params: [MARKETS_LI], + }, + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeBorrowAllowedBatch((uint96,address,bool)[])", + params: [MARKETS_BA], + }, + + // remove temporary permissions + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setCollateralFactor(address,uint256,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setLiquidationIncentive(address,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setIsBorrowAllowed(uint96,address,bool)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { target: VAI_UNITROLLER, signature: "_setPendingImplementation(address)", @@ -292,7 +381,7 @@ export const vip550 = () => { params: [VAI_UNITROLLER], }, { - target: PROXY_ADMIN, + target: LIQUIDATOR_PROXY_ADMIN, signature: "upgrade(address,address)", params: [LIQUIDATOR, NEW_LIQUIDATOR_IMPL], }, From 2db8c8d3c0c8bf7c09e6a7051597b747b3885b28 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 2 Sep 2025 11:32:26 +0530 Subject: [PATCH 05/24] chore: remove unused variable and file --- simulations/vip-550/abi/VAIController.json | 34 ---------------------- simulations/vip-550/bsctestnet.ts | 6 ++-- vips/vip-550/bsctestnet.ts | 1 - 3 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 simulations/vip-550/abi/VAIController.json diff --git a/simulations/vip-550/abi/VAIController.json b/simulations/vip-550/abi/VAIController.json deleted file mode 100644 index 281d7e3dd..000000000 --- a/simulations/vip-550/abi/VAIController.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldImplementation", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "NewImplementation", - "type": "event" - }, - { - "inputs": [], - "name": "comptrollerImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 1f0b89660..137b2b6e5 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -146,21 +146,19 @@ forking(63848748, async () => { }); it("policy facet function selectors should be replaced with new facet address", async () => { - const functionSelectors = [...cutParams[2][2]]; + const functionSelectors = cutParams[2][2]; expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal(functionSelectors); expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); }); it("reward facet function selectors should be replaced with new facet address", async () => { - const functionSelectors = [...cutParams[3][2]]; - + const functionSelectors = cutParams[3][2]; expect(await unitroller.facetFunctionSelectors(NEW_REWARD_FACET)).to.deep.equal(functionSelectors); expect(await unitroller.facetFunctionSelectors(OLD_REWARD_FACET)).to.deep.equal([]); }); it("setter facet function selectors should be replaced with new facet address", async () => { const functionSelectors = [...cutParams[4][2], ...cutParams[5][2]]; - expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal(functionSelectors); expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); }); diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 0d05d9c6a..77bbba518 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -23,7 +23,6 @@ export const OLD_COMPTROLLER_LENS = "0x350d56985A269C148648207E4Cea9f87656E762a" export const OLD_VBEP20_DELEGATE = "0xad6aa8Bb4829560412A94AA930745f407BF8000B"; export const OLD_LIQUIDATOR_IMPL = "0x83372155dd4a4306af82795d5a27d40188ed1f3b"; export const MARKET_CONFIGURATION_AGGREGATOR = "0x091bF95157928D8008C5c1D605b483B5F46F6305"; -export const DEFAULT_ADMIN_ROLE = "0x0000000000000000000000000000000000000000000000000000000000000000"; export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); From 62aed2214f00dd8453ca9e6545df40a6290d059e Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Thu, 11 Sep 2025 14:56:19 +0530 Subject: [PATCH 06/24] fix: update deployed contracts --- simulations/vip-550/abi/Comptroller.json | 257 +++++++++++++++++- simulations/vip-550/abi/OldComptroller.json | 4 + simulations/vip-550/bsctestnet.ts | 68 +++-- .../vip-550/utils/bsctestnet-cut-params.json | 16 +- vips/vip-550/bsctestnet.ts | 40 ++- 5 files changed, 335 insertions(+), 50 deletions(-) create mode 100644 simulations/vip-550/abi/OldComptroller.json diff --git a/simulations/vip-550/abi/Comptroller.json b/simulations/vip-550/abi/Comptroller.json index 666c24cbe..c613fec73 100644 --- a/simulations/vip-550/abi/Comptroller.json +++ b/simulations/vip-550/abi/Comptroller.json @@ -1,9 +1,4 @@ [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, { "inputs": [], "name": "AlreadyInSelectedPool", @@ -21,12 +16,18 @@ }, { "inputs": [], - "name": "CorePoolModificationNotAllowed", + "name": "EmptyPoolLabel", "type": "error" }, { - "inputs": [], - "name": "EmptyPoolLabel", + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "InactivePool", "type": "error" }, { @@ -34,6 +35,11 @@ "name": "IncompatibleBorrowedAssets", "type": "error" }, + { + "inputs": [], + "name": "InvalidOperationForCorePool", + "type": "error" + }, { "inputs": [ { @@ -170,7 +176,13 @@ { "indexed": false, "internalType": "bool", - "name": "isAllowed", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", "type": "bool" } ], @@ -202,6 +214,36 @@ "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": [ @@ -526,6 +568,12 @@ "name": "poolId", "type": "uint96" }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, { "indexed": false, "internalType": "uint256", @@ -845,6 +893,31 @@ "name": "NewXVSVToken", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolActiveStatusUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1003,6 +1076,10 @@ "name": "VenusSupplySpeedUpdated", "type": "event" }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, { "inputs": [ { @@ -1857,6 +1934,36 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "diamondCut_", + "type": "tuple[]" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1908,6 +2015,113 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "functionSelectorPosition", + "type": "uint96" + } + ], + "internalType": "struct ComptrollerV13Storage.FacetAddressAndPosition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2791,7 +3005,7 @@ }, { "internalType": "uint256", - "name": "maxLiquidationIncentiveMantissa", + "name": "liquidationIncentiveMantissa", "type": "uint256" }, { @@ -2822,6 +3036,11 @@ "internalType": "string", "name": "label", "type": "string" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" } ], "stateMutability": "view", @@ -3376,6 +3595,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setPoolActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { diff --git a/simulations/vip-550/abi/OldComptroller.json b/simulations/vip-550/abi/OldComptroller.json new file mode 100644 index 000000000..7f21d6beb --- /dev/null +++ b/simulations/vip-550/abi/OldComptroller.json @@ -0,0 +1,4 @@ +[ + "function markets(address vToken) external view returns (bool isListed, uint256 CF)", + "function liquidationIncentiveMantissa() external view returns (uint256)" +] diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 137b2b6e5..59a5b9c3d 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -40,6 +40,7 @@ import COMPTROLLER_ABI from "./abi/Comptroller.json"; import DIAMOND_ABI from "./abi/Diamond.json"; import LIQUIDATOR_ABI from "./abi/Liquidator.json"; import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; +import OLD_ABI from "./abi/OldComptroller.json"; import UNITROLLER_ABI from "./abi/Unitroller.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; @@ -48,17 +49,17 @@ import { cutParams as params } from "./utils/bsctestnet-cut-params.json"; type CutParam = [string, number, string[]]; const cutParams = params as unknown as CutParam[]; -const OLD_SETTER_FACET = "0xb619F7ce96c0a6E3F0b44e993f663522F79f294A"; -const OLD_REWARD_FACET = "0x905006DCD5DbAa9B67359bcB341a0C49AfC8d0A6"; -const OLD_MARKET_FACET = "0x377c2E7CE08B4cc7033EDF678EE1224A290075Fd"; -const OLD_POLICY_FACET = "0x671B787AEDB6769972f081C6ee4978146F7D92E6"; +const OLD_SETTER_FACET = "0xeD1fd1D134b10dF8F84BbC3C89881A929B0c6F47"; +const OLD_REWARD_FACET = "0x1C10F03827530f514Ba14065ec3D5f1496f35418"; +const OLD_MARKET_FACET = "0x1c7B1e28A43619123F0bF9DB8aeEc64aA535b9EC"; +const OLD_POLICY_FACET = "0x642EE02aFBE47C69c0980Ea61131cD97884058a7"; -const NEW_SETTER_FACET = "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c"; -const NEW_REWARD_FACET = "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB"; -const NEW_MARKET_FACET = "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75"; -const NEW_POLICY_FACET = "0x284d000665296515280a4fB066a887EFF6A3bD9E"; +const NEW_SETTER_FACET = "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B"; +const NEW_REWARD_FACET = "0xcD598bDcfF0433395918512359745f83F5730C49"; +const NEW_MARKET_FACET = "0x679cd0443207C1Fb411d59B1E10E23b3850d1337"; +const NEW_POLICY_FACET = "0xFc6A44E5B5960444a6D25D6F85e3d7D79d26D8Ef"; -forking(63848748, async () => { +forking(64979496, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; @@ -98,6 +99,15 @@ forking(63848748, async () => { }); describe("Pre-VIP state", async () => { + it("check current risk factors", async () => { + const oldComptoller = await ethers.getContractAt(OLD_ABI, UNITROLLER); + for (const market of CORE_MARKETS) { + const data = await oldComptoller.markets(market.address); + expect(data[0]).to.equal(true); // isListed + expect(data[1]).to.equal(market.collateralFactor); + } + expect(await oldComptoller.liquidationIncentiveMantissa()).to.equal(CURRENT_LIQUIDATION_INCENTIVE); + }); it("unitroller should have old implementation", async () => { expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(OLD_DIAMOND.toLowerCase()); }); @@ -120,17 +130,25 @@ forking(63848748, async () => { callbackAfterExecution: async (txResponse: TransactionResponse) => { const totalMarkets = CORE_MARKETS_WITHOUT_VBNB.length; const totalNewMethods = NEW_COMPT_METHODS.length; - await expectEvents(txResponse, [UNITROLLER_ABI], ["NewPendingImplementation"], [4]); + await expectEvents( + txResponse, + [UNITROLLER_ABI, DIAMOND_ABI, LIQUIDATOR_ABI, ACM_ABI], + [ + "NewPendingImplementation", + "DiamondCut", + "NewLiquidationTreasuryPercent", + "PermissionGranted", + "PermissionRevoked", + ], + [4, 1, 1, 27, 5], + ); await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 2]); // +2 for unitroller and VAI - await expectEvents(txResponse, [DIAMOND_ABI], ["DiamondCut"], [1]); - await expectEvents(txResponse, [ACM_ABI], ["PermissionGranted", "PermissionRevoked"], [totalNewMethods + 3, 5]); await expectEvents( txResponse, [COMPTROLLER_ABI], ["NewLiquidationThreshold", "NewLiquidationIncentive", "BorrowAllowedUpdated"], [totalMarkets - 2, totalMarkets + 1, totalMarkets + 1], // +1 for vBNB, -3 for markets with 0 collateral factor ); - await expectEvents(txResponse, [LIQUIDATOR_ABI], ["NewLiquidationTreasuryPercent"], [1]); }, }); @@ -193,11 +211,21 @@ forking(63848748, async () => { expect( await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method), ).to.equal(true); + expect( + await accessControlManager.hasPermission( + NETWORK_ADDRESSES.bsctestnet.FAST_TRACK_TIMELOCK, + UNITROLLER, + method, + ), + ).to.equal(true); + expect( + await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK, UNITROLLER, method), + ).to.equal(true); } }); it("comptroller should have new comptrollerLens", async () => { - expect((await comptroller.comptrollerLens()).toLowerCase()).to.equal(NEW_COMPTROLLER_LENS.toLowerCase()); + expect(await comptroller.comptrollerLens()).to.equal(NEW_COMPTROLLER_LENS); }); it("markets should have new implemenation", async () => { @@ -210,11 +238,11 @@ forking(63848748, async () => { it("comptroller should have correct markets value", async () => { for (const market of CORE_MARKETS) { const data = await comptroller.markets(market.address); - expect(data[1]).to.be.equal(market.collateralFactor); - expect(data[3]).to.be.equal(market.collateralFactor); // same LT - expect(data[4]).to.be.equal(CURRENT_LIQUIDATION_INCENTIVE); - expect(data[5]).to.be.equal(0); // corePool - expect(data[6]).to.be.equal(true); // isBorrowAllowed + expect(data[1]).to.equal(market.collateralFactor); + expect(data[3]).to.equal(market.collateralFactor); // same LT + expect(data[4]).to.equal(CURRENT_LIQUIDATION_INCENTIVE); + expect(data[5]).to.equal(0); // corePool + expect(data[6]).to.equal(true); // isBorrowAllowed } }); @@ -224,7 +252,7 @@ forking(63848748, async () => { it("Liquidator should point to new implementation", async () => { const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); - expect(impl.toLowerCase()).to.equal(NEW_LIQUIDATOR_IMPL.toLowerCase()); + expect(impl).to.equal(NEW_LIQUIDATOR_IMPL); }); it("MarketConfigurationAggregator should not have ACM permissions", async () => { diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json index ced97a326..e60bbfebb 100644 --- a/simulations/vip-550/utils/bsctestnet-cut-params.json +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -1,7 +1,7 @@ { "cutParams": [ [ - "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + "0x679cd0443207C1Fb411d59B1E10E23b3850d1337", 1, [ "0xa76b3fda", @@ -21,7 +21,7 @@ ] ], [ - "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + "0x679cd0443207C1Fb411d59B1E10E23b3850d1337", 0, [ "0x89c13be0", @@ -43,7 +43,7 @@ ] ], [ - "0x284d000665296515280a4fB066a887EFF6A3bD9E", + "0xFc6A44E5B5960444a6D25D6F85e3d7D79d26D8Ef", 1, [ "0xead1a8a0", @@ -67,7 +67,7 @@ ] ], [ - "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB", + "0xcD598bDcfF0433395918512359745f83F5730C49", 1, [ "0xa7604b41", @@ -83,7 +83,7 @@ ] ], [ - "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B", 1, [ "0xf519fc30", @@ -117,7 +117,11 @@ "0xd136af44" ] ], - ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 0, ["0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8"]], + [ + "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B", + 0, + ["0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8", "0x4964f48c"] + ], ["0x0000000000000000000000000000000000000000", 2, ["0xe4028eee", "0x4fd42e17", "0xa8431081"]] ] } diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 77bbba518..47e788143 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -11,17 +11,17 @@ export const LIQUIDATOR = "0x55AEABa76ecf144031Ef64E222166eb28Cb4865F"; export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; export const LIQUIDATOR_PROXY_ADMIN = "0x1469AeB2768931f979a1c957692e32Aa802dd55a"; -export const NEW_VAI_CONTROLLER = "0x5361EeCB35Dbbf239F0AB3600e460bFdBa14c592"; -export const NEW_DIAMOND = "0xC1eCF5Ee6B2F43194359c02FB460B31e4494895d"; -export const NEW_COMPTROLLER_LENS = "0x5675112bf79C66d8CEbe48C40f25e9Dd6576c4e6"; -export const NEW_VBEP20_DELEGATE = "0xf292c8F321fF1BC49A3FeADf4D0971E519485e19"; -export const NEW_LIQUIDATOR_IMPL = "0x0F30B2a844339b7bD2Be0D82298e82f44286A0cA"; +export const NEW_VAI_CONTROLLER = "0xECAd2AF0119Cce245817B61d4186d4708703d1a0"; +export const NEW_DIAMOND = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; +export const NEW_COMPTROLLER_LENS = "0x5715933d62852C15eF97b6B4BB498CF45c40C244"; +export const NEW_VBEP20_DELEGATE = "0xD922a9d900C25beE548586948cCf831e09FB2130"; +export const NEW_LIQUIDATOR_IMPL = "0x28Be3ef68AFa00b1151669F2e6dA2DE8d1bb1Abc"; -export const OLD_VAI_CONTROLLER = "0xDFcbfb82a416B5CEbB80FECFbBF4E055299931FF"; -export const OLD_DIAMOND = "0x1D5F9752bA40cF7047db2E24Cb6Aa196E3c334DA"; -export const OLD_COMPTROLLER_LENS = "0x350d56985A269C148648207E4Cea9f87656E762a"; -export const OLD_VBEP20_DELEGATE = "0xad6aa8Bb4829560412A94AA930745f407BF8000B"; -export const OLD_LIQUIDATOR_IMPL = "0x83372155dd4a4306af82795d5a27d40188ed1f3b"; +export const OLD_VAI_CONTROLLER = "0x5864e8BE0d4AD825feD65115a4f109f850A65aF7"; +export const OLD_DIAMOND = "0x649616739bab52E2A98BC74d93c896Ca45944359"; +export const OLD_COMPTROLLER_LENS = "0x3ec96D6a9a14ee57aB83F81BB7386EBE515936D1"; +export const OLD_VBEP20_DELEGATE = "0x585C508aF088123d990182a19e655ebB0e540CA1"; +export const OLD_LIQUIDATOR_IMPL = "0xe442A62E3B1956EC5B42e06aA0E293A0cB300406"; export const MARKET_CONFIGURATION_AGGREGATOR = "0x091bF95157928D8008C5c1D605b483B5F46F6305"; export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); @@ -31,10 +31,11 @@ export const NEW_COMPT_METHODS = [ "setLiquidationIncentive(address,uint256)", "setIsBorrowAllowed(uint96,address,bool)", "createPool(string)", - "addPoolMarket(uint96,address)", + "addPoolMarkets(uint96[],address[])", "removePoolMarket(uint96,address)", "setCollateralFactor(uint96,address,uint256,uint256)", "setLiquidationIncentive(uint96,address,uint256)", + "setPoolActive(uint96,bool)", ]; export const CORE_MARKETS = [ @@ -248,15 +249,12 @@ export const CORE_MARKETS = [ ]; export const CORE_MARKETS_WITHOUT_VBNB = CORE_MARKETS.filter(market => market.symbol != "vBNB"); - export const MARKETS_CF_LT = CORE_MARKETS.map(market => [ market.address, market.collateralFactor, market.collateralFactor, ]); - export const MARKETS_LI = CORE_MARKETS.map(market => [market.address, CURRENT_LIQUIDATION_INCENTIVE]); - export const MARKETS_BA = CORE_MARKETS.map(market => [0, market.address, true]); export const vip550 = () => { @@ -309,6 +307,20 @@ export const vip550 = () => { params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], }; }), + ...NEW_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.FAST_TRACK_TIMELOCK], + }; + }), + ...NEW_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK], + }; + }), ...CORE_MARKETS_WITHOUT_VBNB.map(vToken => { return { From c876dc5a5e24ae2c14a53e58dada6f7e18621597 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Thu, 11 Sep 2025 15:08:48 +0530 Subject: [PATCH 07/24] fix: lint --- simulations/vip-550/bsctestnet.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 59a5b9c3d..78c2215d7 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -129,7 +129,6 @@ forking(64979496, async () => { testVip("VIP-550", await vip550(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { const totalMarkets = CORE_MARKETS_WITHOUT_VBNB.length; - const totalNewMethods = NEW_COMPT_METHODS.length; await expectEvents( txResponse, [UNITROLLER_ABI, DIAMOND_ABI, LIQUIDATOR_ABI, ACM_ABI], From 3f39bbe93a729ad66d025bc10c9e58c5c4870e04 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Fri, 12 Sep 2025 12:24:29 +0530 Subject: [PATCH 08/24] fix: PR comments --- simulations/vip-550/bsctestnet.ts | 4 ++-- vips/vip-550/bsctestnet.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 78c2215d7..cd292a403 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -59,7 +59,7 @@ const NEW_REWARD_FACET = "0xcD598bDcfF0433395918512359745f83F5730C49"; const NEW_MARKET_FACET = "0x679cd0443207C1Fb411d59B1E10E23b3850d1337"; const NEW_POLICY_FACET = "0xFc6A44E5B5960444a6D25D6F85e3d7D79d26D8Ef"; -forking(64979496, async () => { +forking(65085599, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; @@ -139,7 +139,7 @@ forking(64979496, async () => { "PermissionGranted", "PermissionRevoked", ], - [4, 1, 1, 27, 5], + [4, 1, 1, 30, 5], ); await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 2]); // +2 for unitroller and VAI await expectEvents( diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 47e788143..801f302b2 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -22,12 +22,13 @@ export const OLD_DIAMOND = "0x649616739bab52E2A98BC74d93c896Ca45944359"; export const OLD_COMPTROLLER_LENS = "0x3ec96D6a9a14ee57aB83F81BB7386EBE515936D1"; export const OLD_VBEP20_DELEGATE = "0x585C508aF088123d990182a19e655ebB0e540CA1"; export const OLD_LIQUIDATOR_IMPL = "0xe442A62E3B1956EC5B42e06aA0E293A0cB300406"; -export const MARKET_CONFIGURATION_AGGREGATOR = "0x091bF95157928D8008C5c1D605b483B5F46F6305"; +export const MARKET_CONFIGURATION_AGGREGATOR = "0x7bbC692907f23E4b7170de0e1483323ea322BDbF"; export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); export const NEW_COMPT_METHODS = [ + "setCollateralFactor(address,uint256,uint256)", "setLiquidationIncentive(address,uint256)", "setIsBorrowAllowed(uint96,address,bool)", "createPool(string)", @@ -246,6 +247,12 @@ export const CORE_MARKETS = [ asset: "0xC7a2b79432Fd3e3d5bd2d96A456c734AB93A0484", collateralFactor: 600000000000000000n, }, + { + symbol: "vWBNB", + address: "0xd9E77847ec815E56ae2B9E69596C69b6972b0B1C", + asset: "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd", + collateralFactor: 800000000000000000n, + }, ]; export const CORE_MARKETS_WITHOUT_VBNB = CORE_MARKETS.filter(market => market.symbol != "vBNB"); From e3532f5c3ad2ad8f411ab1199cb584474517e4ad Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 15 Sep 2025 12:47:45 +0530 Subject: [PATCH 09/24] fix: update deployed contracts --- simulations/vip-550/bsctestnet.ts | 25 ++++++++++++------- .../vip-550/utils/bsctestnet-cut-params.json | 12 ++++----- vips/vip-550/bsctestnet.ts | 19 ++++++++------ 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index cd292a403..33077d7a4 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -15,11 +15,13 @@ import { forking, testVip } from "src/vip-framework"; import { ACM, + BORROW_PAUSED_MARKETS, CORE_MARKETS, CORE_MARKETS_WITHOUT_VBNB, CURRENT_LIQUIDATION_INCENTIVE, LIQUIDATOR, LIQUIDATOR_PROXY_ADMIN, + MARKETS_BA, MARKET_CONFIGURATION_AGGREGATOR, NEW_COMPTROLLER_LENS, NEW_COMPT_METHODS, @@ -54,12 +56,12 @@ const OLD_REWARD_FACET = "0x1C10F03827530f514Ba14065ec3D5f1496f35418"; const OLD_MARKET_FACET = "0x1c7B1e28A43619123F0bF9DB8aeEc64aA535b9EC"; const OLD_POLICY_FACET = "0x642EE02aFBE47C69c0980Ea61131cD97884058a7"; -const NEW_SETTER_FACET = "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B"; -const NEW_REWARD_FACET = "0xcD598bDcfF0433395918512359745f83F5730C49"; -const NEW_MARKET_FACET = "0x679cd0443207C1Fb411d59B1E10E23b3850d1337"; -const NEW_POLICY_FACET = "0xFc6A44E5B5960444a6D25D6F85e3d7D79d26D8Ef"; +const NEW_SETTER_FACET = "0xF1844c6d56314a10C28175db638B51b4Ee14C402"; +const NEW_REWARD_FACET = "0x2B1b7FA16FE9B9ED5571663396bC16EBC079193B"; +const NEW_MARKET_FACET = "0x92B9CE322B0A4a3701fd3dC609740c7Df80f479D"; +const NEW_POLICY_FACET = "0xb94933Cf3cdAe7c98dbBd86d4649766b529Ca847"; -forking(65085599, async () => { +forking(65431005, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; @@ -128,7 +130,8 @@ forking(65085599, async () => { testVip("VIP-550", await vip550(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { - const totalMarkets = CORE_MARKETS_WITHOUT_VBNB.length; + const totalMarkets = CORE_MARKETS.length; + const toatlBAMarkets = MARKETS_BA.length; await expectEvents( txResponse, [UNITROLLER_ABI, DIAMOND_ABI, LIQUIDATOR_ABI, ACM_ABI], @@ -141,12 +144,12 @@ forking(65085599, async () => { ], [4, 1, 1, 30, 5], ); - await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 2]); // +2 for unitroller and VAI + await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 1]); // +2 for unitroller and VAI, -1 for vBNB await expectEvents( txResponse, [COMPTROLLER_ABI], ["NewLiquidationThreshold", "NewLiquidationIncentive", "BorrowAllowedUpdated"], - [totalMarkets - 2, totalMarkets + 1, totalMarkets + 1], // +1 for vBNB, -3 for markets with 0 collateral factor + [totalMarkets - 3, totalMarkets, toatlBAMarkets], // -3 for markets with 0 collateral factor ); }, }); @@ -241,7 +244,11 @@ forking(65085599, async () => { expect(data[3]).to.equal(market.collateralFactor); // same LT expect(data[4]).to.equal(CURRENT_LIQUIDATION_INCENTIVE); expect(data[5]).to.equal(0); // corePool - expect(data[6]).to.equal(true); // isBorrowAllowed + if (BORROW_PAUSED_MARKETS.includes(market.symbol)) { + expect(data[6]).to.equal(false); // isBorrowAllowed + } else { + expect(data[6]).to.equal(true); + } } }); diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json index e60bbfebb..5a392fca1 100644 --- a/simulations/vip-550/utils/bsctestnet-cut-params.json +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -1,7 +1,7 @@ { "cutParams": [ [ - "0x679cd0443207C1Fb411d59B1E10E23b3850d1337", + "0x92B9CE322B0A4a3701fd3dC609740c7Df80f479D", 1, [ "0xa76b3fda", @@ -21,7 +21,7 @@ ] ], [ - "0x679cd0443207C1Fb411d59B1E10E23b3850d1337", + "0x92B9CE322B0A4a3701fd3dC609740c7Df80f479D", 0, [ "0x89c13be0", @@ -43,7 +43,7 @@ ] ], [ - "0xFc6A44E5B5960444a6D25D6F85e3d7D79d26D8Ef", + "0xb94933Cf3cdAe7c98dbBd86d4649766b529Ca847", 1, [ "0xead1a8a0", @@ -67,7 +67,7 @@ ] ], [ - "0xcD598bDcfF0433395918512359745f83F5730C49", + "0x2B1b7FA16FE9B9ED5571663396bC16EBC079193B", 1, [ "0xa7604b41", @@ -83,7 +83,7 @@ ] ], [ - "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B", + "0xF1844c6d56314a10C28175db638B51b4Ee14C402", 1, [ "0xf519fc30", @@ -118,7 +118,7 @@ ] ], [ - "0x675d55BE8Ac03400dEE081076E16A00d3Fb2b40B", + "0xF1844c6d56314a10C28175db638B51b4Ee14C402", 0, ["0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8", "0x4964f48c"] ], diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 801f302b2..8832d5592 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -11,11 +11,11 @@ export const LIQUIDATOR = "0x55AEABa76ecf144031Ef64E222166eb28Cb4865F"; export const ACM = "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA"; export const LIQUIDATOR_PROXY_ADMIN = "0x1469AeB2768931f979a1c957692e32Aa802dd55a"; -export const NEW_VAI_CONTROLLER = "0xECAd2AF0119Cce245817B61d4186d4708703d1a0"; -export const NEW_DIAMOND = "0x1d100DAD71E56776bA3BdA3ec36D776BCE512B84"; -export const NEW_COMPTROLLER_LENS = "0x5715933d62852C15eF97b6B4BB498CF45c40C244"; -export const NEW_VBEP20_DELEGATE = "0xD922a9d900C25beE548586948cCf831e09FB2130"; -export const NEW_LIQUIDATOR_IMPL = "0x28Be3ef68AFa00b1151669F2e6dA2DE8d1bb1Abc"; +export const NEW_VAI_CONTROLLER = "0x1eA874d53Dad10711Ff69C145bb59d2DFCCD7322"; +export const NEW_DIAMOND = "0x11Aa7fF5990E0A341eCeEeE9ddFdF8cE570DD5FD"; +export const NEW_COMPTROLLER_LENS = "0xACbc75C2D0438722c75D9BD20844b5aFda4155ea"; +export const NEW_VBEP20_DELEGATE = "0x9c824EDa64aF04D160F9cB835C6AC95606077db0"; +export const NEW_LIQUIDATOR_IMPL = "0x91070E5b5Ff60a6c122740EB326D1f80E9f470e7"; export const OLD_VAI_CONTROLLER = "0x5864e8BE0d4AD825feD65115a4f109f850A65aF7"; export const OLD_DIAMOND = "0x649616739bab52E2A98BC74d93c896Ca45944359"; @@ -179,7 +179,6 @@ export const CORE_MARKETS = [ collateralFactor: 750000000000000000n, }, { - // Binance symbol: "vTWT", address: "0x95DaED37fdD3F557b3A5cCEb7D50Be65b36721DF", asset: "0xb99c6b26fdf3678c6e2aff8466e3625a0e7182f8", @@ -198,7 +197,6 @@ export const CORE_MARKETS = [ collateralFactor: 720000000000000000n, }, { - // BINANCE symbol: "vlisUSD", address: "0x9447b1D4Bd192f25416B6aCc3B7f06be2f7D6309", asset: "0xe73774DfCD551BF75650772dC2cC56a2B6323453", @@ -262,7 +260,12 @@ export const MARKETS_CF_LT = CORE_MARKETS.map(market => [ market.collateralFactor, ]); export const MARKETS_LI = CORE_MARKETS.map(market => [market.address, CURRENT_LIQUIDATION_INCENTIVE]); -export const MARKETS_BA = CORE_MARKETS.map(market => [0, market.address, true]); +export const BORROW_PAUSED_MARKETS = ["vasBNB", "vsUSDe", "vxSolvBTC", "vPT-sUSDE-26JUN2025"]; +export const MARKETS_BA = CORE_MARKETS.filter(market => !BORROW_PAUSED_MARKETS.includes(market.symbol)).map(market => [ + 0, + market.address, + true, +]); export const vip550 = () => { const meta = { From 85db24956eb4f3a687a1a5c64e08697664821367 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 15 Sep 2025 15:16:35 +0530 Subject: [PATCH 10/24] fix: update ACM commands --- simulations/vip-550/bsctestnet.ts | 45 +++++++++++++-------- vips/vip-550/bsctestnet.ts | 65 ++++++++++++++++++++++--------- 2 files changed, 75 insertions(+), 35 deletions(-) diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index 33077d7a4..ae2368eac 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -24,7 +24,9 @@ import { MARKETS_BA, MARKET_CONFIGURATION_AGGREGATOR, NEW_COMPTROLLER_LENS, - NEW_COMPT_METHODS, + NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK, + NEW_COMPT_METHODS_FOR_GUARDIAN, + NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK, NEW_DIAMOND, NEW_LIQUIDATOR_IMPL, NEW_VAI_CONTROLLER, @@ -142,7 +144,7 @@ forking(65431005, async () => { "PermissionGranted", "PermissionRevoked", ], - [4, 1, 1, 30, 5], + [4, 1, 1, 29, 9], ); await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 1]); // +2 for unitroller and VAI, -1 for vBNB await expectEvents( @@ -192,24 +194,23 @@ forking(65431005, async () => { }); it("Check removed permission", async () => { - expect( - await accessControlManager.hasPermission( - NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, - UNITROLLER, - "_setCollateralFactor(address,uint256)", - ), - ).to.equal(false); - expect( - await accessControlManager.hasPermission( - NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, - UNITROLLER, - "_setLiquidationIncentive(uint256)", - ), - ).to.equal(false); + for (const timelock of [ + NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, + NETWORK_ADDRESSES.bsctestnet.FAST_TRACK_TIMELOCK, + NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK, + NETWORK_ADDRESSES.bsctestnet.GUARDIAN, + ]) { + expect( + await accessControlManager.hasPermission(timelock, UNITROLLER, "_setCollateralFactor(address,uint256)"), + ).to.equal(false); + expect( + await accessControlManager.hasPermission(timelock, UNITROLLER, "_setLiquidationIncentive(uint256)"), + ).to.equal(false); + } }); it("Check new permission", async () => { - for (const method of NEW_COMPT_METHODS) { + for (const method of NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK) { expect( await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method), ).to.equal(true); @@ -224,6 +225,16 @@ forking(65431005, async () => { await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK, UNITROLLER, method), ).to.equal(true); } + for (const method of NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK) { + expect( + await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method), + ).to.equal(true); + } + for (const method of NEW_COMPT_METHODS_FOR_GUARDIAN) { + expect( + await accessControlManager.hasPermission(NETWORK_ADDRESSES.bsctestnet.GUARDIAN, UNITROLLER, method), + ).to.equal(true); + } }); it("comptroller should have new comptrollerLens", async () => { diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-550/bsctestnet.ts index 8832d5592..72b5fa5a6 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-550/bsctestnet.ts @@ -27,18 +27,29 @@ export const MARKET_CONFIGURATION_AGGREGATOR = "0x7bbC692907f23E4b7170de0e148332 export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); -export const NEW_COMPT_METHODS = [ - "setCollateralFactor(address,uint256,uint256)", - "setLiquidationIncentive(address,uint256)", - "setIsBorrowAllowed(uint96,address,bool)", +export const NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK = [ "createPool(string)", "addPoolMarkets(uint96[],address[])", "removePoolMarket(uint96,address)", + "setPoolActive(uint96,bool)", + "setCollateralFactor(address,uint256,uint256)", "setCollateralFactor(uint96,address,uint256,uint256)", + "setIsBorrowAllowed(uint96,address,bool)", +]; + +export const NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK = [ + "setLiquidationIncentive(address,uint256)", "setLiquidationIncentive(uint96,address,uint256)", - "setPoolActive(uint96,bool)", ]; +export const NEW_COMPT_METHODS_FOR_GUARDIAN = [ + "setCollateralFactor(address,uint256,uint256)", + "setCollateralFactor(uint96,address,uint256,uint256)", + "setIsBorrowAllowed(uint96,address,bool)", // on testnet there is only 1 Guardian +]; + +export const REMOVED_COMPT_METHODS = ["_setCollateralFactor(address,uint256)", "_setLiquidationIncentive(uint256)"]; + export const CORE_MARKETS = [ { symbol: "vUSDC", @@ -294,43 +305,61 @@ export const vip550 = () => { signature: "diamondCut((address,uint8,bytes4[])[])", params: [params], }, - { - target: ACM, - signature: "revokeCallPermission(address,string,address)", - params: [UNITROLLER, "_setCollateralFactor(address,uint256)", NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], - }, - { - target: ACM, - signature: "revokeCallPermission(address,string,address)", - params: [UNITROLLER, "_setLiquidationIncentive(uint256)", NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], - }, + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], + }; + }), + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.FAST_TRACK_TIMELOCK], + }; + }), + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK], + }; + }), { target: UNITROLLER, signature: "_setComptrollerLens(address)", params: [NEW_COMPTROLLER_LENS], }, - ...NEW_COMPT_METHODS.map(method => { + ...[...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK, ...NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK].map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.NORMAL_TIMELOCK], }; }), - ...NEW_COMPT_METHODS.map(method => { + ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.FAST_TRACK_TIMELOCK], }; }), - ...NEW_COMPT_METHODS.map(method => { + ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.CRITICAL_TIMELOCK], }; }), + ...NEW_COMPT_METHODS_FOR_GUARDIAN.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bsctestnet.GUARDIAN], + }; + }), ...CORE_MARKETS_WITHOUT_VBNB.map(vToken => { return { From dcdc4f7f356952cbff1896269596e240d26b68cf Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 15 Sep 2025 18:48:02 +0530 Subject: [PATCH 11/24] fix: update policy-facet address --- simulations/vip-550/bsctestnet.ts | 4 ++-- simulations/vip-550/utils/bsctestnet-cut-params.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-550/bsctestnet.ts index ae2368eac..cb7fd5197 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-550/bsctestnet.ts @@ -61,9 +61,9 @@ const OLD_POLICY_FACET = "0x642EE02aFBE47C69c0980Ea61131cD97884058a7"; const NEW_SETTER_FACET = "0xF1844c6d56314a10C28175db638B51b4Ee14C402"; const NEW_REWARD_FACET = "0x2B1b7FA16FE9B9ED5571663396bC16EBC079193B"; const NEW_MARKET_FACET = "0x92B9CE322B0A4a3701fd3dC609740c7Df80f479D"; -const NEW_POLICY_FACET = "0xb94933Cf3cdAe7c98dbBd86d4649766b529Ca847"; +const NEW_POLICY_FACET = "0xBDd1F07F4eF1748657FDA0d29CF4D7361120c187"; -forking(65431005, async () => { +forking(65463763, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-550/utils/bsctestnet-cut-params.json index 5a392fca1..e54f0e6c2 100644 --- a/simulations/vip-550/utils/bsctestnet-cut-params.json +++ b/simulations/vip-550/utils/bsctestnet-cut-params.json @@ -43,7 +43,7 @@ ] ], [ - "0xb94933Cf3cdAe7c98dbBd86d4649766b529Ca847", + "0xBDd1F07F4eF1748657FDA0d29CF4D7361120c187", 1, [ "0xead1a8a0", From c983c6fb776ba6b7eacfdb1627318e6f27e55bdd Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Mon, 15 Sep 2025 18:12:56 +0200 Subject: [PATCH 12/24] chore: support bigint in the VIPs --- scripts/createProposal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/createProposal.ts b/scripts/createProposal.ts index dae89c328..fa0e2d5fa 100644 --- a/scripts/createProposal.ts +++ b/scripts/createProposal.ts @@ -34,8 +34,8 @@ type JsonObject = { [key: string]: any }; const processJson = async (data: JsonObject) => { const convertBigNumberToString = (obj: JsonObject) => { for (const key in obj) { - if (obj[key] instanceof BigNumber) { - obj[key] = obj[key].toString(10); // Convert BigNumber to decimal representation + if (obj[key] instanceof BigNumber || typeof obj[key] === "bigint") { + obj[key] = obj[key].toString(); // Convert BigNumber and bigint to decimal representation } else if (typeof obj[key] === "object" && obj[key] !== null) { convertBigNumberToString(obj[key]); // Recursively convert nested objects } From 6273bc9d6aff21f308eb92b93964a9006cc42a6b Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Wed, 17 Sep 2025 19:01:44 +0530 Subject: [PATCH 13/24] feat: add addendum testnet vip for emode --- simulations/vip-550/bsctestnet-addendum.ts | 75 +++++++++++++++++ vips/vip-550/bsctestnet-addendum.ts | 93 ++++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 simulations/vip-550/bsctestnet-addendum.ts create mode 100644 vips/vip-550/bsctestnet-addendum.ts diff --git a/simulations/vip-550/bsctestnet-addendum.ts b/simulations/vip-550/bsctestnet-addendum.ts new file mode 100644 index 000000000..25ac18436 --- /dev/null +++ b/simulations/vip-550/bsctestnet-addendum.ts @@ -0,0 +1,75 @@ +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 { + CUT_PARAMS, + NEW_SETTER_FACET, + OLD_SETTER_FACET, + UNITROLLER, + vip550, +} from "../../vips/vip-550/bsctestnet-addendum"; +import ACM_ABI from "./abi/AccessControlManager.json"; +import DIAMOND_ABI from "./abi/Diamond.json"; + +const bsctestnet = NETWORK_ADDRESSES.bsctestnet; +type CutParam = [string, number, string[]]; +const cutParams = CUT_PARAMS as unknown as CutParam[]; + +forking(65695214, async () => { + let unitroller: Contract; + let accessControlManager: Contract; + + before(async () => { + unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); + accessControlManager = await ethers.getContractAt(ACM_ABI, bsctestnet.ACCESS_CONTROL_MANAGER); + }); + + describe("Pre-VIP state", async () => { + it("unitroller should have old setterFacet", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET); + }); + }); + + testVip("VIP-550", await vip550(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents(txResponse, [DIAMOND_ABI, ACM_ABI], ["DiamondCut", "PermissionGranted"], [1, 3]); + }, + }); + + describe("Post-VIP state", async () => { + it("unitroller should contain the new setterFacet address", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET); + }); + + it("setter facet function selectors should be replaced with new facet", async () => { + const functionSelectors = [...cutParams[0][2], ...cutParams[1][2]]; + expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); + }); + + it("Check new permission", async () => { + expect( + await accessControlManager.hasPermission(bsctestnet.NORMAL_TIMELOCK, UNITROLLER, "setPoolLabel(uint96,string)"), + ).to.equal(true); + expect( + await accessControlManager.hasPermission( + bsctestnet.FAST_TRACK_TIMELOCK, + UNITROLLER, + "setPoolLabel(uint96,string)", + ), + ).to.equal(true); + expect( + await accessControlManager.hasPermission( + bsctestnet.CRITICAL_TIMELOCK, + UNITROLLER, + "setPoolLabel(uint96,string)", + ), + ).to.equal(true); + }); + }); +}); diff --git a/vips/vip-550/bsctestnet-addendum.ts b/vips/vip-550/bsctestnet-addendum.ts new file mode 100644 index 000000000..b8afbc685 --- /dev/null +++ b/vips/vip-550/bsctestnet-addendum.ts @@ -0,0 +1,93 @@ +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +const bsctestnet = NETWORK_ADDRESSES.bsctestnet; +export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; +export const OLD_SETTER_FACET = "0xF1844c6d56314a10C28175db638B51b4Ee14C402"; +export const NEW_SETTER_FACET = "0xc352898B455eC325fD1d31f265b53Aa2409B9F68"; +const FacetCutAction = { Add: 0, Replace: 1, Remove: 2 }; + +export const CUT_PARAMS = [ + [ + NEW_SETTER_FACET, + FacetCutAction.Replace, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0x24aaa220", + "0x12348e96", + "0x5cc4fdeb", + "0x9159b177", + "0x8b3113f6", + "0xa89766dd", + "0x35439240", + "0x9bd8f6e8", + "0x186db48f", + "0xd136af44", + "0xfd51a3ad", + "0x4964f48c", + "0x530e784f", + "0xc32094c7", + ], + ], + [NEW_SETTER_FACET, FacetCutAction.Add, ["0xb88d846b"]], +]; + +export const vip550 = () => { + const meta = { + version: "v2", + title: "Emode in the BNB Core Pool", + description: "Emode in the BNB Core Pool", + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [CUT_PARAMS], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setPoolLabel(uint96,string)", bsctestnet.NORMAL_TIMELOCK], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setPoolLabel(uint96,string)", bsctestnet.FAST_TRACK_TIMELOCK], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setPoolLabel(uint96,string)", bsctestnet.CRITICAL_TIMELOCK], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip550; From a4daa37886728be5b95a6c61bdcdca7421f4c2c9 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Thu, 18 Sep 2025 19:03:24 +0530 Subject: [PATCH 14/24] fix: update addendum testnet vip --- simulations/vip-550/bsctestnet-addendum.ts | 103 ++++++++++----- .../utils/bsctestnet-addendum-cut-params.json | 121 ++++++++++++++++++ vips/vip-550/bsctestnet-addendum.ts | 91 +++++++------ 3 files changed, 239 insertions(+), 76 deletions(-) create mode 100644 simulations/vip-550/utils/bsctestnet-addendum-cut-params.json diff --git a/simulations/vip-550/bsctestnet-addendum.ts b/simulations/vip-550/bsctestnet-addendum.ts index 25ac18436..fdc77de61 100644 --- a/simulations/vip-550/bsctestnet-addendum.ts +++ b/simulations/vip-550/bsctestnet-addendum.ts @@ -7,69 +7,114 @@ import { expectEvents } from "src/utils"; import { forking, testVip } from "src/vip-framework"; import { - CUT_PARAMS, - NEW_SETTER_FACET, - OLD_SETTER_FACET, + NEW_DIAMOND, + NEW_VAI_CONTROLLER, + OLD_DIAMOND, + OLD_VAI_CONTROLLER, UNITROLLER, + VAI_UNITROLLER, vip550, } from "../../vips/vip-550/bsctestnet-addendum"; import ACM_ABI from "./abi/AccessControlManager.json"; import DIAMOND_ABI from "./abi/Diamond.json"; +import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; +import { cutParams as params } from "./utils/bsctestnet-addendum-cut-params.json"; const bsctestnet = NETWORK_ADDRESSES.bsctestnet; type CutParam = [string, number, string[]]; -const cutParams = CUT_PARAMS as unknown as CutParam[]; +const cutParams = params as unknown as CutParam[]; -forking(65695214, async () => { +const OLD_SETTER_FACET = "0xF1844c6d56314a10C28175db638B51b4Ee14C402"; +const OLD_REWARD_FACET = "0x2B1b7FA16FE9B9ED5571663396bC16EBC079193B"; +const OLD_MARKET_FACET = "0x92B9CE322B0A4a3701fd3dC609740c7Df80f479D"; +const OLD_POLICY_FACET = "0xBDd1F07F4eF1748657FDA0d29CF4D7361120c187"; + +const NEW_SETTER_FACET = "0x3CCC9fC2fDA021ADb9C9FB0493C1a4a9357f4064"; +const NEW_REWARD_FACET = "0xDD150De13849fB0776B466114b95770714c8Cc9d"; +const NEW_MARKET_FACET = "0xD3D5f6c68677051e6855Fa38dca0cD6D56ED0c4f"; +const NEW_POLICY_FACET = "0x11968dab15a9e59Cf9721b1F5c68418383CC1320"; + +forking(65806620, async () => { let unitroller: Contract; + let vaiUnitroller: Contract; let accessControlManager: Contract; before(async () => { unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); + vaiUnitroller = await ethers.getContractAt(VAI_UNITROLLR_ABI, VAI_UNITROLLER); accessControlManager = await ethers.getContractAt(ACM_ABI, bsctestnet.ACCESS_CONTROL_MANAGER); }); describe("Pre-VIP state", async () => { - it("unitroller should have old setterFacet", async () => { - expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET); + it("unitroller should have old implementation", async () => { + expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(OLD_DIAMOND.toLowerCase()); + }); + it("VAI Unitroller should point to old VAI Controller", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(OLD_VAI_CONTROLLER); + }); + it("unitroller should have old Facets", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET, OLD_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_MARKET_FACET, OLD_POLICY_FACET); }); }); testVip("VIP-550", await vip550(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { - await expectEvents(txResponse, [DIAMOND_ABI, ACM_ABI], ["DiamondCut", "PermissionGranted"], [1, 3]); + await expectEvents(txResponse, [DIAMOND_ABI, ACM_ABI], ["DiamondCut", "PermissionGranted"], [1, 6]); }, }); describe("Post-VIP state", async () => { - it("unitroller should contain the new setterFacet address", async () => { - expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET); + it("Unitroller should point to new implementation", async () => { + expect(await unitroller.comptrollerImplementation()).equals(NEW_DIAMOND); + }); + + it("VAI Controller should point to new impl", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(NEW_VAI_CONTROLLER); + }); + + it("unitroller should contain the new Facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET, NEW_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_MARKET_FACET, NEW_POLICY_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(OLD_SETTER_FACET, OLD_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_MARKET_FACET, OLD_POLICY_FACET); + }); + + it("market facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = cutParams[0][2]; + expect(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = cutParams[1][2]; + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = cutParams[2][2]; + expect(await unitroller.facetFunctionSelectors(NEW_REWARD_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_REWARD_FACET)).to.deep.equal([]); }); - it("setter facet function selectors should be replaced with new facet", async () => { - const functionSelectors = [...cutParams[0][2], ...cutParams[1][2]]; + it("setter facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[3][2], ...cutParams[4][2]]; expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal(functionSelectors); expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); }); it("Check new permission", async () => { - expect( - await accessControlManager.hasPermission(bsctestnet.NORMAL_TIMELOCK, UNITROLLER, "setPoolLabel(uint96,string)"), - ).to.equal(true); - expect( - await accessControlManager.hasPermission( - bsctestnet.FAST_TRACK_TIMELOCK, - UNITROLLER, - "setPoolLabel(uint96,string)", - ), - ).to.equal(true); - expect( - await accessControlManager.hasPermission( - bsctestnet.CRITICAL_TIMELOCK, - UNITROLLER, - "setPoolLabel(uint96,string)", - ), - ).to.equal(true); + for (const method of ["setPoolLabel(uint96,string)", "setAllowCorePoolFallback(uint96,bool)"]) { + expect(await accessControlManager.hasPermission(bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method)).to.equal(true); + expect(await accessControlManager.hasPermission(bsctestnet.FAST_TRACK_TIMELOCK, UNITROLLER, method)).to.equal( + true, + ); + expect(await accessControlManager.hasPermission(bsctestnet.CRITICAL_TIMELOCK, UNITROLLER, method)).to.equal( + true, + ); + } }); }); }); diff --git a/simulations/vip-550/utils/bsctestnet-addendum-cut-params.json b/simulations/vip-550/utils/bsctestnet-addendum-cut-params.json new file mode 100644 index 000000000..98bcfd0a2 --- /dev/null +++ b/simulations/vip-550/utils/bsctestnet-addendum-cut-params.json @@ -0,0 +1,121 @@ +{ + "cutParams": [ + [ + "0xD3D5f6c68677051e6855Fa38dca0cD6D56ED0c4f", + 1, + [ + "0xa76b3fda", + "0x89c13be0", + "0x929fe9a1", + "0xd0d13036", + "0xc2998238", + "0xf9682732", + "0xede4edd0", + "0xb0772d0b", + "0xabfceffc", + "0x23617585", + "0xafd3783b", + "0x19ef3e8b", + "0xd686e9ee", + "0x7b86e42c", + "0x63e0d634", + "0xf02fdf97", + "0x007e3dd2", + "0x3d98a1e5", + "0x0ef332ca", + "0xc488847b", + "0xa78dc775", + "0x8e8f294b", + "0x3093c11e", + "0xd137f36e", + "0xcab4f84c", + "0x0686dab6", + "0xddbf54fd", + "0xc5b4db55", + "0xd463654c", + "0x4d99c776" + ] + ], + [ + "0x11968dab15a9e59Cf9721b1F5c68418383CC1320", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x528a174c", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ], + [ + "0xDD150De13849fB0776B466114b95770714c8Cc9d", + 1, + [ + "0xa7604b41", + "0xe85a2960", + "0x70bf66f0", + "0x86df31ee", + "0xadcd5fb9", + "0xd09c54ba", + "0x7858524d", + "0xbf32442d", + "0xededbae6", + "0x655f0725" + ] + ], + [ + "0x3CCC9fC2fDA021ADb9C9FB0493C1a4a9357f4064", + 1, + [ + "0xf519fc30", + "0x2b5d790c", + "0x317b0b77", + "0x9bf34cbb", + "0x522c656b", + "0x17db2163", + "0xbb857450", + "0x607ef6c1", + "0x51a485e4", + "0x5f5af1aa", + "0x55ee1fe1", + "0x9460c8b5", + "0x2a6a6065", + "0xd24febad", + "0x9cfdd9e6", + "0x2ec04124", + "0x4e0853db", + "0x6662c7c9", + "0x919a3736", + "0x4ef233fc", + "0x24aaa220", + "0x12348e96", + "0x5cc4fdeb", + "0x9159b177", + "0x8b3113f6", + "0xa89766dd", + "0x35439240", + "0x9bd8f6e8", + "0x186db48f", + "0xd136af44", + "0xfd51a3ad", + "0x4964f48c", + "0x530e784f", + "0xc32094c7" + ] + ], + ["0x3CCC9fC2fDA021ADb9C9FB0493C1a4a9357f4064", 0, ["0xb88d846b", "0x7938146f"]] + ] +} diff --git a/vips/vip-550/bsctestnet-addendum.ts b/vips/vip-550/bsctestnet-addendum.ts index b8afbc685..e17a42db7 100644 --- a/vips/vip-550/bsctestnet-addendum.ts +++ b/vips/vip-550/bsctestnet-addendum.ts @@ -2,55 +2,17 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; +import { cutParams as params } from "../../simulations/vip-550/utils/bsctestnet-addendum-cut-params.json"; + const bsctestnet = NETWORK_ADDRESSES.bsctestnet; export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; -export const OLD_SETTER_FACET = "0xF1844c6d56314a10C28175db638B51b4Ee14C402"; -export const NEW_SETTER_FACET = "0xc352898B455eC325fD1d31f265b53Aa2409B9F68"; -const FacetCutAction = { Add: 0, Replace: 1, Remove: 2 }; +export const VAI_UNITROLLER = "0xf70C3C6b749BbAb89C081737334E74C9aFD4BE16"; -export const CUT_PARAMS = [ - [ - NEW_SETTER_FACET, - FacetCutAction.Replace, - [ - "0xf519fc30", - "0x2b5d790c", - "0x317b0b77", - "0x9bf34cbb", - "0x522c656b", - "0x17db2163", - "0xbb857450", - "0x607ef6c1", - "0x51a485e4", - "0x5f5af1aa", - "0x55ee1fe1", - "0x9460c8b5", - "0x2a6a6065", - "0xd24febad", - "0x9cfdd9e6", - "0x2ec04124", - "0x4e0853db", - "0x6662c7c9", - "0x919a3736", - "0x4ef233fc", - "0x24aaa220", - "0x12348e96", - "0x5cc4fdeb", - "0x9159b177", - "0x8b3113f6", - "0xa89766dd", - "0x35439240", - "0x9bd8f6e8", - "0x186db48f", - "0xd136af44", - "0xfd51a3ad", - "0x4964f48c", - "0x530e784f", - "0xc32094c7", - ], - ], - [NEW_SETTER_FACET, FacetCutAction.Add, ["0xb88d846b"]], -]; +export const NEW_DIAMOND = "0xCe314cA8be79435FB0E4ffc102DAcA172B676a47"; +export const NEW_VAI_CONTROLLER = "0xA8122Fe0F9db39E266DE7A5BF953Cd72a87fe345"; + +export const OLD_DIAMOND = "0x11Aa7fF5990E0A341eCeEeE9ddFdF8cE570DD5FD"; +export const OLD_VAI_CONTROLLER = "0x1eA874d53Dad10711Ff69C145bb59d2DFCCD7322"; export const vip550 = () => { const meta = { @@ -64,10 +26,30 @@ export const vip550 = () => { return makeProposal( [ + { + target: UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_DIAMOND], + }, + { + target: NEW_DIAMOND, + signature: "_become(address)", + params: [UNITROLLER], + }, { target: UNITROLLER, signature: "diamondCut((address,uint8,bytes4[])[])", - params: [CUT_PARAMS], + params: [params], + }, + { + target: VAI_UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_VAI_CONTROLLER], + }, + { + target: NEW_VAI_CONTROLLER, + signature: "_become(address)", + params: [VAI_UNITROLLER], }, { target: bsctestnet.ACCESS_CONTROL_MANAGER, @@ -84,6 +66,21 @@ export const vip550 = () => { signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, "setPoolLabel(uint96,string)", bsctestnet.CRITICAL_TIMELOCK], }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setAllowCorePoolFallback(uint96,bool)", bsctestnet.NORMAL_TIMELOCK], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setAllowCorePoolFallback(uint96,bool)", bsctestnet.FAST_TRACK_TIMELOCK], + }, + { + target: bsctestnet.ACCESS_CONTROL_MANAGER, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setAllowCorePoolFallback(uint96,bool)", bsctestnet.CRITICAL_TIMELOCK], + }, ], meta, ProposalType.REGULAR, From 3092171cebc6996c27dad4e44f992f4a5dd6be1a Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Thu, 18 Sep 2025 19:51:49 +0530 Subject: [PATCH 15/24] fix: add allowCorePoolFallback command to addendum for stablecoin emode group --- .../vip-550/abi/comptroller-addendum.json | 4145 +++++++++++++++++ simulations/vip-550/bsctestnet-addendum.ts | 19 +- vips/vip-550/bsctestnet-addendum.ts | 11 + 3 files changed, 4173 insertions(+), 2 deletions(-) create mode 100644 simulations/vip-550/abi/comptroller-addendum.json diff --git a/simulations/vip-550/abi/comptroller-addendum.json b/simulations/vip-550/abi/comptroller-addendum.json new file mode 100644 index 000000000..5ca3a7000 --- /dev/null +++ b/simulations/vip-550/abi/comptroller-addendum.json @@ -0,0 +1,4145 @@ +[ + { + "inputs": [], + "name": "AlreadyInSelectedPool", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowNotAllowedInPool", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPoolLabel", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "InactivePool", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleBorrowedAssets", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOperationForCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum WeightFunction", + "name": "strategy", + "type": "uint8" + } + ], + "name": "InvalidWeightingStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "name": "LiquidityCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [], + "name": "MarketConfigNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "MarketNotListedInCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "PoolDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "ActionProtocolPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "BorrowAllowedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "approver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DistributedVAIVaultVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledForUserUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "NewAccessControl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldComptrollerLens", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newComptrollerLens", + "type": "address" + } + ], + "name": "NewComptrollerLens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldLiquidatorContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLiquidatorContract", + "type": "address" + } + ], + "name": "NewLiquidatorContract", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IPrime", + "name": "oldPrimeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IPrime", + "name": "newPrimeToken", + "type": "address" + } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + } + ], + "name": "NewTreasuryAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + } + ], + "name": "NewTreasuryGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldTreasuryPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "NewTreasuryPercent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "oldVAIController", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "newVAIController", + "type": "address" + } + ], + "name": "NewVAIController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVAIMintRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "NewVAIMintRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseInterval_", + "type": "uint256" + } + ], + "name": "NewVAIVaultInfo", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVenusVAIVaultRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVenusVAIVaultRate", + "type": "uint256" + } + ], + "name": "NewVenusVAIVaultRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVS", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVS", + "type": "address" + } + ], + "name": "NewXVSToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVToken", + "type": "address" + } + ], + "name": "NewXVSVToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolActiveStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolFallbackStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "oldLabel", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "PoolLabelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "PoolMarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "previousPoolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "newPoolId", + "type": "uint96" + } + ], + "name": "PoolSelected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusSeized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusSupplySpeedUpdated", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_grantXVS", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "_setAccessControl", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "_setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "_setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptrollerLens_", + "type": "address" + } + ], + "name": "_setComptrollerLens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidationForUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLiquidatorContract_", + "type": "address" + } + ], + "name": "_setLiquidatorContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "_setPauseGuardian", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "_setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "_setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "_setProtocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + }, + { + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "_setTreasuryData", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "vaiController_", + "type": "address" + } + ], + "name": "_setVAIController", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "_setVAIMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReleaseAmount_", + "type": "uint256" + } + ], + "name": "_setVAIVaultInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "_setVenusSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "venusVAIVaultRate_", + "type": "uint256" + } + ], + "name": "_setVenusVAIVaultRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvs_", + "type": "address" + } + ], + "name": "_setXVSToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVToken_", + "type": "address" + } + ], + "name": "_setXVSVToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "_supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96[]", + "name": "poolIds", + "type": "uint96[]" + }, + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "addPoolMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "collateral", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenusAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "corePoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "diamondCut_", + "type": "tuple[]" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "enterPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "functionSelectorPosition", + "type": "uint96" + } + ], + "internalType": "struct ComptrollerV13Storage.FacetAddressAndPosition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBorrowingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getEffectiveLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "enum WeightFunction", + "name": "weightingStrategy", + "type": "uint8" + } + ], + "name": "getEffectiveLtvFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getPoolMarketIndex", + "outputs": [ + { + "internalType": "PoolMarketId", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "getPoolVTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSVTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "targetPoolId", + "type": "uint96" + } + ], + "name": "hasValidPoolBorrows", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "liquidateBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateVAICalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualMintAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "poolMarkets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "allowCorePoolFallback", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "removePoolMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowerIndex", + "type": "uint256" + } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "seizeVenus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "allowFallback", + "type": "bool" + } + ], + "name": "setAllowCorePoolFallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "borrowAllowed", + "type": "bool" + } + ], + "name": "setIsBorrowAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setMintedVAIOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setPoolActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "setPoolLabel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "unlistMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusInitialIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/bsctestnet-addendum.ts b/simulations/vip-550/bsctestnet-addendum.ts index fdc77de61..001e65eec 100644 --- a/simulations/vip-550/bsctestnet-addendum.ts +++ b/simulations/vip-550/bsctestnet-addendum.ts @@ -11,6 +11,7 @@ import { NEW_VAI_CONTROLLER, OLD_DIAMOND, OLD_VAI_CONTROLLER, + POOL_SPECS, UNITROLLER, VAI_UNITROLLER, vip550, @@ -18,6 +19,7 @@ import { import ACM_ABI from "./abi/AccessControlManager.json"; import DIAMOND_ABI from "./abi/Diamond.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; +import COMPTROLLER_ABI from "./abi/comptroller-addendum.json"; import { cutParams as params } from "./utils/bsctestnet-addendum-cut-params.json"; const bsctestnet = NETWORK_ADDRESSES.bsctestnet; @@ -38,11 +40,13 @@ forking(65806620, async () => { let unitroller: Contract; let vaiUnitroller: Contract; let accessControlManager: Contract; + let comptroller: Contract; before(async () => { unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); vaiUnitroller = await ethers.getContractAt(VAI_UNITROLLR_ABI, VAI_UNITROLLER); accessControlManager = await ethers.getContractAt(ACM_ABI, bsctestnet.ACCESS_CONTROL_MANAGER); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, UNITROLLER); }); describe("Pre-VIP state", async () => { @@ -60,7 +64,12 @@ forking(65806620, async () => { testVip("VIP-550", await vip550(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { - await expectEvents(txResponse, [DIAMOND_ABI, ACM_ABI], ["DiamondCut", "PermissionGranted"], [1, 6]); + await expectEvents( + txResponse, + [VAI_UNITROLLR_ABI, ACM_ABI, COMPTROLLER_ABI], + ["NewImplementation", "DiamondCut", "PermissionGranted", "PoolFallbackStatusUpdated"], + [2, 1, 6, 1], + ); }, }); @@ -105,7 +114,7 @@ forking(65806620, async () => { expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); }); - it("Check new permission", async () => { + it("check new permissions", async () => { for (const method of ["setPoolLabel(uint96,string)", "setAllowCorePoolFallback(uint96,bool)"]) { expect(await accessControlManager.hasPermission(bsctestnet.NORMAL_TIMELOCK, UNITROLLER, method)).to.equal(true); expect(await accessControlManager.hasPermission(bsctestnet.FAST_TRACK_TIMELOCK, UNITROLLER, method)).to.equal( @@ -116,5 +125,11 @@ forking(65806620, async () => { ); } }); + + it("should set the AllowCorePoolFallback to true for Stablecoins emode group", async () => { + const pool = await comptroller.pools(POOL_SPECS.id); + expect(pool.label).to.equal(POOL_SPECS.label); + expect(pool.allowCorePoolFallback).to.equal(POOL_SPECS.allowCorePoolFallback); + }); }); }); diff --git a/vips/vip-550/bsctestnet-addendum.ts b/vips/vip-550/bsctestnet-addendum.ts index e17a42db7..9e9872e14 100644 --- a/vips/vip-550/bsctestnet-addendum.ts +++ b/vips/vip-550/bsctestnet-addendum.ts @@ -14,6 +14,12 @@ export const NEW_VAI_CONTROLLER = "0xA8122Fe0F9db39E266DE7A5BF953Cd72a87fe345"; export const OLD_DIAMOND = "0x11Aa7fF5990E0A341eCeEeE9ddFdF8cE570DD5FD"; export const OLD_VAI_CONTROLLER = "0x1eA874d53Dad10711Ff69C145bb59d2DFCCD7322"; +export const POOL_SPECS = { + label: "Stablecoins", + id: 1, + allowCorePoolFallback: true, // set to true +}; + export const vip550 = () => { const meta = { version: "v2", @@ -81,6 +87,11 @@ export const vip550 = () => { signature: "giveCallPermission(address,string,address)", params: [UNITROLLER, "setAllowCorePoolFallback(uint96,bool)", bsctestnet.CRITICAL_TIMELOCK], }, + { + target: UNITROLLER, + signature: "setAllowCorePoolFallback(uint96,bool)", + params: [POOL_SPECS.id, POOL_SPECS.allowCorePoolFallback], + }, ], meta, ProposalType.REGULAR, From e017de1c055aaedb1e5df7ee7897024f10a4a7db Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 22 Sep 2025 21:11:56 +0530 Subject: [PATCH 16/24] feat: add mainnet vip and simulations --- simulations/vip-550/abi/ACMMainnet.json | 126 + .../vip-550/abi/comptroller-addendum-2.json | 4145 +++++++++++++++++ simulations/vip-550/bscmainnet.ts | 355 ++ .../vip-550/utils/bscmainnet-cut-params.json | 47 +- vips/vip-550/bscmainnet.ts | 556 +++ 5 files changed, 5203 insertions(+), 26 deletions(-) create mode 100644 simulations/vip-550/abi/ACMMainnet.json create mode 100644 simulations/vip-550/abi/comptroller-addendum-2.json create mode 100644 simulations/vip-550/bscmainnet.ts create mode 100644 vips/vip-550/bscmainnet.ts diff --git a/simulations/vip-550/abi/ACMMainnet.json b/simulations/vip-550/abi/ACMMainnet.json new file mode 100644 index 000000000..687d32137 --- /dev/null +++ b/simulations/vip-550/abi/ACMMainnet.json @@ -0,0 +1,126 @@ +[ + { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, + { + "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": "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-550/abi/comptroller-addendum-2.json b/simulations/vip-550/abi/comptroller-addendum-2.json new file mode 100644 index 000000000..5ca3a7000 --- /dev/null +++ b/simulations/vip-550/abi/comptroller-addendum-2.json @@ -0,0 +1,4145 @@ +[ + { + "inputs": [], + "name": "AlreadyInSelectedPool", + "type": "error" + }, + { + "inputs": [], + "name": "ArrayLengthMismatch", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowNotAllowedInPool", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyPoolLabel", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "InactivePool", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleBorrowedAssets", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOperationForCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum WeightFunction", + "name": "strategy", + "type": "uint8" + } + ], + "name": "InvalidWeightingStrategy", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "name": "LiquidityCheckFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [], + "name": "MarketConfigNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "MarketNotListedInCorePool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "PoolDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "ActionProtocolPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "BorrowAllowedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "approver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "DelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusBorrowIndex", + "type": "uint256" + } + ], + "name": "DistributedBorrowerVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "supplier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "venusSupplyIndex", + "type": "uint256" + } + ], + "name": "DistributedSupplierVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "DistributedVAIVaultVenus", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "info", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "detail", + "type": "uint256" + } + ], + "name": "Failure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledForUserUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "IsForcedLiquidationEnabledUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketListed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketUnlisted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "NewAccessControl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldComptrollerLens", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newComptrollerLens", + "type": "address" + } + ], + "name": "NewComptrollerLens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldLiquidatorContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLiquidatorContract", + "type": "address" + } + ], + "name": "NewLiquidatorContract", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPauseGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "NewPauseGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract ResilientOracleInterface", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract IPrime", + "name": "oldPrimeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IPrime", + "name": "newPrimeToken", + "type": "address" + } + ], + "name": "NewPrimeToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + } + ], + "name": "NewTreasuryAddress", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldTreasuryGuardian", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + } + ], + "name": "NewTreasuryGuardian", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldTreasuryPercent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "NewTreasuryPercent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "oldVAIController", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract VAIControllerInterface", + "name": "newVAIController", + "type": "address" + } + ], + "name": "NewVAIController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVAIMintRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "NewVAIMintRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releaseInterval_", + "type": "uint256" + } + ], + "name": "NewVAIVaultInfo", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVenusVAIVaultRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVenusVAIVaultRate", + "type": "uint256" + } + ], + "name": "NewVenusVAIVaultRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVS", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVS", + "type": "address" + } + ], + "name": "NewXVSToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVToken", + "type": "address" + } + ], + "name": "NewXVSVToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolActiveStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldStatus", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "PoolFallbackStatusUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "string", + "name": "oldLabel", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "PoolLabelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "PoolMarketInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PoolMarketRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "previousPoolId", + "type": "uint96" + }, + { + "indexed": true, + "internalType": "uint96", + "name": "newPoolId", + "type": "uint96" + } + ], + "name": "PoolSelected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusBorrowSpeedUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "VenusSeized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSpeed", + "type": "uint256" + } + ], + "name": "VenusSupplySpeedUpdated", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "contract Unitroller", + "name": "unitroller", + "type": "address" + } + ], + "name": "_become", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "_grantXVS", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAccessControlAddress", + "type": "address" + } + ], + "name": "_setAccessControl", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "_setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "_setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "comptrollerLens_", + "type": "address" + } + ], + "name": "_setComptrollerLens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "_setForcedLiquidationForUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLiquidatorContract_", + "type": "address" + } + ], + "name": "_setLiquidatorContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "_setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPauseGuardian", + "type": "address" + } + ], + "name": "_setPauseGuardian", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "_setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "_setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "state", + "type": "bool" + } + ], + "name": "_setProtocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newTreasuryGuardian", + "type": "address" + }, + { + "internalType": "address", + "name": "newTreasuryAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newTreasuryPercent", + "type": "uint256" + } + ], + "name": "_setTreasuryData", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "vaiController_", + "type": "address" + } + ], + "name": "_setVAIController", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newVAIMintRate", + "type": "uint256" + } + ], + "name": "_setVAIMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vault_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "releaseStartBlock_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReleaseAmount_", + "type": "uint256" + } + ], + "name": "_setVAIVaultInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "supplySpeeds", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "borrowSpeeds", + "type": "uint256[]" + } + ], + "name": "_setVenusSpeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "venusVAIVaultRate_", + "type": "uint256" + } + ], + "name": "_setVenusVAIVaultRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvs_", + "type": "address" + } + ], + "name": "_setXVSToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVToken_", + "type": "address" + } + ], + "name": "_setXVSVToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "_supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96[]", + "name": "poolIds", + "type": "uint96[]" + }, + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "addPoolMarkets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approvedDelegates", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowCapGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "collateral", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "bool", + "name": "borrowers", + "type": "bool" + }, + { + "internalType": "bool", + "name": "suppliers", + "type": "bool" + } + ], + "name": "claimVenus", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "holder", + "type": "address" + } + ], + "name": "claimVenusAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptrollerLens", + "outputs": [ + { + "internalType": "contract ComptrollerLensInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "corePoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "createPool", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "diamondCut_", + "type": "tuple[]" + } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "enterPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "uint96", + "name": "functionSelectorPosition", + "type": "uint96" + } + ], + "internalType": "struct ComptrollerV13Storage.FacetAddressAndPosition", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "facet", + "type": "address" + } + ], + "name": "facetPosition", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct Diamond.Facet[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getBorrowingPower", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getEffectiveLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "enum WeightFunction", + "name": "weightingStrategy", + "type": "uint8" + } + ], + "name": "getEffectiveLtvFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getLiquidationThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getPoolMarketIndex", + "outputs": [ + { + "internalType": "PoolMarketId", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + } + ], + "name": "getPoolVTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getXVSVTokenAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint96", + "name": "targetPoolId", + "type": "uint96" + } + ], + "name": "hasValidPoolBorrows", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "isForcedLiquidationEnabledForUser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lastPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "liquidateBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "liquidateBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateVAICalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidatorContract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxAssets", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minReleaseAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualMintAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + } + ], + "name": "mintVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "mintedVAIs", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingComptrollerImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "poolMarkets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isVenus", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentiveMantissa", + "type": "uint256" + }, + { + "internalType": "uint96", + "name": "marketPoolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "isBorrowAllowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "name": "pools", + "outputs": [ + { + "internalType": "string", + "name": "label", + "type": "string" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, + { + "internalType": "bool", + "name": "allowCorePoolFallback", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "prime", + "outputs": [ + { + "internalType": "contract IPrime", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "releaseStartBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "removePoolMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowerIndex", + "type": "uint256" + } + ], + "name": "repayBorrowVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "repayVAIGuardianPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "holders", + "type": "address[]" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "seizeVenus", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seizeVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "markets_", + "type": "address[]" + }, + { + "internalType": "enum Action[]", + "name": "actions_", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused_", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "allowFallback", + "type": "bool" + } + ], + "name": "setAllowCorePoolFallback", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "bool", + "name": "enable", + "type": "bool" + } + ], + "name": "setForcedLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "bool", + "name": "borrowAllowed", + "type": "bool" + } + ], + "name": "setIsBorrowAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "setMintedVAIOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "setPoolActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint96", + "name": "poolId", + "type": "uint96" + }, + { + "internalType": "string", + "name": "newLabel", + "type": "string" + } + ], + "name": "setPoolLabel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracleInterface", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPrime", + "name": "_prime", + "type": "address" + } + ], + "name": "setPrimeToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferAllowed", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "transferVerify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryGuardian", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasuryPercent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "unlistMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "updateDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userPoolId", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiController", + "outputs": [ + { + "internalType": "contract VAIControllerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiMintRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vaiVaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowSpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusBorrowerIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusInitialIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplierIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplySpeeds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "venusSupplyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "block", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "venusVAIVaultRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts new file mode 100644 index 000000000..257439817 --- /dev/null +++ b/simulations/vip-550/bscmainnet.ts @@ -0,0 +1,355 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { + expectEvents, + initMainnetUser, + setMaxStalePeriodInBinanceOracle, + setMaxStalePeriodInChainlinkOracle, + setRedstonePrice, +} from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { + ACM, + BORROW_PAUSED_MARKETS, + CORE_MARKETS, + CORE_MARKETS_WITHOUT_VBNB, + CURRENT_LIQUIDATION_INCENTIVE, + GUARDIAN_1, + GUARDIAN_2, + LIQUIDATOR, + LIQUIDATOR_PROXY_ADMIN, + MARKETS_BA, + MARKET_CONFIGURATION_AGGREGATOR, + NEW_COMPTROLLER_LENS, + NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK, + NEW_COMPT_METHODS_FOR_GUARDIAN_1, + NEW_COMPT_METHODS_FOR_GUARDIAN_2, + NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK, + NEW_DIAMOND, + NEW_LIQUIDATOR_IMPL, + NEW_VAI_CONTROLLER, + NEW_VBEP20_DELEGATE, + OLD_COMPTROLLER_LENS, + OLD_DIAMOND, + OLD_LIQUIDATOR_IMPL, + OLD_VAI_CONTROLLER, + POOL_SPECS, + UNITROLLER, + VAI_UNITROLLER, + vip550, +} from "../../vips/vip-550/bscmainnet"; +import ACM_ABI from "./abi/ACMMainnet.json"; +import DIAMOND_ABI from "./abi/Diamond.json"; +import LIQUIDATOR_ABI from "./abi/Liquidator.json"; +import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; +import OLD_ABI from "./abi/OldComptroller.json"; +import UNITROLLER_ABI from "./abi/Unitroller.json"; +import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; +import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; +import COMPTROLLER_ABI from "./abi/comptroller-addendum-2.json"; +import { cutParams as params } from "./utils/bscmainnet-cut-params.json"; + +type CutParam = [string, number, string[]]; +const cutParams = params as unknown as CutParam[]; + +const OLD_MARKET_FACET = "0xd47c074c219E6947BB350D9aD220eE20fCCC6549"; +const OLD_POLICY_FACET = "0xF2095BeCa3030D43976ED46D5ca488D58354E8c9"; +const OLD_REWARD_FACET = "0x05e4C8f3dbb6c2eaD4eB1f28611FA7180e79f428"; +const OLD_SETTER_FACET = "0x92B26cb819335DA336f59480F0ca30F9a3f18E0a"; + +const NEW_MARKET_FACET = "0x6e9bD95830bb775fb9F24b9559f8894d92143CA1"; +const NEW_POLICY_FACET = "0x7155227C2763228F236a0D858dccDB32740a2893"; +const NEW_REWARD_FACET = "0x1d903eEa9d98a6Ac071a1f4531dc6958B4629cBE"; +const NEW_SETTER_FACET = "0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b"; + +forking(62056649, async () => { + let unitroller: Contract; + let comptroller: Contract; + let accessControlManager: Contract; + let vaiUnitroller: Contract; + let liquidator: Contract; + let proxyAdmin: SignerWithAddress; + let impUnitroller: SignerWithAddress; + + before(async () => { + unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, UNITROLLER); + accessControlManager = await ethers.getContractAt(ACM_ABI, ACM); + vaiUnitroller = await ethers.getContractAt(VAI_UNITROLLR_ABI, VAI_UNITROLLER); + liquidator = await ethers.getContractAt(LIQUIDATOR_PROXY_ABI, LIQUIDATOR); + proxyAdmin = await initMainnetUser(LIQUIDATOR_PROXY_ADMIN, parseUnits("2", 18)); + impUnitroller = await initMainnetUser(UNITROLLER, parseUnits("2", 18)); + + console.log(`Setting max stale period...`); + for (const market of CORE_MARKETS) { + // Call function with default feed = AddressZero (so it fetches from oracle.tokenConfigs) + await setMaxStalePeriodInChainlinkOracle( + NETWORK_ADDRESSES.bscmainnet.CHAINLINK_ORACLE, + market.underlying, + ethers.constants.AddressZero, + NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + 315360000, + ); + + await setMaxStalePeriodInChainlinkOracle( + NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, + market.underlying, + ethers.constants.AddressZero, + NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + 315360000, + ); + await setMaxStalePeriodInBinanceOracle( + NETWORK_ADDRESSES.bscmainnet.BINANCE_ORACLE, + market.symbol.slice(1), + 315360000, + ); + } + + const xSolvBTC = "0x1346b618dC92810EC74163e4c27004c921D446a5"; + const xSolvBTC_RedStone_Feed = "0x24c8964338Deb5204B096039147B8e8C3AEa42Cc"; + await setRedstonePrice( + NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, + xSolvBTC, + xSolvBTC_RedStone_Feed, + NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + ); + + const THE = "0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11"; + const THE_REDSTONE_FEED = "0xFB1267A29C0aa19daae4a483ea895862A69e4AA5"; + await setRedstonePrice( + NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, + THE, + THE_REDSTONE_FEED, + NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + ); + }); + + describe("Pre-VIP state", async () => { + it("check current risk factors", async () => { + const oldComptoller = await ethers.getContractAt(OLD_ABI, UNITROLLER); + for (const market of CORE_MARKETS) { + const data = await oldComptoller.markets(market.address); + expect(data[0]).to.equal(true); // isListed + expect(data[1]).to.equal(market.collateralFactor); + } + expect(await oldComptoller.liquidationIncentiveMantissa()).to.equal(CURRENT_LIQUIDATION_INCENTIVE); + }); + it("unitroller should have old implementation", async () => { + expect((await unitroller.comptrollerImplementation()).toLowerCase()).to.equal(OLD_DIAMOND.toLowerCase()); + }); + + it("comptroller should have old comptrollerLens", async () => { + expect((await comptroller.comptrollerLens()).toLowerCase()).to.equal(OLD_COMPTROLLER_LENS.toLowerCase()); + }); + + it("VAI Unitroller should point to old VAI Controller", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(OLD_VAI_CONTROLLER); + }); + + it("Liquidator should point to old implementation", async () => { + const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); + expect(impl.toLowerCase()).to.equal(OLD_LIQUIDATOR_IMPL.toLowerCase()); + }); + }); + + testVip("VIP-550", await vip550(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + const totalMarkets = CORE_MARKETS.length; + const totalBAMarkets = MARKETS_BA.length; + await expectEvents( + txResponse, + [UNITROLLER_ABI, DIAMOND_ABI, LIQUIDATOR_ABI, ACM_ABI], + ["NewPendingImplementation", "DiamondCut", "NewLiquidationTreasuryPercent", "RoleGranted", "RoleRevoked"], + [4, 1, 1, 35, 7], + ); + await expectEvents(txResponse, [VBEP20_DELEGATOR_ABI], ["NewImplementation"], [totalMarkets + 1]); // +2 for unitroller and VAI, -1 for vBNB + await expectEvents( + txResponse, + [COMPTROLLER_ABI], + ["NewLiquidationThreshold", "NewLiquidationIncentive", "BorrowAllowedUpdated", "NewCollateralFactor"], + [totalMarkets - 2, totalMarkets + 2, totalBAMarkets + 1, 2], // -4 for markets with 0 collateral factor +2 for emode + ); + }, + }); + + describe("Post-VIP state (emode upgrade)", async () => { + it("unitroller should have new implementation", async () => { + expect(await unitroller.comptrollerImplementation()).equals(NEW_DIAMOND); + }); + + it("market facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[0][2], ...cutParams[1][2]]; + expect(await unitroller.facetFunctionSelectors(NEW_MARKET_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_MARKET_FACET)).to.deep.equal([]); + }); + + it("policy facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = cutParams[2][2]; + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + + it("reward facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = cutParams[3][2]; + expect(await unitroller.facetFunctionSelectors(NEW_REWARD_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_REWARD_FACET)).to.deep.equal([]); + }); + + it("setter facet function selectors should be replaced with new facet address", async () => { + const functionSelectors = [...cutParams[4][2], ...cutParams[5][2]]; + expect(await unitroller.facetFunctionSelectors(NEW_SETTER_FACET)).to.deep.equal(functionSelectors); + expect(await unitroller.facetFunctionSelectors(OLD_SETTER_FACET)).to.deep.equal([]); + }); + + it("unitroller should contain the new facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_SETTER_FACET, NEW_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.include(NEW_MARKET_FACET, NEW_POLICY_FACET); + + expect(await unitroller.facetAddresses()).to.not.include(OLD_SETTER_FACET, OLD_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_MARKET_FACET, OLD_POLICY_FACET); + }); + + it("Check removed permission", async () => { + for (const timelock of [ + NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK, + NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK, + NETWORK_ADDRESSES.bscmainnet.GUARDIAN, + ]) { + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(timelock, "_setCollateralFactor(address,uint256)"), + ).to.equal(false); + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(timelock, "_setLiquidationIncentive(uint256)"), + ).to.equal(false); + } + }); + + it("Check new permission", async () => { + // All Timelocks + for (const method of NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK) { + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, method), + ).to.equal(true); + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK, method), + ).to.equal(true); + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK, method), + ).to.equal(true); + } + + // Only Normal Timelock + for (const method of NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK) { + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, method), + ).to.equal(true); + } + + // Guardian-1 + for (const method of NEW_COMPT_METHODS_FOR_GUARDIAN_1) { + expect(await accessControlManager.connect(impUnitroller).isAllowedToCall(GUARDIAN_1, method)).to.equal(true); + } + + // Guardian-2 + expect( + await accessControlManager.connect(impUnitroller).isAllowedToCall(GUARDIAN_2, NEW_COMPT_METHODS_FOR_GUARDIAN_2), + ).to.equal(true); + }); + + it("comptroller should have new comptrollerLens", async () => { + expect(await comptroller.comptrollerLens()).to.equal(NEW_COMPTROLLER_LENS); + }); + + it("markets should have new implemenation", async () => { + for (const market of CORE_MARKETS_WITHOUT_VBNB) { + const marketContract = await ethers.getContractAt(VBEP20_DELEGATOR_ABI, market.address); + expect(await marketContract.implementation()).equals(NEW_VBEP20_DELEGATE); + } + }); + + it("comptroller should have correct markets value", async () => { + for (const market of CORE_MARKETS) { + const data = await comptroller.markets(market.address); + expect(data[1]).to.equal(market.collateralFactor); + expect(data[3]).to.equal(market.collateralFactor); // same LT + expect(data[4]).to.equal(CURRENT_LIQUIDATION_INCENTIVE); + expect(data[5]).to.equal(0); // corePool + if (BORROW_PAUSED_MARKETS.includes(market.symbol)) { + expect(data[6]).to.equal(false); // isBorrowAllowed + } else { + expect(data[6]).to.equal(true); + } + } + }); + + it("VAI Controller should point to new impl", async () => { + expect(await vaiUnitroller.vaiControllerImplementation()).to.equal(NEW_VAI_CONTROLLER); + }); + + it("Liquidator should point to new implementation", async () => { + const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); + expect(impl).to.equal(NEW_LIQUIDATOR_IMPL); + }); + + it("MarketConfigurationAggregator should not have ACM permissions", async () => { + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(MARKET_CONFIGURATION_AGGREGATOR, "setCollateralFactor(address,uint256,uint256)"), + ).to.equal(false); + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(MARKET_CONFIGURATION_AGGREGATOR, "setLiquidationIncentive(address,uint256)"), + ).to.equal(false); + expect( + await accessControlManager + .connect(impUnitroller) + .isAllowedToCall(MARKET_CONFIGURATION_AGGREGATOR, "setIsBorrowAllowed(uint96,address,bool)"), + ).to.equal(false); + }); + }); + + describe("Post-VIP state (Stablecoin emode group)", async () => { + it("should update lastPoolId to the new pool", async () => { + expect(await comptroller.lastPoolId()).to.equals(POOL_SPECS.id); + }); + + it("should set the newly created pool as active with correct label", async () => { + const newPool = await comptroller.pools(POOL_SPECS.id); + expect(newPool.label).to.equals(POOL_SPECS.label); + expect(newPool.isActive).to.equals(true); + }); + + it("should set the correct risk parameters to all pool markets", async () => { + for (const market of POOL_SPECS.marketsConfig) { + const marketData = await comptroller.poolMarkets(POOL_SPECS.id, market.address); + expect(marketData.marketPoolId).to.be.equal(POOL_SPECS.id); + expect(marketData.isListed).to.be.equal(true); + expect(marketData.collateralFactorMantissa).to.be.equal(market.collateralFactor); + expect(marketData.liquidationThresholdMantissa).to.be.equal(market.liquidationThreshold); + expect(marketData.liquidationIncentiveMantissa).to.be.equal(market.liquidationIncentive); + expect(marketData.isBorrowAllowed).to.be.equal(market.borrowAllowed); + } + }); + }); +}); diff --git a/simulations/vip-550/utils/bscmainnet-cut-params.json b/simulations/vip-550/utils/bscmainnet-cut-params.json index 12cac7547..aa3c5f675 100644 --- a/simulations/vip-550/utils/bscmainnet-cut-params.json +++ b/simulations/vip-550/utils/bscmainnet-cut-params.json @@ -1,9 +1,11 @@ { "cutParams": [ [ - "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + "0x6e9bD95830bb775fb9F24b9559f8894d92143CA1", 1, [ + "0x3d98a1e5", + "0xcab4f84c", "0xa76b3fda", "0x929fe9a1", "0xc2998238", @@ -19,14 +21,11 @@ ] ], [ - "0xfdFd4BEdc16339fE2dfa19Bab8bC9B8DA4149F75", + "0x6e9bD95830bb775fb9F24b9559f8894d92143CA1", 0, [ - "0xd463654c", - "0x4d99c776", - "0x3d98a1e5", - "0xcab4f84c", "0x89c13be0", + "0xd463654c", "0xd0d13036", "0xf9682732", "0x23617585", @@ -34,6 +33,7 @@ "0x19ef3e8b", "0xd686e9ee", "0x7b86e42c", + "0x4d99c776", "0x63e0d634", "0xf02fdf97", "0x0ef332ca", @@ -43,9 +43,10 @@ ] ], [ - "0x284d000665296515280a4fB066a887EFF6A3bD9E", + "0x7155227C2763228F236a0D858dccDB32740a2893", 1, [ + "0x528a174c", "0xead1a8a0", "0xda3d454c", "0x5c778605", @@ -65,9 +66,8 @@ "0x6a56947e" ] ], - ["0x284d000665296515280a4fB066a887EFF6A3bD9E", 0, ["0x528a174c"]], [ - "0x0CB4FdDA118Da048B9AAaC15f34662C6AB34F5dB", + "0x1d903eEa9d98a6Ac071a1f4531dc6958B4629cBE", 1, [ "0xa7604b41", @@ -83,9 +83,17 @@ ] ], [ - "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + "0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b", 1, [ + "0x24aaa220", + "0x12348e96", + "0x5cc4fdeb", + "0x8b3113f6", + "0x186db48f", + "0xd136af44", + "0x530e784f", + "0xc32094c7", "0xf519fc30", "0x2b5d790c", "0x317b0b77", @@ -110,23 +118,10 @@ ] ], [ - "0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", + "0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b", 0, - [ - "0x24aaa220", - "0x5cc4fdeb", - "0x8b3113f6", - "0x12348e96", - "0xc32094c7", - "0x530e784f", - "0x9159b177", - "0xa89766dd", - "0x35439240", - "0x9bd8f6e8", - "0x186db48f", - "0xd136af44" - ] + ["0x7938146f", "0x9159b177", "0xa89766dd", "0x35439240", "0x9bd8f6e8", "0x4964f48c", "0xb88d846b"] ], - ["0xe41Ab9b0ea3edD4cE3108650056641F1E361246c", 2, ["0xe4028eee", "0x4fd42e17"]] + ["0x0000000000000000000000000000000000000000", 2, ["0xe4028eee", "0x4fd42e17", "0xa8431081"]] ] } diff --git a/vips/vip-550/bscmainnet.ts b/vips/vip-550/bscmainnet.ts new file mode 100644 index 000000000..93543be95 --- /dev/null +++ b/vips/vip-550/bscmainnet.ts @@ -0,0 +1,556 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { cutParams as params } from "../../simulations/vip-550/utils/bscmainnet-cut-params.json"; + +export const UNITROLLER = "0xfD36E2c2a6789Db23113685031d7F16329158384"; +export const VAI_UNITROLLER = "0x004065D34C6b18cE4370ced1CeBDE94865DbFAFE"; +export const LIQUIDATOR = "0x0870793286aaDA55D39CE7f82fb2766e8004cF43"; +export const ACM = "0x4788629abc6cfca10f9f969efdeaa1cf70c23555"; +export const LIQUIDATOR_PROXY_ADMIN = "0x2b40B43AC5F7949905b0d2Ed9D6154a8ce06084a"; +export const GUARDIAN_1 = "0x7B1AE5Ea599bC56734624b95589e7E8E64C351c9"; +export const GUARDIAN_2 = "0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B"; + +export const NEW_DIAMOND = "0x6c151A4134006395D41319d713349660259DAB4e"; +export const NEW_VAI_CONTROLLER = "0x5134C9D11c397efdF36F828eEf23B14F3F399da4"; +export const NEW_VBEP20_DELEGATE = "0xAF658DF443a937C88c955c737532E9a601ccEF8c"; +export const NEW_LIQUIDATOR_IMPL = "0xD65297007411694aA18c2941a5EB2b6ed4E0b819"; +export const NEW_COMPTROLLER_LENS = "0xd701C1fDAE34f9Cf242a4de19a2e7288f924EA1C"; +export const MARKET_CONFIGURATION_AGGREGATOR = "0x16bb2CEc0B286ceECca3aE195e378FDe264b43b4"; + +export const OLD_VAI_CONTROLLER = "0xE4109433CEE11172dcCaE80d9c3bcDDFF4A7Cf57"; +export const OLD_DIAMOND = "0xb61a58aCA9F39dEA8C22F4c9a377C68a1Ea3723C"; +export const OLD_COMPTROLLER_LENS = "0x9D228f57227839a9c514077c3909c9992F7900Af"; +export const OLD_VBEP20_DELEGATE = "0xA674296091B703e38dB2f3a937f02334627dCdaD"; +export const OLD_LIQUIDATOR_IMPL = "0x1da2Fe628F50C14bc2A873A96B6D10392830621f"; + +export const CURRENT_LIQUIDATION_INCENTIVE = parseUnits("1.1", 18); +export const LIQUIDATOR_TREASURTY_PERCENT = parseUnits("0.5", 18); + +export const NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK = [ + "createPool(string)", + "addPoolMarkets(uint96[],address[])", + "removePoolMarket(uint96,address)", + "setPoolActive(uint96,bool)", + "setCollateralFactor(address,uint256,uint256)", + "setCollateralFactor(uint96,address,uint256,uint256)", + "setIsBorrowAllowed(uint96,address,bool)", + "setAllowCorePoolFallback(uint96,bool)", + "setPoolLabel(uint96,string)", +]; + +export const NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK = [ + "setLiquidationIncentive(address,uint256)", + "setLiquidationIncentive(uint96,address,uint256)", +]; + +export const NEW_COMPT_METHODS_FOR_GUARDIAN_1 = [ + "setCollateralFactor(address,uint256,uint256)", + "setCollateralFactor(uint96,address,uint256,uint256)", +]; + +export const NEW_COMPT_METHODS_FOR_GUARDIAN_2 = "setIsBorrowAllowed(uint96,address,bool)"; + +export const REMOVED_COMPT_METHODS = ["_setCollateralFactor(address,uint256)", "_setLiquidationIncentive(uint256)"]; + +export const CORE_MARKETS = [ + { + symbol: "vUSDC", + underlying: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", + address: "0xecA88125a5ADbe82614ffC12D0DB554E2e2867C8", + collateralFactor: 825000000000000000n, + }, + { + symbol: "vUSDT", + underlying: "0x55d398326f99059fF775485246999027B3197955", + address: "0xfD5840Cd36d94D7229439859C0112a4185BC0255", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vBUSD", + underlying: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56", + address: "0x95c78222B3D6e262426483D42CfA53685A67Ab9D", + collateralFactor: 0n, + }, + { + symbol: "vSXP", + underlying: "0x47BEAd2563dCBf3bF2c9407fEa4dC236fAbA485A", + address: "0x2fF3d0F6990a40261c66E1ff2017aCBc282EB6d0", + collateralFactor: 0n, + }, + { + symbol: "vXVS", + underlying: "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63", + address: "0x151B1e2635A717bcDc836ECd6FbB62B674FE3E1D", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vBNB", + underlying: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + address: "0xA07c5b74C9B40447a954e1466938b865b6BBea36", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vBTC", + underlying: "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c", + address: "0x882C173bC7Ff3b7786CA16dfeD3DFFfb9Ee7847B", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vETH", + underlying: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + address: "0xf508fCD89b8bd15579dc79A6827cB4686A3592c8", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vLTC", + underlying: "0x4338665CBB7B2485A8855A139b75D5e34AB0DB94", + address: "0x57A5297F2cB2c0AaC9D554660acd6D385Ab50c6B", + collateralFactor: 630000000000000000n, + }, + { + symbol: "vXRP", + underlying: "0x1D2F0da169ceB9fC7B3144628dB156f3F6c60dBE", + address: "0xB248a295732e0225acd3337607cc01068e3b9c10", + collateralFactor: 650000000000000000n, + }, + { + symbol: "vBCH", + underlying: "0x8fF795a6F4D97E7887C79beA79aba5cc76444aDf", + address: "0x5F0388EBc2B94FA8E123F404b79cCF5f40b29176", + collateralFactor: 600000000000000000n, + }, + { + symbol: "vDOT", + underlying: "0x7083609fCE4d1d8Dc0C979AAb8c869Ea2C873402", + address: "0x1610bc33319e9398de5f57B33a5b184c806aD217", + collateralFactor: 650000000000000000n, + }, + { + symbol: "vLINK", + underlying: "0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD", + address: "0x650b940a1033B8A1b1873f78730FcFC73ec11f1f", + collateralFactor: 630000000000000000n, + }, + { + symbol: "vDAI", + underlying: "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3", + address: "0x334b3eCB4DCa3593BCCC3c7EBD1A1C1d1780FBF1", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vFIL", + underlying: "0x0D8Ce2A99Bb6e3B7Db580eD848240e4a0F9aE153", + address: "0xf91d58b5aE142DAcC749f58A49FCBac340Cb0343", + collateralFactor: 630000000000000000n, + }, + { + symbol: "vBETH", + underlying: "0x250632378E573c6Be1AC2f97Fcdf00515d0Aa91B", + address: "0x972207A639CC1B374B893cc33Fa251b55CEB7c07", + collateralFactor: 400000000000000000n, + }, + { + symbol: "vADA", + underlying: "0x3EE2200Efb3400fAbB9AacF31297cBdD1d435D47", + address: "0x9A0AF7FDb2065Ce470D72664DE73cAE409dA28Ec", + collateralFactor: 630000000000000000n, + }, + { + symbol: "vDOGE", + underlying: "0xbA2aE424d960c26247Dd6c32edC70B295c744C43", + address: "0xec3422Ef92B2fb59e84c8B02Ba73F1fE84Ed8D71", + collateralFactor: 430000000000000000n, + }, + { + symbol: "vMATIC", + underlying: "0xCC42724C6683B7E57334c4E856f4c9965ED682bD", + address: "0x5c9476FcD6a4F9a3654139721c949c2233bBbBc8", + collateralFactor: 650000000000000000n, + }, + { + symbol: "vCAKE", + underlying: "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82", + address: "0x86aC3974e2BD0d60825230fa6F355fF11409df5c", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vAAVE", + underlying: "0xfb6115445Bff7b52FeB98650C87f44907E58f802", + address: "0x26DA28954763B92139ED49283625ceCAf52C6f94", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vTUSDOLD", + underlying: "0x14016E85a25aeb13065688cAFB43044C2ef86784", + address: "0x08CEB3F4a7ed3500cA0982bcd0FC7816688084c3", + collateralFactor: 0n, + }, + { + symbol: "vTRXOLD", + underlying: "0x85EAC5Ac2F758618dFa09bDbe0cf174e7d574D5B", + address: "0x61eDcFe8Dd6bA3c891CB9bEc2dc7657B3B422E93", + collateralFactor: 0n, + }, + // { + // symbol: "vTRX", + // underlying: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + // address: "0xC5D3466aA484B040eE977073fcF337f2c00071c1", + // collateralFactor: 525000000000000000n, + // }, + { + symbol: "vWBETH", + underlying: "0xa2E3356610840701BDf5611a53974510Ae27E2e1", + address: "0x6CFdEc747f37DAf3b87a35a1D9c8AD3063A1A8A0", + collateralFactor: 800000000000000000n, + }, + { + symbol: "vTUSD", + underlying: "0x40af3827F39D0EAcBF4A168f8D4ee67c121D11c9", + address: "0xBf762cd5991cA1DCdDaC9ae5C638F5B5Dc3Bee6E", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vUNI", + underlying: "0xBf5140A22578168FD562DCcF235E5D43A02ce9B1", + address: "0x27FF564707786720C71A2e5c1490A63266683612", + collateralFactor: 550000000000000000n, + }, + { + symbol: "vFDUSD", + underlying: "0xc5f0f7b66764F6ec8C8Dff7BA683102295E16409", + address: "0xC4eF4229FEc74Ccfe17B2bdeF7715fAC740BA0ba", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vTWT", + underlying: "0x4B0F1812e5Df2A09796481Ff14017e6005508003", + address: "0x4d41a36D04D97785bcEA57b057C412b278e6Edcc", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vSolvBTC", + underlying: "0x4aae823a6a0b376De6A78e74eCC5b079d38cBCf7", + address: "0xf841cb62c19fCd4fF5CD0AaB5939f3140BaaC3Ea", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vTHE", + underlying: "0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11", + address: "0x86e06EAfa6A1eA631Eab51DE500E3D474933739f", + collateralFactor: 530000000000000000n, + }, + { + symbol: "vSOL", + underlying: "0x570A5D26f7765Ecb712C0924E4De545B89fD43dF", + address: "0xBf515bA4D1b52FFdCeaBF20d31D705Ce789F2cEC", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vlisUSD", + underlying: "0x0782b6d8c4551B9760e74c0545a9bCD90bdc41E5", + address: "0x689E0daB47Ab16bcae87Ec18491692BF621Dc6Ab", + collateralFactor: 550000000000000000n, + }, + // { + // symbol: "vPT-sUSDE-26JUN2025", + // underlying: "0xDD809435ba6c9d6903730f923038801781cA66ce", + // address: "0x9e4E5fed5Ac5B9F732d0D850A615206330Bf1866", + // collateralFactor: 700000000000000000n, + // }, + { + symbol: "vsUSDe", + underlying: "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2", + address: "0x699658323d58eE25c69F1a29d476946ab011bD18", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vUSDe", + underlying: "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34", + address: "0x74ca6930108F775CC667894EEa33843e691680d7", + collateralFactor: 750000000000000000n, + }, + { + symbol: "vUSD1", + underlying: "0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d", + address: "0x0C1DA220D301155b87318B90692Da8dc43B67340", + collateralFactor: 500000000000000000n, + }, + { + symbol: "vxSolvBTC", + underlying: "0x1346b618dC92810EC74163e4c27004c921D446a5", + address: "0xd804dE60aFD05EE6B89aab5D152258fD461B07D5", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vasBNB", + underlying: "0x77734e70b6E88b4d82fE632a168EDf6e700912b6", + address: "0xCC1dB43a06d97f736C7B045AedD03C6707c09BDF", + collateralFactor: 720000000000000000n, + }, + { + symbol: "vWBNB", + underlying: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", + address: "0x6bCa74586218dB34cdB402295796b79663d816e9", + collateralFactor: 800000000000000000n, + }, +]; + +export const CORE_MARKETS_WITHOUT_VBNB = CORE_MARKETS.filter(market => market.symbol != "vBNB"); +export const MARKETS_CF_LT = CORE_MARKETS.map(market => [ + market.address, + market.collateralFactor, + market.collateralFactor, +]); +export const MARKETS_LI = CORE_MARKETS.map(market => [market.address, CURRENT_LIQUIDATION_INCENTIVE]); +export const BORROW_PAUSED_MARKETS = [ + "vasBNB", + "vsUSDe", + "vxSolvBTC", + "vPT-sUSDE-26JUN2025", + "vBUSD", + "vSXP", + "vXVS", + "vBETH", + "vTUSDOLD", + "vTRXOLD", +]; +export const MARKETS_BA = CORE_MARKETS.filter(market => !BORROW_PAUSED_MARKETS.includes(market.symbol)).map(market => [ + 0, + market.address, + true, +]); + +// emode group +export const vUSDE = "0x74ca6930108F775CC667894EEa33843e691680d7"; +export const vsUSDE = "0x699658323d58eE25c69F1a29d476946ab011bD18"; +export const POOL_SPECS = { + label: "Stablecoins", + id: 1, + markets: [vUSDE, vsUSDE], + marketsConfig: [ + { + address: vUSDE, + collateralFactor: parseUnits("0.90", 18), + liquidationThreshold: parseUnits("0.92", 18), + liquidationIncentive: parseUnits("1.06", 18), + borrowAllowed: true, + }, + { + address: vsUSDE, + collateralFactor: parseUnits("0.89", 18), + liquidationThreshold: parseUnits("0.91", 18), + liquidationIncentive: parseUnits("1.08", 18), + borrowAllowed: false, + }, + ], +}; + +export const vip550 = () => { + const meta = { + version: "v2", + title: "Emode in the BNB Core Pool", + description: `Emode in the BNB Core Pool`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_DIAMOND], + }, + { + target: NEW_DIAMOND, + signature: "_become(address)", + params: [UNITROLLER], + }, + { + target: UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [params], + }, + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK], + }; + }), + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK], + }; + }), + ...REMOVED_COMPT_METHODS.map(method => { + return { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK], + }; + }), + { + target: UNITROLLER, + signature: "_setComptrollerLens(address)", + params: [NEW_COMPTROLLER_LENS], + }, + + ...[...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK, ...NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK].map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK], + }; + }), + ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK], + }; + }), + ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK], + }; + }), + ...NEW_COMPT_METHODS_FOR_GUARDIAN_1.map(method => { + return { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, method, GUARDIAN_1], + }; + }), + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, NEW_COMPT_METHODS_FOR_GUARDIAN_2, GUARDIAN_2], + }, + ...CORE_MARKETS_WITHOUT_VBNB.map(vToken => { + return { + target: vToken.address, + signature: "_setImplementation(address,bool,bytes)", + params: [NEW_VBEP20_DELEGATE, false, "0x"], + }; + }), + + // give temporary permission + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setCollateralFactor(address,uint256,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setLiquidationIncentive(address,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [UNITROLLER, "setIsBorrowAllowed(uint96,address,bool)", MARKET_CONFIGURATION_AGGREGATOR], + }, + + // execute in batch + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeCollateralFactorBatch((address,uint256,uint256)[])", + params: [MARKETS_CF_LT], + }, + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeLiquidationIncentiveBatch((address,uint256)[])", + params: [MARKETS_LI], + }, + { + target: MARKET_CONFIGURATION_AGGREGATOR, + signature: "executeBorrowAllowedBatch((uint96,address,bool)[])", + params: [MARKETS_BA], + }, + + // remove temporary permissions + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setCollateralFactor(address,uint256,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setLiquidationIncentive(address,uint256)", MARKET_CONFIGURATION_AGGREGATOR], + }, + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "setIsBorrowAllowed(uint96,address,bool)", MARKET_CONFIGURATION_AGGREGATOR], + }, + + { + target: VAI_UNITROLLER, + signature: "_setPendingImplementation(address)", + params: [NEW_VAI_CONTROLLER], + }, + { + target: NEW_VAI_CONTROLLER, + signature: "_become(address)", + params: [VAI_UNITROLLER], + }, + { + target: LIQUIDATOR_PROXY_ADMIN, + signature: "upgrade(address,address)", + params: [LIQUIDATOR, NEW_LIQUIDATOR_IMPL], + }, + { + target: LIQUIDATOR, + signature: "setTreasuryPercent(uint256)", + params: [LIQUIDATOR_TREASURTY_PERCENT], + }, + + // stablecoin emode + { + target: UNITROLLER, + signature: "createPool(string)", + params: [POOL_SPECS.label], + }, + { + target: UNITROLLER, + signature: "addPoolMarkets(uint96[],address[])", + params: [Array(POOL_SPECS.markets.length).fill(POOL_SPECS.id), POOL_SPECS.markets], + }, + ...POOL_SPECS.marketsConfig.map(market => { + return { + target: UNITROLLER, + signature: "setCollateralFactor(uint96,address,uint256,uint256)", + params: [POOL_SPECS.id, market.address, market.collateralFactor, market.liquidationThreshold], + }; + }), + ...POOL_SPECS.marketsConfig.map(market => { + return { + target: UNITROLLER, + signature: "setLiquidationIncentive(uint96,address,uint256)", + params: [POOL_SPECS.id, market.address, market.liquidationIncentive], + }; + }), + ...POOL_SPECS.marketsConfig.map(market => { + return { + target: UNITROLLER, + signature: "setIsBorrowAllowed(uint96,address,bool)", + params: [POOL_SPECS.id, market.address, market.borrowAllowed], + }; + }), + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip550; From a9efb71e4672aed7d97ba78b5c41000fed51ccd3 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Mon, 22 Sep 2025 21:53:48 +0530 Subject: [PATCH 17/24] fix: add setAllowCorePoolFallback command --- simulations/vip-550/bscmainnet.ts | 60 ++++++++++++------------------- vips/vip-550/bscmainnet.ts | 46 ++++++++++++------------ 2 files changed, 47 insertions(+), 59 deletions(-) diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts index 257439817..4b0403ced 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-550/bscmainnet.ts @@ -55,6 +55,8 @@ import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; import COMPTROLLER_ABI from "./abi/comptroller-addendum-2.json"; import { cutParams as params } from "./utils/bscmainnet-cut-params.json"; +const { bscmainnet } = NETWORK_ADDRESSES; + type CutParam = [string, number, string[]]; const cutParams = params as unknown as CutParam[]; @@ -90,44 +92,30 @@ forking(62056649, async () => { for (const market of CORE_MARKETS) { // Call function with default feed = AddressZero (so it fetches from oracle.tokenConfigs) await setMaxStalePeriodInChainlinkOracle( - NETWORK_ADDRESSES.bscmainnet.CHAINLINK_ORACLE, + bscmainnet.CHAINLINK_ORACLE, market.underlying, ethers.constants.AddressZero, - NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, + bscmainnet.NORMAL_TIMELOCK, 315360000, ); await setMaxStalePeriodInChainlinkOracle( - NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, + bscmainnet.REDSTONE_ORACLE, market.underlying, ethers.constants.AddressZero, - NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, - 315360000, - ); - await setMaxStalePeriodInBinanceOracle( - NETWORK_ADDRESSES.bscmainnet.BINANCE_ORACLE, - market.symbol.slice(1), + bscmainnet.NORMAL_TIMELOCK, 315360000, ); + await setMaxStalePeriodInBinanceOracle(bscmainnet.BINANCE_ORACLE, market.symbol.slice(1), 315360000); } const xSolvBTC = "0x1346b618dC92810EC74163e4c27004c921D446a5"; const xSolvBTC_RedStone_Feed = "0x24c8964338Deb5204B096039147B8e8C3AEa42Cc"; - await setRedstonePrice( - NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, - xSolvBTC, - xSolvBTC_RedStone_Feed, - NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, - ); + await setRedstonePrice(bscmainnet.REDSTONE_ORACLE, xSolvBTC, xSolvBTC_RedStone_Feed, bscmainnet.NORMAL_TIMELOCK); const THE = "0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11"; const THE_REDSTONE_FEED = "0xFB1267A29C0aa19daae4a483ea895862A69e4AA5"; - await setRedstonePrice( - NETWORK_ADDRESSES.bscmainnet.REDSTONE_ORACLE, - THE, - THE_REDSTONE_FEED, - NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, - ); + await setRedstonePrice(bscmainnet.REDSTONE_ORACLE, THE, THE_REDSTONE_FEED, bscmainnet.NORMAL_TIMELOCK); }); describe("Pre-VIP state", async () => { @@ -156,6 +144,11 @@ forking(62056649, async () => { const impl = await liquidator.connect(proxyAdmin).callStatic.implementation(); expect(impl.toLowerCase()).to.equal(OLD_LIQUIDATOR_IMPL.toLowerCase()); }); + + it("unitroller should have old Facets", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_SETTER_FACET, OLD_REWARD_FACET); + expect(await unitroller.facetAddresses()).to.include(OLD_MARKET_FACET, OLD_POLICY_FACET); + }); }); testVip("VIP-550", await vip550(), { @@ -217,10 +210,10 @@ forking(62056649, async () => { it("Check removed permission", async () => { for (const timelock of [ - NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, - NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK, - NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK, - NETWORK_ADDRESSES.bscmainnet.GUARDIAN, + bscmainnet.NORMAL_TIMELOCK, + bscmainnet.FAST_TRACK_TIMELOCK, + bscmainnet.CRITICAL_TIMELOCK, + bscmainnet.GUARDIAN, ]) { expect( await accessControlManager @@ -239,28 +232,20 @@ forking(62056649, async () => { // All Timelocks for (const method of NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK) { expect( - await accessControlManager - .connect(impUnitroller) - .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, method), + await accessControlManager.connect(impUnitroller).isAllowedToCall(bscmainnet.NORMAL_TIMELOCK, method), ).to.equal(true); expect( - await accessControlManager - .connect(impUnitroller) - .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK, method), + await accessControlManager.connect(impUnitroller).isAllowedToCall(bscmainnet.FAST_TRACK_TIMELOCK, method), ).to.equal(true); expect( - await accessControlManager - .connect(impUnitroller) - .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK, method), + await accessControlManager.connect(impUnitroller).isAllowedToCall(bscmainnet.CRITICAL_TIMELOCK, method), ).to.equal(true); } // Only Normal Timelock for (const method of NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK) { expect( - await accessControlManager - .connect(impUnitroller) - .isAllowedToCall(NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK, method), + await accessControlManager.connect(impUnitroller).isAllowedToCall(bscmainnet.NORMAL_TIMELOCK, method), ).to.equal(true); } @@ -338,6 +323,7 @@ forking(62056649, async () => { const newPool = await comptroller.pools(POOL_SPECS.id); expect(newPool.label).to.equals(POOL_SPECS.label); expect(newPool.isActive).to.equals(true); + expect(newPool.allowCorePoolFallback).to.equal(POOL_SPECS.allowCorePoolFallback); }); it("should set the correct risk parameters to all pool markets", async () => { diff --git a/vips/vip-550/bscmainnet.ts b/vips/vip-550/bscmainnet.ts index 93543be95..d45b55556 100644 --- a/vips/vip-550/bscmainnet.ts +++ b/vips/vip-550/bscmainnet.ts @@ -5,6 +5,8 @@ import { makeProposal } from "src/utils"; import { cutParams as params } from "../../simulations/vip-550/utils/bscmainnet-cut-params.json"; +const { bscmainnet } = NETWORK_ADDRESSES; + export const UNITROLLER = "0xfD36E2c2a6789Db23113685031d7F16329158384"; export const VAI_UNITROLLER = "0x004065D34C6b18cE4370ced1CeBDE94865DbFAFE"; export const LIQUIDATOR = "0x0870793286aaDA55D39CE7f82fb2766e8004cF43"; @@ -53,8 +55,6 @@ export const NEW_COMPT_METHODS_FOR_GUARDIAN_1 = [ export const NEW_COMPT_METHODS_FOR_GUARDIAN_2 = "setIsBorrowAllowed(uint96,address,bool)"; -export const REMOVED_COMPT_METHODS = ["_setCollateralFactor(address,uint256)", "_setLiquidationIncentive(uint256)"]; - export const CORE_MARKETS = [ { symbol: "vUSDC", @@ -329,6 +329,7 @@ export const vsUSDE = "0x699658323d58eE25c69F1a29d476946ab011bD18"; export const POOL_SPECS = { label: "Stablecoins", id: 1, + allowCorePoolFallback: true, markets: [vUSDE, vsUSDE], marketsConfig: [ { @@ -375,52 +376,47 @@ export const vip550 = () => { signature: "diamondCut((address,uint8,bytes4[])[])", params: [params], }, - ...REMOVED_COMPT_METHODS.map(method => { - return { - target: ACM, - signature: "revokeCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK], - }; - }), - ...REMOVED_COMPT_METHODS.map(method => { - return { - target: ACM, - signature: "revokeCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK], - }; - }), - ...REMOVED_COMPT_METHODS.map(method => { + + // revoke permissions for removed methods + ...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK, bscmainnet.CRITICAL_TIMELOCK].map(timelock => { return { target: ACM, signature: "revokeCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK], + params: [UNITROLLER, "_setCollateralFactor(address,uint256)", timelock], }; }), + { + target: ACM, + signature: "revokeCallPermission(address,string,address)", + params: [UNITROLLER, "_setLiquidationIncentive(uint256)", bscmainnet.NORMAL_TIMELOCK], + }, + { target: UNITROLLER, signature: "_setComptrollerLens(address)", params: [NEW_COMPTROLLER_LENS], }, + // Give permission for new methods ...[...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK, ...NEW_COMPT_METHODS_FOR_NORMAL_TIMELOCK].map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.NORMAL_TIMELOCK], + params: [UNITROLLER, method, bscmainnet.NORMAL_TIMELOCK], }; }), ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.FAST_TRACK_TIMELOCK], + params: [UNITROLLER, method, bscmainnet.FAST_TRACK_TIMELOCK], }; }), ...NEW_COMPT_METHODS_FOR_EVERY_TIMELOCK.map(method => { return { target: ACM, signature: "giveCallPermission(address,string,address)", - params: [UNITROLLER, method, NETWORK_ADDRESSES.bscmainnet.CRITICAL_TIMELOCK], + params: [UNITROLLER, method, bscmainnet.CRITICAL_TIMELOCK], }; }), ...NEW_COMPT_METHODS_FOR_GUARDIAN_1.map(method => { @@ -494,6 +490,7 @@ export const vip550 = () => { params: [UNITROLLER, "setIsBorrowAllowed(uint96,address,bool)", MARKET_CONFIGURATION_AGGREGATOR], }, + // update IMPL { target: VAI_UNITROLLER, signature: "_setPendingImplementation(address)", @@ -515,7 +512,7 @@ export const vip550 = () => { params: [LIQUIDATOR_TREASURTY_PERCENT], }, - // stablecoin emode + // Stablecoins emode { target: UNITROLLER, signature: "createPool(string)", @@ -547,6 +544,11 @@ export const vip550 = () => { params: [POOL_SPECS.id, market.address, market.borrowAllowed], }; }), + { + target: UNITROLLER, + signature: "setAllowCorePoolFallback(uint96,bool)", + params: [POOL_SPECS.id, POOL_SPECS.allowCorePoolFallback], + }, ], meta, ProposalType.REGULAR, From 46e7262feccab314f4dc1f084881ac720b47e4c0 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 23 Sep 2025 12:30:12 +0530 Subject: [PATCH 18/24] fix: set max-stale-preriod for usde and susde --- simulations/vip-550/bscmainnet.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts index 4b0403ced..0984287ea 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-550/bscmainnet.ts @@ -116,6 +116,37 @@ forking(62056649, async () => { const THE = "0xF4C8E32EaDEC4BFe97E0F595AdD0f4450a863a11"; const THE_REDSTONE_FEED = "0xFB1267A29C0aa19daae4a483ea895862A69e4AA5"; await setRedstonePrice(bscmainnet.REDSTONE_ORACLE, THE, THE_REDSTONE_FEED, bscmainnet.NORMAL_TIMELOCK); + + const SUSDE = "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2"; + const USDE = "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"; + await setRedstonePrice( + bscmainnet.REDSTONE_ORACLE, + SUSDE, + "0x5ED849a45B4608952161f45483F4B95BCEa7f8f0", // RedStone price feed for sUSDe/USDe + bscmainnet.NORMAL_TIMELOCK, + 3153600000, + ); + await setMaxStalePeriodInChainlinkOracle( + bscmainnet.CHAINLINK_ORACLE, + SUSDE, // sUSDe + "0x1a269eA1b209DA2c12bDCDab22635C9e6C5028B2", // SUSDE / USDE Exchange Rate + bscmainnet.NORMAL_TIMELOCK, + 3153600000, + ); + await setRedstonePrice( + bscmainnet.REDSTONE_ORACLE, + USDE, + "0x0d9b42a2a73Ec528759701D0B70Ccf974a327EBb", + bscmainnet.NORMAL_TIMELOCK, + 3153600000, + ); // RedStone Price Feed for USDe + await setMaxStalePeriodInChainlinkOracle( + bscmainnet.CHAINLINK_ORACLE, + USDE, // USDe + "0x10402B01cD2E6A9ed6DBe683CbC68f78Ff02f8FC", // USDE / USD Exchange Rate + bscmainnet.NORMAL_TIMELOCK, + 3153600000, + ); }); describe("Pre-VIP state", async () => { From ab8410fadf349b79185113ac9b6cc92b785aa043 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 23 Sep 2025 14:06:20 +0530 Subject: [PATCH 19/24] fix: TRX oracle price error --- simulations/vip-550/bscmainnet.ts | 6 ++++++ vips/vip-550/bscmainnet.ts | 24 +++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts index 0984287ea..c901228b6 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-550/bscmainnet.ts @@ -117,6 +117,12 @@ forking(62056649, async () => { const THE_REDSTONE_FEED = "0xFB1267A29C0aa19daae4a483ea895862A69e4AA5"; await setRedstonePrice(bscmainnet.REDSTONE_ORACLE, THE, THE_REDSTONE_FEED, bscmainnet.NORMAL_TIMELOCK); + const TRX = "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3"; + const TRX_REDSTONE_FEED = "0xa17362dd9AD6d0aF646D7C8f8578fddbfc90B916"; + await setRedstonePrice(bscmainnet.REDSTONE_ORACLE, TRX, TRX_REDSTONE_FEED, bscmainnet.NORMAL_TIMELOCK, 3153600000, { + tokenDecimals: 6, + }); + const SUSDE = "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2"; const USDE = "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"; await setRedstonePrice( diff --git a/vips/vip-550/bscmainnet.ts b/vips/vip-550/bscmainnet.ts index d45b55556..e6363f080 100644 --- a/vips/vip-550/bscmainnet.ts +++ b/vips/vip-550/bscmainnet.ts @@ -194,12 +194,12 @@ export const CORE_MARKETS = [ address: "0x61eDcFe8Dd6bA3c891CB9bEc2dc7657B3B422E93", collateralFactor: 0n, }, - // { - // symbol: "vTRX", - // underlying: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", - // address: "0xC5D3466aA484B040eE977073fcF337f2c00071c1", - // collateralFactor: 525000000000000000n, - // }, + { + symbol: "vTRX", + underlying: "0xCE7de646e7208a4Ef112cb6ed5038FA6cC6b12e3", + address: "0xC5D3466aA484B040eE977073fcF337f2c00071c1", + collateralFactor: 525000000000000000n, + }, { symbol: "vWBETH", underlying: "0xa2E3356610840701BDf5611a53974510Ae27E2e1", @@ -537,13 +537,11 @@ export const vip550 = () => { params: [POOL_SPECS.id, market.address, market.liquidationIncentive], }; }), - ...POOL_SPECS.marketsConfig.map(market => { - return { - target: UNITROLLER, - signature: "setIsBorrowAllowed(uint96,address,bool)", - params: [POOL_SPECS.id, market.address, market.borrowAllowed], - }; - }), + { + target: UNITROLLER, + signature: "setIsBorrowAllowed(uint96,address,bool)", + params: [POOL_SPECS.id, vUSDE, true], + }, { target: UNITROLLER, signature: "setAllowCorePoolFallback(uint96,bool)", From abfaf1336ad2ee86d11bdadb3d00b438ef2a3e60 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 23 Sep 2025 14:21:16 +0530 Subject: [PATCH 20/24] fix: PT/sUSDe oracle price error --- simulations/vip-550/abi/RedstoneOracle.json | 398 ++++++++++++++++++++ simulations/vip-550/bscmainnet.ts | 37 +- vips/vip-550/bscmainnet.ts | 12 +- 3 files changed, 411 insertions(+), 36 deletions(-) create mode 100644 simulations/vip-550/abi/RedstoneOracle.json diff --git a/simulations/vip-550/abi/RedstoneOracle.json b/simulations/vip-550/abi/RedstoneOracle.json new file mode 100644 index 000000000..dba10f01c --- /dev/null +++ b/simulations/vip-550/abi/RedstoneOracle.json @@ -0,0 +1,398 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousPriceMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPriceMantissa", + "type": "uint256" + } + ], + "name": "PricePosted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "feed", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxStalePeriod", + "type": "uint256" + } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "prices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + } + ], + "name": "setDirectPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "feed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxStalePeriod", + "type": "uint256" + } + ], + "internalType": "struct ChainlinkOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "feed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxStalePeriod", + "type": "uint256" + } + ], + "internalType": "struct ChainlinkOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenConfigs", + "outputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "address", + "name": "feed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxStalePeriod", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts index c901228b6..aee1b2f92 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-550/bscmainnet.ts @@ -49,6 +49,7 @@ import DIAMOND_ABI from "./abi/Diamond.json"; import LIQUIDATOR_ABI from "./abi/Liquidator.json"; import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; import OLD_ABI from "./abi/OldComptroller.json"; +import REDSTONE_ABI from "./abi/RedstoneOracle.json"; import UNITROLLER_ABI from "./abi/Unitroller.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; @@ -123,36 +124,12 @@ forking(62056649, async () => { tokenDecimals: 6, }); - const SUSDE = "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2"; - const USDE = "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34"; - await setRedstonePrice( - bscmainnet.REDSTONE_ORACLE, - SUSDE, - "0x5ED849a45B4608952161f45483F4B95BCEa7f8f0", // RedStone price feed for sUSDe/USDe - bscmainnet.NORMAL_TIMELOCK, - 3153600000, - ); - await setMaxStalePeriodInChainlinkOracle( - bscmainnet.CHAINLINK_ORACLE, - SUSDE, // sUSDe - "0x1a269eA1b209DA2c12bDCDab22635C9e6C5028B2", // SUSDE / USDE Exchange Rate - bscmainnet.NORMAL_TIMELOCK, - 3153600000, - ); - await setRedstonePrice( - bscmainnet.REDSTONE_ORACLE, - USDE, - "0x0d9b42a2a73Ec528759701D0B70Ccf974a327EBb", - bscmainnet.NORMAL_TIMELOCK, - 3153600000, - ); // RedStone Price Feed for USDe - await setMaxStalePeriodInChainlinkOracle( - bscmainnet.CHAINLINK_ORACLE, - USDE, // USDe - "0x10402B01cD2E6A9ed6DBe683CbC68f78Ff02f8FC", // USDE / USD Exchange Rate - bscmainnet.NORMAL_TIMELOCK, - 3153600000, - ); + const PTsUSDE_26JUN2025 = "0xDD809435ba6c9d6903730f923038801781cA66ce"; + const PT_SUSDE_FIXED_PRICE = parseUnits("1.05", 18); + + const impersonatedTimelock = await initMainnetUser(bscmainnet.NORMAL_TIMELOCK, ethers.utils.parseEther("2")); + const oracle = new ethers.Contract(bscmainnet.REDSTONE_ORACLE, REDSTONE_ABI, ethers.provider); + await oracle.connect(impersonatedTimelock).setDirectPrice(PTsUSDE_26JUN2025, PT_SUSDE_FIXED_PRICE); }); describe("Pre-VIP state", async () => { diff --git a/vips/vip-550/bscmainnet.ts b/vips/vip-550/bscmainnet.ts index e6363f080..5932e3315 100644 --- a/vips/vip-550/bscmainnet.ts +++ b/vips/vip-550/bscmainnet.ts @@ -254,12 +254,12 @@ export const CORE_MARKETS = [ address: "0x689E0daB47Ab16bcae87Ec18491692BF621Dc6Ab", collateralFactor: 550000000000000000n, }, - // { - // symbol: "vPT-sUSDE-26JUN2025", - // underlying: "0xDD809435ba6c9d6903730f923038801781cA66ce", - // address: "0x9e4E5fed5Ac5B9F732d0D850A615206330Bf1866", - // collateralFactor: 700000000000000000n, - // }, + { + symbol: "vPT-sUSDE-26JUN2025", + underlying: "0xDD809435ba6c9d6903730f923038801781cA66ce", + address: "0x9e4E5fed5Ac5B9F732d0D850A615206330Bf1866", + collateralFactor: 700000000000000000n, + }, { symbol: "vsUSDe", underlying: "0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2", From 32d3d72d64893c9869d32adc37bb36ee58464d26 Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 23 Sep 2025 15:36:37 +0530 Subject: [PATCH 21/24] fix: PT/sUSDe oracle price error --- simulations/vip-550/abi/ResilientOracle.json | 320 +++++++++++++++++++ simulations/vip-550/bscmainnet.ts | 11 + 2 files changed, 331 insertions(+) create mode 100644 simulations/vip-550/abi/ResilientOracle.json diff --git a/simulations/vip-550/abi/ResilientOracle.json b/simulations/vip-550/abi/ResilientOracle.json new file mode 100644 index 000000000..373eb14e9 --- /dev/null +++ b/simulations/vip-550/abi/ResilientOracle.json @@ -0,0 +1,320 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "nativeMarketAddress", "type": "address" }, + { "internalType": "address", "name": "vaiAddress", "type": "address" }, + { "internalType": "contract BoundValidatorInterface", "name": "_boundValidator", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "calledContract", "type": "address" }, + { "internalType": "string", "name": "methodSignature", "type": "string" } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "CachedEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint8", "name": "version", "type": "uint8" }], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "oldAccessControlManager", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "newAccessControlManager", "type": "address" } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" }, + { "indexed": true, "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "OracleEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "oracle", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "role", "type": "uint256" } + ], + "name": "OracleSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "asset", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "mainOracle", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "pivotOracle", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "TokenConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "CACHE_SLOT", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INVALID_PRICE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_ADDR", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [{ "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "boundValidator", + "outputs": [{ "internalType": "contract BoundValidatorInterface", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" }, + { "internalType": "bool", "name": "enable", "type": "bool" } + ], + "name": "enableOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "getOracle", + "outputs": [ + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "getTokenConfig", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "getUnderlyingPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "nativeMarket", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "accessControlManager_", "type": "address" }], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "enum ResilientOracle.OracleRole", "name": "role", "type": "uint8" } + ], + "name": "setOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig", + "name": "tokenConfig", + "type": "tuple" + } + ], + "name": "setTokenConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[3]", "name": "oracles", "type": "address[3]" }, + { "internalType": "bool[3]", "name": "enableFlagsForOracles", "type": "bool[3]" }, + { "internalType": "bool", "name": "cachingEnabled", "type": "bool" } + ], + "internalType": "struct ResilientOracle.TokenConfig[]", + "name": "tokenConfigs_", + "type": "tuple[]" + } + ], + "name": "setTokenConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "asset", "type": "address" }], + "name": "updateAssetPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "vToken", "type": "address" }], + "name": "updatePrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vai", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-550/bscmainnet.ts index aee1b2f92..027739def 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-550/bscmainnet.ts @@ -50,6 +50,7 @@ import LIQUIDATOR_ABI from "./abi/Liquidator.json"; import LIQUIDATOR_PROXY_ABI from "./abi/LiquidatorProxy.json"; import OLD_ABI from "./abi/OldComptroller.json"; import REDSTONE_ABI from "./abi/RedstoneOracle.json"; +import RESILIENT_ABI from "./abi/ResilientOracle.json"; import UNITROLLER_ABI from "./abi/Unitroller.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; import VBEP20_DELEGATOR_ABI from "./abi/VBEP20Delegator.json"; @@ -129,6 +130,16 @@ forking(62056649, async () => { const impersonatedTimelock = await initMainnetUser(bscmainnet.NORMAL_TIMELOCK, ethers.utils.parseEther("2")); const oracle = new ethers.Contract(bscmainnet.REDSTONE_ORACLE, REDSTONE_ABI, ethers.provider); + const resilientOracle = new ethers.Contract(bscmainnet.RESILIENT_ORACLE, RESILIENT_ABI, ethers.provider); + + await resilientOracle + .connect(impersonatedTimelock) + .setTokenConfig([ + PTsUSDE_26JUN2025, + [bscmainnet.REDSTONE_ORACLE, ethers.constants.AddressZero, ethers.constants.AddressZero], + [true, false, false], + false, + ]); await oracle.connect(impersonatedTimelock).setDirectPrice(PTsUSDE_26JUN2025, PT_SUSDE_FIXED_PRICE); }); From 130930a2c3c017b788d30ddb4ed9ccef07660a0e Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Tue, 23 Sep 2025 14:16:10 +0200 Subject: [PATCH 22/24] feat: set ID and description for VIP 547 --- .../{vip-550 => vip-547}/abi/ACMMainnet.json | 0 .../abi/AccessControlManager.json | 0 .../{vip-550 => vip-547}/abi/Comptroller.json | 0 .../{vip-550 => vip-547}/abi/Diamond.json | 0 .../{vip-550 => vip-547}/abi/Liquidator.json | 0 .../abi/LiquidatorProxy.json | 0 .../abi/OldComptroller.json | 0 .../abi/RedstoneOracle.json | 0 .../abi/ResilientOracle.json | 0 .../{vip-550 => vip-547}/abi/Unitroller.json | 0 .../abi/VAIUnitroller.json | 0 .../abi/VBEP20Delegator.json | 0 .../abi/comptroller-addendum-2.json | 0 .../abi/comptroller-addendum.json | 0 .../{vip-550 => vip-547}/bscmainnet.ts | 6 +- .../bsctestnet-addendum.ts | 6 +- .../{vip-550 => vip-547}/bsctestnet.ts | 6 +- .../utils/bscmainnet-cut-params.json | 0 .../utils/bsctestnet-addendum-cut-params.json | 0 .../utils/bsctestnet-cut-params.json | 0 vips/{vip-550 => vip-547}/bscmainnet.ts | 119 +++++++++++++++++- .../bsctestnet-addendum.ts | 6 +- vips/{vip-550 => vip-547}/bsctestnet.ts | 6 +- 23 files changed, 129 insertions(+), 20 deletions(-) rename simulations/{vip-550 => vip-547}/abi/ACMMainnet.json (100%) rename simulations/{vip-550 => vip-547}/abi/AccessControlManager.json (100%) rename simulations/{vip-550 => vip-547}/abi/Comptroller.json (100%) rename simulations/{vip-550 => vip-547}/abi/Diamond.json (100%) rename simulations/{vip-550 => vip-547}/abi/Liquidator.json (100%) rename simulations/{vip-550 => vip-547}/abi/LiquidatorProxy.json (100%) rename simulations/{vip-550 => vip-547}/abi/OldComptroller.json (100%) rename simulations/{vip-550 => vip-547}/abi/RedstoneOracle.json (100%) rename simulations/{vip-550 => vip-547}/abi/ResilientOracle.json (100%) rename simulations/{vip-550 => vip-547}/abi/Unitroller.json (100%) rename simulations/{vip-550 => vip-547}/abi/VAIUnitroller.json (100%) rename simulations/{vip-550 => vip-547}/abi/VBEP20Delegator.json (100%) rename simulations/{vip-550 => vip-547}/abi/comptroller-addendum-2.json (100%) rename simulations/{vip-550 => vip-547}/abi/comptroller-addendum.json (100%) rename simulations/{vip-550 => vip-547}/bscmainnet.ts (99%) rename simulations/{vip-550 => vip-547}/bsctestnet-addendum.ts (98%) rename simulations/{vip-550 => vip-547}/bsctestnet.ts (99%) rename simulations/{vip-550 => vip-547}/utils/bscmainnet-cut-params.json (100%) rename simulations/{vip-550 => vip-547}/utils/bsctestnet-addendum-cut-params.json (100%) rename simulations/{vip-550 => vip-547}/utils/bsctestnet-cut-params.json (100%) rename vips/{vip-550 => vip-547}/bscmainnet.ts (68%) rename vips/{vip-550 => vip-547}/bsctestnet-addendum.ts (96%) rename vips/{vip-550 => vip-547}/bsctestnet.ts (99%) diff --git a/simulations/vip-550/abi/ACMMainnet.json b/simulations/vip-547/abi/ACMMainnet.json similarity index 100% rename from simulations/vip-550/abi/ACMMainnet.json rename to simulations/vip-547/abi/ACMMainnet.json diff --git a/simulations/vip-550/abi/AccessControlManager.json b/simulations/vip-547/abi/AccessControlManager.json similarity index 100% rename from simulations/vip-550/abi/AccessControlManager.json rename to simulations/vip-547/abi/AccessControlManager.json diff --git a/simulations/vip-550/abi/Comptroller.json b/simulations/vip-547/abi/Comptroller.json similarity index 100% rename from simulations/vip-550/abi/Comptroller.json rename to simulations/vip-547/abi/Comptroller.json diff --git a/simulations/vip-550/abi/Diamond.json b/simulations/vip-547/abi/Diamond.json similarity index 100% rename from simulations/vip-550/abi/Diamond.json rename to simulations/vip-547/abi/Diamond.json diff --git a/simulations/vip-550/abi/Liquidator.json b/simulations/vip-547/abi/Liquidator.json similarity index 100% rename from simulations/vip-550/abi/Liquidator.json rename to simulations/vip-547/abi/Liquidator.json diff --git a/simulations/vip-550/abi/LiquidatorProxy.json b/simulations/vip-547/abi/LiquidatorProxy.json similarity index 100% rename from simulations/vip-550/abi/LiquidatorProxy.json rename to simulations/vip-547/abi/LiquidatorProxy.json diff --git a/simulations/vip-550/abi/OldComptroller.json b/simulations/vip-547/abi/OldComptroller.json similarity index 100% rename from simulations/vip-550/abi/OldComptroller.json rename to simulations/vip-547/abi/OldComptroller.json diff --git a/simulations/vip-550/abi/RedstoneOracle.json b/simulations/vip-547/abi/RedstoneOracle.json similarity index 100% rename from simulations/vip-550/abi/RedstoneOracle.json rename to simulations/vip-547/abi/RedstoneOracle.json diff --git a/simulations/vip-550/abi/ResilientOracle.json b/simulations/vip-547/abi/ResilientOracle.json similarity index 100% rename from simulations/vip-550/abi/ResilientOracle.json rename to simulations/vip-547/abi/ResilientOracle.json diff --git a/simulations/vip-550/abi/Unitroller.json b/simulations/vip-547/abi/Unitroller.json similarity index 100% rename from simulations/vip-550/abi/Unitroller.json rename to simulations/vip-547/abi/Unitroller.json diff --git a/simulations/vip-550/abi/VAIUnitroller.json b/simulations/vip-547/abi/VAIUnitroller.json similarity index 100% rename from simulations/vip-550/abi/VAIUnitroller.json rename to simulations/vip-547/abi/VAIUnitroller.json diff --git a/simulations/vip-550/abi/VBEP20Delegator.json b/simulations/vip-547/abi/VBEP20Delegator.json similarity index 100% rename from simulations/vip-550/abi/VBEP20Delegator.json rename to simulations/vip-547/abi/VBEP20Delegator.json diff --git a/simulations/vip-550/abi/comptroller-addendum-2.json b/simulations/vip-547/abi/comptroller-addendum-2.json similarity index 100% rename from simulations/vip-550/abi/comptroller-addendum-2.json rename to simulations/vip-547/abi/comptroller-addendum-2.json diff --git a/simulations/vip-550/abi/comptroller-addendum.json b/simulations/vip-547/abi/comptroller-addendum.json similarity index 100% rename from simulations/vip-550/abi/comptroller-addendum.json rename to simulations/vip-547/abi/comptroller-addendum.json diff --git a/simulations/vip-550/bscmainnet.ts b/simulations/vip-547/bscmainnet.ts similarity index 99% rename from simulations/vip-550/bscmainnet.ts rename to simulations/vip-547/bscmainnet.ts index 027739def..3ba98a5f7 100644 --- a/simulations/vip-550/bscmainnet.ts +++ b/simulations/vip-547/bscmainnet.ts @@ -42,8 +42,8 @@ import { POOL_SPECS, UNITROLLER, VAI_UNITROLLER, - vip550, -} from "../../vips/vip-550/bscmainnet"; + vip547, +} from "../../vips/vip-547/bscmainnet"; import ACM_ABI from "./abi/ACMMainnet.json"; import DIAMOND_ABI from "./abi/Diamond.json"; import LIQUIDATOR_ABI from "./abi/Liquidator.json"; @@ -176,7 +176,7 @@ forking(62056649, async () => { }); }); - testVip("VIP-550", await vip550(), { + testVip("VIP-547", await vip547(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { const totalMarkets = CORE_MARKETS.length; const totalBAMarkets = MARKETS_BA.length; diff --git a/simulations/vip-550/bsctestnet-addendum.ts b/simulations/vip-547/bsctestnet-addendum.ts similarity index 98% rename from simulations/vip-550/bsctestnet-addendum.ts rename to simulations/vip-547/bsctestnet-addendum.ts index 001e65eec..7807a3010 100644 --- a/simulations/vip-550/bsctestnet-addendum.ts +++ b/simulations/vip-547/bsctestnet-addendum.ts @@ -14,8 +14,8 @@ import { POOL_SPECS, UNITROLLER, VAI_UNITROLLER, - vip550, -} from "../../vips/vip-550/bsctestnet-addendum"; + vip547, +} from "../../vips/vip-547/bsctestnet-addendum"; import ACM_ABI from "./abi/AccessControlManager.json"; import DIAMOND_ABI from "./abi/Diamond.json"; import VAI_UNITROLLR_ABI from "./abi/VAIUnitroller.json"; @@ -62,7 +62,7 @@ forking(65806620, async () => { }); }); - testVip("VIP-550", await vip550(), { + testVip("VIP-547", await vip547(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { await expectEvents( txResponse, diff --git a/simulations/vip-550/bsctestnet.ts b/simulations/vip-547/bsctestnet.ts similarity index 99% rename from simulations/vip-550/bsctestnet.ts rename to simulations/vip-547/bsctestnet.ts index cb7fd5197..16893d41d 100644 --- a/simulations/vip-550/bsctestnet.ts +++ b/simulations/vip-547/bsctestnet.ts @@ -37,8 +37,8 @@ import { OLD_VAI_CONTROLLER, UNITROLLER, VAI_UNITROLLER, - vip550, -} from "../../vips/vip-550/bsctestnet"; + vip547, +} from "../../vips/vip-547/bsctestnet"; import ACM_ABI from "./abi/AccessControlManager.json"; import COMPTROLLER_ABI from "./abi/Comptroller.json"; import DIAMOND_ABI from "./abi/Diamond.json"; @@ -130,7 +130,7 @@ forking(65463763, async () => { }); }); - testVip("VIP-550", await vip550(), { + testVip("VIP-547", await vip547(), { callbackAfterExecution: async (txResponse: TransactionResponse) => { const totalMarkets = CORE_MARKETS.length; const toatlBAMarkets = MARKETS_BA.length; diff --git a/simulations/vip-550/utils/bscmainnet-cut-params.json b/simulations/vip-547/utils/bscmainnet-cut-params.json similarity index 100% rename from simulations/vip-550/utils/bscmainnet-cut-params.json rename to simulations/vip-547/utils/bscmainnet-cut-params.json diff --git a/simulations/vip-550/utils/bsctestnet-addendum-cut-params.json b/simulations/vip-547/utils/bsctestnet-addendum-cut-params.json similarity index 100% rename from simulations/vip-550/utils/bsctestnet-addendum-cut-params.json rename to simulations/vip-547/utils/bsctestnet-addendum-cut-params.json diff --git a/simulations/vip-550/utils/bsctestnet-cut-params.json b/simulations/vip-547/utils/bsctestnet-cut-params.json similarity index 100% rename from simulations/vip-550/utils/bsctestnet-cut-params.json rename to simulations/vip-547/utils/bsctestnet-cut-params.json diff --git a/vips/vip-550/bscmainnet.ts b/vips/vip-547/bscmainnet.ts similarity index 68% rename from vips/vip-550/bscmainnet.ts rename to vips/vip-547/bscmainnet.ts index 5932e3315..0c48f525f 100644 --- a/vips/vip-550/bscmainnet.ts +++ b/vips/vip-547/bscmainnet.ts @@ -3,7 +3,7 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; -import { cutParams as params } from "../../simulations/vip-550/utils/bscmainnet-cut-params.json"; +import { cutParams as params } from "../../simulations/vip-547/utils/bscmainnet-cut-params.json"; const { bscmainnet } = NETWORK_ADDRESSES; @@ -349,11 +349,120 @@ export const POOL_SPECS = { ], }; -export const vip550 = () => { +export const vip547 = () => { const meta = { version: "v2", - title: "Emode in the BNB Core Pool", - description: `Emode in the BNB Core Pool`, + title: "[BNB Chain] Enable E-Mode in the Core pool (1/2)", + description: `#### Summary + +If passed, following the community proposal “[E-Mode and Liquidation Threshold in the BNB Chain Core pool](https://community.venus.io/t/e-mode-and-liquidation-threshold-in-the-bnb-chain-core-pool/5339)” ([snapshot](https://snapshot.box/#/s:venus-xvs.eth/proposal/0xf2cc2ca902a340d7409de18ee3cd50dc8f1465b52bcf91b28dea1c9fe943a01b)), this VIP will upgrade the implementations of the following contracts on BNB Chain, including support for [E-Mode](https://docs-v4.venus.io/whats-new/emode): + +- [Unitroller](https://bscscan.com/address/0xfD36E2c2a6789Db23113685031d7F16329158384) +- [Liquidator](https://bscscan.com/address/0x0870793286aaDA55D39CE7f82fb2766e8004cF43) +- [VAIController](https://bscscan.com/address/0x004065D34C6b18cE4370ced1CeBDE94865DbFAFE) +- VTokens. Every current market on BNB Chain Core Pool, other than vBNB + +Additionally, following the [Chaos Labs recommendations](https://community.venus.io/t/e-mode-and-liquidation-threshold-in-the-bnb-chain-core-pool/5339/8), this VIP will enable a "Stablecoins" E-Mode group with the [USDe](https://app.venus.io/#/pool/0xfD36E2c2a6789Db23113685031d7F16329158384/market/0x74ca6930108F775CC667894EEa33843e691680d7?chainId=56&tab=supply) and [sUSDe](https://app.venus.io/#/pool/0xfD36E2c2a6789Db23113685031d7F16329158384/market/0x699658323d58eE25c69F1a29d476946ab011bD18?chainId=56&tab=supply) markets. This is intended as a soft launch of the feature. Additional VIPs will be proposed in the coming days to add more E-Mode groups, as outlined in [this community proposal](https://community.venus.io/t/e-mode-and-liquidation-threshold-in-the-bnb-chain-core-pool/5339/7) ([snapshot](https://snapshot.box/#/s:venus-xvs.eth/proposal/0x0fe626f2a7979d6ff63333523e77c12187ad987485b1bd609c45fb0a1fc090b6)). + +#### Description + +The details of the new “Stablecoins” E-Mode group are: + +- Label: Stablecoins (it can be updated in the future, with a VIP) +- Markets: + - [sUSDe](https://app.venus.io/#/pool/0xfD36E2c2a6789Db23113685031d7F16329158384/market/0x74ca6930108F775CC667894EEa33843e691680d7?chainId=56&tab=supply) + - Collateral Factor: 89% + - Liquidation Threshold: 91% + - Liquidation Incentive: 8% + - It cannot be borrowed but it can be used as collateral + - [USDe](https://app.venus.io/#/pool/0xfD36E2c2a6789Db23113685031d7F16329158384/market/0x74ca6930108F775CC667894EEa33843e691680d7?chainId=56&tab=supply) + - Collateral Factor: 90% + - Liquidation Threshold: 92% + - Liquidation Incentive: 6% + - It can be borrowed and used as collateral + +Currently, the Liquidation Threshold for all markets in the Core pool matches their respective Collateral Factors. Chaos Labs will review and recommend appropriate adjustments to these Liquidation Threshold parameters soon. + +The Liquidation Incentive remains at 10% for all markets in the Core pool, consistent with previous settings. This risk parameter may be adjusted on a per-market basis in the future, pending review and recommendations from Chaos Labs. + +**Granted permissions** + +- Normal, Fast-track and Critical timelocks are authorized to execute the following functions: + - "createPool(string)" + - "addPoolMarkets(uint96[],address[])" + - "removePoolMarket(uint96,address)" + - "setPoolActive(uint96,bool)" + - "setCollateralFactor(address,uint256,uint256)" + - "setCollateralFactor(uint96,address,uint256,uint256)" + - "setIsBorrowAllowed(uint96,address,bool)" + - "setAllowCorePoolFallback(uint96,bool)" + - "setPoolLabel(uint96,string)" +- Normal Timelock can also execute the following functions: + - "setLiquidationIncentive(address,uint256)" + - "setLiquidationIncentive(uint96,address,uint256)" +- And Guardian can execute the following functions: + - "setCollateralFactor(address,uint256,uint256)" + - "setCollateralFactor(uint96,address,uint256,uint256)" + - "setIsBorrowAllowed(uint96,address,bool)" + +**Revoked permissions** + +- “_setCollateralFactor(address,uint256)”, removed from every Timelock contract, because that function doesn’t exist anymore. Replaced by “setCollateralFactor(address,uint256,uint256)” and “setCollateralFactor(uint96,address,uint256,uint256)” +- “_setLiquidationIncentive(uint256)”, removed from the Normal Timelock, because that function doesn’t exist anymore. Replaced by "setLiquidationIncentive(address,uint256)" and "setLiquidationIncentive(uint96,address,uint256)" + +#### Security and additional considerations + +We applied the following security procedures for this upgrade: + +- **Audits:** [Certik](https://www.certik.com/), [Quantstamp](https://quantstamp.com/) and [HashDit](https://www.hashdit.io/) have audited the deployed code +- **VIP execution simulation**: in a simulation environment, validating that the new implementations (including the Comptroller facets), the updated permissions and the risk parameters are properly set on BNB Chain +- **Deployment on testnet**: the same upgrade has been performed on BNB Chain testnet, and used in the Venus Protocol testnet deployment + +#### Audit reports + +- [Certik audit audit report (2025/09/19)](https://github.com/VenusProtocol/venus-protocol/blob/73fa9f21c321f9e1821a7b187aeca46033ca5484/audits/149_emode_certik_20250919.pdf) +- [Quantstamp (2025/09/03)](https://github.com/VenusProtocol/venus-protocol/blob/73fa9f21c321f9e1821a7b187aeca46033ca5484/audits/150_emode_quantstamp_20250903.pdf) + +#### Deployed contracts + +BNB Chain + +- [Unitroller implementation (Diamond)](https://bscscan.com/address/0x6c151A4134006395D41319d713349660259DAB4e) +- Facets: + - [MarketFacet](https://bscscan.com/address/0x6e9bD95830bb775fb9F24b9559f8894d92143CA1) + - [PolicyFacet](https://bscscan.com/address/0x7155227C2763228F236a0D858dccDB32740a2893) + - [RewardFacet](https://bscscan.com/address/0x1d903eEa9d98a6Ac071a1f4531dc6958B4629cBE) + - [SetterFacet](https://bscscan.com/address/0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b) +- [VAIController](https://bscscan.com/address/0x5134C9D11c397efdF36F828eEf23B14F3F399da4) +- [VBep20 (VToken implementation)](https://bscscan.com/address/0xAF658DF443a937C88c955c737532E9a601ccEF8c) +- [Liquidator](https://bscscan.com/address/0xD65297007411694aA18c2941a5EB2b6ed4E0b819) +- [MarketConfigurationAggregator](https://bscscan.com/address/0x16bb2CEc0B286ceECca3aE195e378FDe264b43b4) (auxiliary contract only used in this VIP to set the risk parameters) +- [ComptrollerLens](https://bscscan.com/address/0xd701C1fDAE34f9Cf242a4de19a2e7288f924EA1C) +- [VenusLens](https://bscscan.com/address/0xf15A9c5aaDc327B383945D5821C7aC08Cdac7430) +- [SnapshotLens](http://bscscan.com/address/0xDE876091531c92BFED078af29CAaD3dbd4157f7a) + +BNB Chain testnet + +- [Unitroller implementation (Diamond)](http://testnet.bscscan.com/address/0xCe314cA8be79435FB0E4ffc102DAcA172B676a47) +- Facets: + - [MarketFacet](https://testnet.bscscan.com/address/0xD3D5f6c68677051e6855Fa38dca0cD6D56ED0c4f) + - [PolicyFacet](https://testnet.bscscan.com/address/0x4211061Bd8a648e62673681884C9D97B4A1aBB02) + - [RewardFacet](https://testnet.bscscan.com/address/0xDD150De13849fB0776B466114b95770714c8Cc9d) + - [SetterFacet](https://testnet.bscscan.com/address/0x3CCC9fC2fDA021ADb9C9FB0493C1a4a9357f4064) +- [VAIController](https://testnet.bscscan.com/address/0xA8122Fe0F9db39E266DE7A5BF953Cd72a87fe345) +- [VBep20 (VToken implementation)](https://testnet.bscscan.com/address/0x9c824EDa64aF04D160F9cB835C6AC95606077db0) +- [Liquidator](https://testnet.bscscan.com/address/0x91070E5b5Ff60a6c122740EB326D1f80E9f470e7) +- [MarketConfigurationAggregator](https://testnet.bscscan.com/address/0x7bbC692907f23E4b7170de0e1483323ea322BDbF) (auxiliary contract only used in this VIP to set the risk parameters) +- [ComptrollerLens](https://testnet.bscscan.com/address/0xACbc75C2D0438722c75D9BD20844b5aFda4155ea) +- [VenusLens](https://testnet.bscscan.com/address/0x01c4Ef2dD3327eee5F8dd29D825aDe730f225680) +- [SnapshotLens](https://testnet.bscscan.com/address/0xBe9174A13577B016280aEc20a3b369C5BA272241) + +#### References + +- [E-Mode feature](https://github.com/VenusProtocol/venus-protocol/pull/614) +- [VIP simulation](https://github.com/VenusProtocol/vips/pull/601) +- [Upgrade on BNB Chain testnet](https://testnet.bscscan.com/tx/0x7aba31bf8b75a857bccbb0b6941814588196555e3184db5726115de508ece5a1) +- [Technical article about E-Mode](https://docs-v4.venus.io/technical-reference/reference-technical-articles/emode)`, forDescription: "Execute this proposal", againstDescription: "Do not execute this proposal", abstainDescription: "Indifferent to execution", @@ -553,4 +662,4 @@ export const vip550 = () => { ); }; -export default vip550; +export default vip547; diff --git a/vips/vip-550/bsctestnet-addendum.ts b/vips/vip-547/bsctestnet-addendum.ts similarity index 96% rename from vips/vip-550/bsctestnet-addendum.ts rename to vips/vip-547/bsctestnet-addendum.ts index 9e9872e14..b74bd3e35 100644 --- a/vips/vip-550/bsctestnet-addendum.ts +++ b/vips/vip-547/bsctestnet-addendum.ts @@ -2,7 +2,7 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; -import { cutParams as params } from "../../simulations/vip-550/utils/bsctestnet-addendum-cut-params.json"; +import { cutParams as params } from "../../simulations/vip-547/utils/bsctestnet-addendum-cut-params.json"; const bsctestnet = NETWORK_ADDRESSES.bsctestnet; export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; @@ -20,7 +20,7 @@ export const POOL_SPECS = { allowCorePoolFallback: true, // set to true }; -export const vip550 = () => { +export const vip547 = () => { const meta = { version: "v2", title: "Emode in the BNB Core Pool", @@ -98,4 +98,4 @@ export const vip550 = () => { ); }; -export default vip550; +export default vip547; diff --git a/vips/vip-550/bsctestnet.ts b/vips/vip-547/bsctestnet.ts similarity index 99% rename from vips/vip-550/bsctestnet.ts rename to vips/vip-547/bsctestnet.ts index 72b5fa5a6..3be85f5b5 100644 --- a/vips/vip-550/bsctestnet.ts +++ b/vips/vip-547/bsctestnet.ts @@ -3,7 +3,7 @@ import { NETWORK_ADDRESSES } from "src/networkAddresses"; import { ProposalType } from "src/types"; import { makeProposal } from "src/utils"; -import { cutParams as params } from "../../simulations/vip-550/utils/bsctestnet-cut-params.json"; +import { cutParams as params } from "../../simulations/vip-547/utils/bsctestnet-cut-params.json"; export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; export const VAI_UNITROLLER = "0xf70C3C6b749BbAb89C081737334E74C9aFD4BE16"; @@ -278,7 +278,7 @@ export const MARKETS_BA = CORE_MARKETS.filter(market => !BORROW_PAUSED_MARKETS.i true, ]); -export const vip550 = () => { +export const vip547 = () => { const meta = { version: "v2", title: "Emode in the BNB Core Pool", @@ -446,4 +446,4 @@ export const vip550 = () => { ); }; -export default vip550; +export default vip547; From fe5c6b4a7e6574a73c7ba3c4764e3553f670c91a Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Tue, 23 Sep 2025 19:40:14 +0530 Subject: [PATCH 23/24] fix: update policyFacet address --- simulations/vip-547/bscmainnet.ts | 4 ++-- simulations/vip-547/utils/bscmainnet-cut-params.json | 2 +- vips/vip-547/bscmainnet.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simulations/vip-547/bscmainnet.ts b/simulations/vip-547/bscmainnet.ts index 3ba98a5f7..1f343eeee 100644 --- a/simulations/vip-547/bscmainnet.ts +++ b/simulations/vip-547/bscmainnet.ts @@ -68,11 +68,11 @@ const OLD_REWARD_FACET = "0x05e4C8f3dbb6c2eaD4eB1f28611FA7180e79f428"; const OLD_SETTER_FACET = "0x92B26cb819335DA336f59480F0ca30F9a3f18E0a"; const NEW_MARKET_FACET = "0x6e9bD95830bb775fb9F24b9559f8894d92143CA1"; -const NEW_POLICY_FACET = "0x7155227C2763228F236a0D858dccDB32740a2893"; +const NEW_POLICY_FACET = "0x529aE2E71E0836bE7378a8D47657E805829c6b3C"; const NEW_REWARD_FACET = "0x1d903eEa9d98a6Ac071a1f4531dc6958B4629cBE"; const NEW_SETTER_FACET = "0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b"; -forking(62056649, async () => { +forking(62181078, async () => { let unitroller: Contract; let comptroller: Contract; let accessControlManager: Contract; diff --git a/simulations/vip-547/utils/bscmainnet-cut-params.json b/simulations/vip-547/utils/bscmainnet-cut-params.json index aa3c5f675..d9cb7dde2 100644 --- a/simulations/vip-547/utils/bscmainnet-cut-params.json +++ b/simulations/vip-547/utils/bscmainnet-cut-params.json @@ -43,7 +43,7 @@ ] ], [ - "0x7155227C2763228F236a0D858dccDB32740a2893", + "0x529aE2E71E0836bE7378a8D47657E805829c6b3C", 1, [ "0x528a174c", diff --git a/vips/vip-547/bscmainnet.ts b/vips/vip-547/bscmainnet.ts index 0c48f525f..1b7caf668 100644 --- a/vips/vip-547/bscmainnet.ts +++ b/vips/vip-547/bscmainnet.ts @@ -430,7 +430,7 @@ BNB Chain - [Unitroller implementation (Diamond)](https://bscscan.com/address/0x6c151A4134006395D41319d713349660259DAB4e) - Facets: - [MarketFacet](https://bscscan.com/address/0x6e9bD95830bb775fb9F24b9559f8894d92143CA1) - - [PolicyFacet](https://bscscan.com/address/0x7155227C2763228F236a0D858dccDB32740a2893) + - [PolicyFacet](https://bscscan.com/address/0x529aE2E71E0836bE7378a8D47657E805829c6b3C) - [RewardFacet](https://bscscan.com/address/0x1d903eEa9d98a6Ac071a1f4531dc6958B4629cBE) - [SetterFacet](https://bscscan.com/address/0x4Fd17b7df6004E04A6298EdE065dE431D408fD9b) - [VAIController](https://bscscan.com/address/0x5134C9D11c397efdF36F828eEf23B14F3F399da4) From ae5bdd3d8397ff07922d524e4476b52679810ccf Mon Sep 17 00:00:00 2001 From: GitGuru7 Date: Wed, 24 Sep 2025 15:12:53 +0530 Subject: [PATCH 24/24] feat: add addendum-2 testnet vip for emode --- simulations/vip-547/bsctestnet-addendum-2.ts | 55 +++++++++++++++++++ .../bsctestnet-addendum-2-cut-params.json | 28 ++++++++++ vips/vip-547/bsctestnet-addendum-2.ts | 31 +++++++++++ 3 files changed, 114 insertions(+) create mode 100644 simulations/vip-547/bsctestnet-addendum-2.ts create mode 100644 simulations/vip-547/utils/bsctestnet-addendum-2-cut-params.json create mode 100644 vips/vip-547/bsctestnet-addendum-2.ts diff --git a/simulations/vip-547/bsctestnet-addendum-2.ts b/simulations/vip-547/bsctestnet-addendum-2.ts new file mode 100644 index 000000000..888ea619c --- /dev/null +++ b/simulations/vip-547/bsctestnet-addendum-2.ts @@ -0,0 +1,55 @@ +import { TransactionResponse } from "@ethersproject/providers"; +import { expect } from "chai"; +import { Contract } from "ethers"; +import { ethers } from "hardhat"; +import { expectEvents } from "src/utils"; +import { forking, testVip } from "src/vip-framework"; + +import { UNITROLLER, vip547 } from "../../vips/vip-547/bsctestnet-addendum-2"; +import DIAMOND_ABI from "./abi/Diamond.json"; +import COMPTROLLER_ABI from "./abi/comptroller-addendum-2.json"; +import { cutParams as params } from "./utils/bsctestnet-addendum-2-cut-params.json"; + +type CutParam = [string, number, string[]]; +const cutParams = params as unknown as CutParam[]; + +const OLD_POLICY_FACET = "0x11968dab15a9e59Cf9721b1F5c68418383CC1320"; +const NEW_POLICY_FACET = "0x8C9Ba060C2eF15755c5eE8DD06bB41Fd539C6FbD"; + +forking(66482446, async () => { + let unitroller: Contract; + + before(async () => { + unitroller = await ethers.getContractAt(DIAMOND_ABI, UNITROLLER); + }); + + describe("Pre-VIP state", async () => { + it("unitroller should have old Policy facet", async () => { + expect(await unitroller.facetAddresses()).to.include(OLD_POLICY_FACET); + }); + + it("new policy facet function selectors should be same as current", async () => { + const currentPolicyfacetSelectors = await unitroller.facetFunctionSelectors(OLD_POLICY_FACET); + expect(currentPolicyfacetSelectors).to.deep.equal(cutParams[0][2]); + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal([]); + }); + }); + + testVip("VIP-547", await vip547(), { + callbackAfterExecution: async (txResponse: TransactionResponse) => { + await expectEvents(txResponse, [COMPTROLLER_ABI], ["DiamondCut"], [1]); + }, + }); + + describe("Post-VIP state", async () => { + it("unitroller should contain the new Facet addresses", async () => { + expect(await unitroller.facetAddresses()).to.include(NEW_POLICY_FACET); + expect(await unitroller.facetAddresses()).to.not.include(OLD_POLICY_FACET); + }); + + it("policy facet function selectors should be replaced with new facet address", async () => { + expect(await unitroller.facetFunctionSelectors(NEW_POLICY_FACET)).to.deep.equal(cutParams[0][2]); + expect(await unitroller.facetFunctionSelectors(OLD_POLICY_FACET)).to.deep.equal([]); + }); + }); +}); diff --git a/simulations/vip-547/utils/bsctestnet-addendum-2-cut-params.json b/simulations/vip-547/utils/bsctestnet-addendum-2-cut-params.json new file mode 100644 index 000000000..3fe2080de --- /dev/null +++ b/simulations/vip-547/utils/bsctestnet-addendum-2-cut-params.json @@ -0,0 +1,28 @@ +{ + "cutParams": [ + [ + "0x8C9Ba060C2eF15755c5eE8DD06bB41Fd539C6FbD", + 1, + [ + "0xead1a8a0", + "0xda3d454c", + "0x5c778605", + "0x5ec88c79", + "0x528a174c", + "0x4e79238f", + "0x5fc7e71e", + "0x47ef3b3b", + "0x4ef4c3e1", + "0x41c728b9", + "0xeabe7d91", + "0x51dff989", + "0x24008a62", + "0x1ededc91", + "0xd02f7351", + "0x6d35bf91", + "0xbdcdc258", + "0x6a56947e" + ] + ] + ] +} diff --git a/vips/vip-547/bsctestnet-addendum-2.ts b/vips/vip-547/bsctestnet-addendum-2.ts new file mode 100644 index 000000000..b909825f9 --- /dev/null +++ b/vips/vip-547/bsctestnet-addendum-2.ts @@ -0,0 +1,31 @@ +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; + +import { cutParams as params } from "../../simulations/vip-547/utils/bsctestnet-addendum-2-cut-params.json"; + +export const UNITROLLER = "0x94d1820b2D1c7c7452A163983Dc888CEC546b77D"; + +export const vip547 = () => { + const meta = { + version: "v2", + title: "Emode in the BNB Core Pool", + description: "Emode in the BNB Core Pool", + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: UNITROLLER, + signature: "diamondCut((address,uint8,bytes4[])[])", + params: [params], + }, + ], + meta, + ProposalType.REGULAR, + ); +}; + +export default vip547;