diff --git a/.env.example b/.env.example index 9cb8f7778..465a1bb25 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ DEPLOYER_PRIVATE_KEY="" +ZKSYNC_ERA_LOCAL_TEST_NODE=http://localhost:8011 + ## Archive nodes ARCHIVE_NODE_bsctestnet=https://bsc-testnet.nodereal.io/v1/ ARCHIVE_NODE_bscmainnet=https://bsc-mainnet.nodereal.io/v1/ diff --git a/.gitignore b/.gitignore index cc419aa5c..9abab3eda 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ gnosisTXBuilder.json .DS_Store **/.DS_Store + +.cache diff --git a/hardhat.config.zksync.ts b/hardhat.config.zksync.ts index 63dfc7876..7a02859e6 100644 --- a/hardhat.config.zksync.ts +++ b/hardhat.config.zksync.ts @@ -39,14 +39,37 @@ task("test", "Update fork config") .addOptionalParam("fork", "Network to fork") .setAction(async function (taskArguments, hre, runSuper) { const { fork } = taskArguments; + + if (hre.network.name === "zkSyncTestNode") { + if (!process.env["ZKSYNC_ERA_LOCAL_TEST_NODE"]) { + throw new Error("ZKSYNC_ERA_LOCAL_TEST_NODE env variable is not set"); + } + + try { + const provider = new hre.ethers.providers.JsonRpcProvider(process.env["ZKSYNC_ERA_LOCAL_TEST_NODE"]); + await provider.send("eth_chainId", []); + console.log("Local zksync era test node is running"); + } catch (e) { + throw new Error( + `Local zksync era test node is not running. Please run it with "yarn run local-test-node:${fork} --fork-block-number \`\`"`, + ); + } + } + const hardhatConfig = fork ? { allowUnlimitedContractSize: false, loggingEnabled: false, - forking: { - enabled: true, - url: process.env[`ARCHIVE_NODE_${fork}`] as string, - }, + forking: + hre.network.name === "zkSyncTestNode" + ? { + enabled: false, + url: process.env["ZKSYNC_ERA_LOCAL_TEST_NODE"] as string, + } + : { + enabled: true, + url: process.env[`ARCHIVE_NODE_${fork}`] as string, + }, gas: "auto" as const, blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK[fork as keyof typeof BLOCK_GAS_LIMIT_PER_NETWORK], } @@ -55,6 +78,7 @@ task("test", "Update fork config") loggingEnabled: false, }; hre.config.networks.hardhat = { ...hre.config.networks.hardhat, ...hardhatConfig }; + hre.FORKED_NETWORK = fork; await runSuper(taskArguments); @@ -113,6 +137,14 @@ const config: HardhatUserConfig = { blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.zksyncmainnet, zksync: true, }, + zkSyncTestNode: { + url: process.env.ZKSYNC_ERA_LOCAL_TEST_NODE || "http://localhost:8011", + chainId: 260, + accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], + blockGasLimit: BLOCK_GAS_LIMIT_PER_NETWORK.zksyncsepolia, + timeout: 2000000000, + zksync: true, + }, }, paths: { tests: "./tests", diff --git a/multisig/proposals/zksyncmainnet/vip-004/index.ts b/multisig/proposals/zksyncmainnet/vip-004/index.ts new file mode 100644 index 000000000..ab01f63a8 --- /dev/null +++ b/multisig/proposals/zksyncmainnet/vip-004/index.ts @@ -0,0 +1,346 @@ +import { parseUnits } from "ethers/lib/utils"; +import { NETWORK_ADDRESSES, ZERO_ADDRESS } from "src/networkAddresses"; +import { makeProposal } from "src/utils"; + +const { zksyncmainnet } = NETWORK_ADDRESSES; + +export const ACM = "0x526159A92A82afE5327d37Ef446b68FD9a5cA914"; +export const COMPTROLLER_CORE = "0xddE4D098D9995B659724ae6d5E3FB9681Ac941B1"; + +export const WBTC = "0xBBeB516fb02a01611cBBE0453Fe3c580D7281011"; +export const WETH = "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91"; +export const USDT = "0x493257fD37EDB34451f62EDf8D2a0C418852bA4C"; +export const USDC_e = "0x3355df6D4c9C3035724Fd0e3914dE96A5a83aaf4"; +export const ZK = "0x5A7d6b2F92C77FAD6CCaBd7EE0624E64907Eaf3E"; + +export const VWBTC_CORE = "0xAF8fD83cFCbe963211FAaf1847F0F217F80B4719"; +export const VWETH_CORE = "0x1Fa916C27c7C2c4602124A14C77Dbb40a5FF1BE8"; +export const VUSDC_e_CORE = "0x1aF23bD57c62A99C59aD48236553D0Dd11e49D2D"; +export const VUSDT_CORE = "0x69cDA960E3b20DFD480866fFfd377Ebe40bd0A46"; +export const VZK_CORE = "0x697a70779C1A03Ba2BD28b7627a902BFf831b616"; + +// IL configuration +const vip004 = () => { + return makeProposal([ + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setCollateralFactor(address,uint256,uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMarketSupplyCaps(address[],uint256[])", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMarketBorrowCaps(address[],uint256[])", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setLiquidationIncentive(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setCloseFactor(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMinLiquidatableCollateral(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setActionsPaused(address[],uint256[],bool)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "addPool(string,address,uint256,uint256,uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setPoolName(address,string)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "updatePoolMetadata(address,VenusPoolMetaData)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setProtocolSeizeShare(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setReserveFactor(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setInterestRateModel(address)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "updateJumpRateModel(uint256,uint256,uint256,uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setRewardTokenSpeeds(address[],uint256[],uint256[])", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setLastRewardingBlockTimestamps(address[],uint256[],uint256[])", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setCollateralFactor(address,uint256,uint256)", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [zksyncmainnet.POOL_REGISTRY, "addMarket(AddMarketInput)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setReduceReservesBlockDelta(uint256)", zksyncmainnet.GUARDIAN], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMarketSupplyCaps(address[],uint256[])", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMarketBorrowCaps(address[],uint256[])", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setLiquidationIncentive(uint256)", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setCloseFactor(uint256)", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "setMinLiquidatableCollateral(uint256)", zksyncmainnet.POOL_REGISTRY], + }, + { + target: ACM, + signature: "giveCallPermission(address,string,address)", + params: [ZERO_ADDRESS, "supportMarket(address)", zksyncmainnet.POOL_REGISTRY], + }, + { target: zksyncmainnet.POOL_REGISTRY, signature: "acceptOwnership()", params: [] }, + { target: COMPTROLLER_CORE, signature: "acceptOwnership()", params: [] }, + { + target: COMPTROLLER_CORE, + signature: "setPriceOracle(address)", + params: [zksyncmainnet.RESILIENT_ORACLE], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addPool(string,address,uint256,uint256,uint256)", + params: ["Core", COMPTROLLER_CORE, parseUnits("0.5", 18), parseUnits("1.1", 18), parseUnits("100", 18)], + gasLimitMultiplicationFactor: 10, + }, + { + target: zksyncmainnet.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [WBTC, parseUnits("0.075", 8), zksyncmainnet.GUARDIAN], + }, + { + target: WBTC, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, 0], + }, + { + target: WBTC, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, parseUnits("0.075", 8)], + }, + { + target: VWBTC_CORE, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["86400"], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VWBTC_CORE, + parseUnits("0.77", 18), // CF + parseUnits("0.80", 18), // LT + parseUnits("0.075", 8), // initial supply + zksyncmainnet.VTREASURY, + parseUnits("40", 8), // supply cap + parseUnits("20", 8), // borrow cap + ], + ], + gasLimitMultiplicationFactor: 10, + }, + { + target: zksyncmainnet.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [WETH, parseUnits("1.5", 18), zksyncmainnet.GUARDIAN], + }, + { + target: WETH, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, 0], + }, + { + target: WETH, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, parseUnits("1.5", 18)], + }, + { + target: VWETH_CORE, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["86400"], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VWETH_CORE, + parseUnits("0.77", 18), // CF + parseUnits("0.80", 18), // LT + parseUnits("1.5", 18), // initial supply + zksyncmainnet.VTREASURY, + parseUnits("2000", 18), // supply cap + parseUnits("1700", 18), // borrow cap + ], + ], + gasLimitMultiplicationFactor: 10, + }, + { + target: zksyncmainnet.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [USDC_e, parseUnits("5000", 6), zksyncmainnet.GUARDIAN], + }, + { + target: USDC_e, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, 0], + }, + { + target: USDC_e, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, parseUnits("5000", 6)], + }, + { + target: VUSDC_e_CORE, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["86400"], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VUSDC_e_CORE, + parseUnits("0.72", 18), // CF + parseUnits("0.75", 18), // LT + parseUnits("5000", 6), // initial supply + zksyncmainnet.VTREASURY, + parseUnits("5000000", 6), // supply cap + parseUnits("4200000", 6), // borrow cap + ], + ], + gasLimitMultiplicationFactor: 10, + }, + { + target: zksyncmainnet.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [USDT, parseUnits("5000", 6), zksyncmainnet.GUARDIAN], + }, + { + target: USDT, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, 0], + }, + { + target: USDT, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, parseUnits("5000", 6)], + }, + { + target: VUSDT_CORE, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["86400"], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VUSDT_CORE, + parseUnits("0.77", 18), // CF + parseUnits("0.80", 18), // LT + parseUnits("5000", 6), // initial supply + zksyncmainnet.VTREASURY, + parseUnits("4000000", 6), // supply cap + parseUnits("3300000", 6), // borrow cap + ], + ], + gasLimitMultiplicationFactor: 10, + }, + { + target: zksyncmainnet.VTREASURY, + signature: "withdrawTreasuryToken(address,uint256,address)", + params: [ZK, parseUnits("25000", 18), zksyncmainnet.GUARDIAN], + }, + { + target: ZK, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, 0], + }, + { + target: ZK, + signature: "approve(address,uint256)", + params: [zksyncmainnet.POOL_REGISTRY, parseUnits("25000", 18)], + }, + { + target: VZK_CORE, + signature: "setReduceReservesBlockDelta(uint256)", + params: ["86400"], + }, + { + target: zksyncmainnet.POOL_REGISTRY, + signature: "addMarket((address,uint256,uint256,uint256,address,uint256,uint256))", + params: [ + [ + VZK_CORE, + parseUnits("0.35", 18), // CF + parseUnits("0.40", 18), // LT + parseUnits("25000", 18), // initial suply + zksyncmainnet.VTREASURY, + parseUnits("25000000", 18), // supply cap + parseUnits("12500000", 18), // borrow cap + ], + ], + gasLimitMultiplicationFactor: 10, + }, + ]); +}; + +export default vip004; diff --git a/multisig/simulations/zksyncmainnet/vip-004/abi/comptroller.json b/multisig/simulations/zksyncmainnet/vip-004/abi/comptroller.json new file mode 100644 index 000000000..fafe7b35e --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/abi/comptroller.json @@ -0,0 +1,1496 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "poolRegistry_", + "type": "address" + }, + { + "internalType": "address", + "name": "accessControl_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "ActionPaused", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "BorrowCapExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedLessThanOrEqualTo", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "CollateralExceedsThreshold", + "type": "error" + }, + { + "inputs": [], + "name": "ComptrollerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "collateralToSeize", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableCollateral", + "type": "uint256" + } + ], + "name": "InsufficientCollateral", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientShortfall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCollateralFactor", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLiquidationThreshold", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketAlreadyListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "MarketNotListed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expectedGreaterThan", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actual", + "type": "uint256" + } + ], + "name": "MinimalCollateralViolated", + "type": "error" + }, + { + "inputs": [], + "name": "NonzeroBorrowBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "PriceError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "SnapshotError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + } + ], + "name": "SupplyCapExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "TooMuchRepay", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedSender", + "type": "address" + }, + { + "internalType": "address", + "name": "actualSender", + "type": "address" + } + ], + "name": "UnexpectedSender", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bool", + "name": "pauseState", + "type": "bool" + } + ], + "name": "ActionPausedMarket", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketEntered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "MarketExited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "MarketSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "NewBorrowCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCloseFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCloseFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + } + ], + "name": "NewCollateralFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationIncentiveMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationIncentive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldLiquidationThresholdMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "NewLiquidationThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinLiquidatableCollateral", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "NewMinLiquidatableCollateral", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract PriceOracle", + "name": "newPriceOracle", + "type": "address" + } + ], + "name": "NewPriceOracle", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "rewardsDistributor", + "type": "address" + } + ], + "name": "NewRewardsDistributor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "NewSupplyCap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControl", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "accountAssets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "enum ComptrollerStorage.Action", + "name": "action", + "type": "uint8" + } + ], + "name": "actionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract RewardsDistributor", + "name": "_rewardsDistributor", + "type": "address" + } + ], + "name": "addRewardsDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allMarkets", + "outputs": [ + { + "internalType": "contract VToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "borrowCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "checkMembership", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "closeFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "vTokens", + "type": "address[]" + } + ], + "name": "enterMarkets", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "exitMarket", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllMarkets", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAssetsIn", + "outputs": [ + { + "internalType": "contract VToken[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenModify", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "getHypotheticalAccountLiquidity", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shortfall", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardDistributors", + "outputs": [ + { + "internalType": "contract RewardsDistributor[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + } + ], + "name": "getRewardsByMarket", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "rewardToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "supplySpeed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowSpeed", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.RewardSpeeds[]", + "name": "rewardSpeeds", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "healAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isComptroller", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isDeprecated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "isMarketListed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract VToken", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "contract VToken", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "internalType": "struct ComptrollerStorage.LiquidationOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "liquidateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "uint256", + "name": "actualRepayAmount", + "type": "uint256" + } + ], + "name": "liquidateCalculateSeizeTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensToSeize", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "liquidationIncentiveMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "markets", + "outputs": [ + { + "internalType": "bool", + "name": "isListed", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "collateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThresholdMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minLiquidatableCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract PriceOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "preBorrowHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenBorrowed", + "type": "address" + }, + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "skipLiquidityCheck", + "type": "bool" + } + ], + "name": "preLiquidateHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "preMintHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "preRedeemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preRepayHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "address", + "name": "seizerContract", + "type": "address" + }, + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "preSeizeHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "vToken", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "transferTokens", + "type": "uint256" + } + ], + "name": "preTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "marketsList", + "type": "address[]" + }, + { + "internalType": "enum ComptrollerStorage.Action[]", + "name": "actionsList", + "type": "uint8[]" + }, + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setActionsPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newCloseFactorMantissa", + "type": "uint256" + } + ], + "name": "setCloseFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newCollateralFactorMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "newLiquidationThresholdMantissa", + "type": "uint256" + } + ], + "name": "setCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newLiquidationIncentiveMantissa", + "type": "uint256" + } + ], + "name": "setLiquidationIncentive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newBorrowCaps", + "type": "uint256[]" + } + ], + "name": "setMarketBorrowCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken[]", + "name": "vTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "newSupplyCaps", + "type": "uint256[]" + } + ], + "name": "setMarketSupplyCaps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMinLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "setMinLiquidatableCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract PriceOracle", + "name": "newOracle", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "supplyCaps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + } + ], + "name": "supportMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-004/abi/erc20.json b/multisig/simulations/zksyncmainnet/vip-004/abi/erc20.json new file mode 100644 index 000000000..374b04c75 --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/abi/erc20.json @@ -0,0 +1,295 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "name_", "type": "string" }, + { "internalType": "string", "name": "symbol_", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "userAddress", "type": "address" }, + { "indexed": false, "internalType": "address payable", "name": "relayerAddress", "type": "address" }, + { "indexed": false, "internalType": "bytes", "name": "functionSignature", "type": "bytes" } + ], + "name": "MetaTransactionExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, + { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ERC712_VERSION", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PREDICATE_ROLE", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "userAddress", "type": "address" }, + { "internalType": "bytes", "name": "functionSignature", "type": "bytes" }, + { "internalType": "bytes32", "name": "sigR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "sigS", "type": "bytes32" }, + { "internalType": "uint8", "name": "sigV", "type": "uint8" } + ], + "name": "executeMetaTransaction", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeperator", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], + "name": "getNonce", + "outputs": [{ "internalType": "uint256", "name": "nonce", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleAdmin", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "getRoleMember", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], + "name": "getRoleMemberCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "hasRole", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "role", "type": "bytes32" }, + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-004/abi/poolRegistry.json b/multisig/simulations/zksyncmainnet/vip-004/abi/poolRegistry.json new file mode 100644 index 000000000..b637988ae --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/abi/poolRegistry.json @@ -0,0 +1,680 @@ +[ + { + "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" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "vTokenAddress", + "type": "address" + } + ], + "name": "MarketAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "oldMetadata", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "newMetadata", + "type": "tuple" + } + ], + "name": "PoolMetadataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "oldName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newName", + "type": "string" + } + ], + "name": "PoolNameSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "pool", + "type": "tuple" + } + ], + "name": "PoolRegistered", + "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": [ + { + "components": [ + { + "internalType": "contract VToken", + "name": "vToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "collateralFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "vTokenReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "supplyCap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowCap", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistry.AddMarketInput", + "name": "input", + "type": "tuple" + } + ], + "name": "addMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "contract Comptroller", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closeFactor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationIncentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLiquidatableCollateral", + "type": "uint256" + } + ], + "name": "addPool", + "outputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllPools", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPool[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getPoolByComptroller", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creator", + "type": "address" + }, + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "blockPosted", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timestampPosted", + "type": "uint256" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getPoolsSupportedByAsset", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getVTokenForAsset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + } + ], + "name": "getVenusPoolMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "metadata", + "outputs": [ + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + } + ], + "name": "setPoolName", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "components": [ + { + "internalType": "string", + "name": "category", + "type": "string" + }, + { + "internalType": "string", + "name": "logoURL", + "type": "string" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct PoolRegistryInterface.VenusPoolMetaData", + "name": "metadata_", + "type": "tuple" + } + ], + "name": "updatePoolMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-004/abi/rateModel.json b/multisig/simulations/zksyncmainnet/vip-004/abi/rateModel.json new file mode 100644 index 000000000..8c04a8527 --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/abi/rateModel.json @@ -0,0 +1,118 @@ +[ + { + "inputs": [ + { "internalType": "uint256", "name": "baseRatePerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "multiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "jumpMultiplierPerYear", "type": "uint256" }, + { "internalType": "uint256", "name": "kink_", "type": "uint256" } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "baseRatePerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "multiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "jumpMultiplierPerBlock", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "kink", "type": "uint256" } + ], + "name": "NewInterestParams", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "baseRatePerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "blocksPerYear", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "getBorrowRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" }, + { "internalType": "uint256", "name": "reserveFactorMantissa", "type": "uint256" } + ], + "name": "getSupplyRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isInterestRateModel", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "jumpMultiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kink", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "multiplierPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { "internalType": "uint256", "name": "cash", "type": "uint256" }, + { "internalType": "uint256", "name": "borrows", "type": "uint256" }, + { "internalType": "uint256", "name": "reserves", "type": "uint256" } + ], + "name": "utilizationRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "payable": false, + "stateMutability": "pure", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-004/abi/vToken.json b/multisig/simulations/zksyncmainnet/vip-004/abi/vToken.json new file mode 100644 index 000000000..1ce01e4a8 --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/abi/vToken.json @@ -0,0 +1,2066 @@ +[ + { + "inputs": [ + { + "internalType": "bool", + "name": "timeBased_", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "blocksPerYear_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBorrowRateMantissa_", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "actualAddAmount", + "type": "uint256" + } + ], + "name": "AddReservesFactorFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowCashNotAvailable", + "type": "error" + }, + { + "inputs": [], + "name": "BorrowFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "DelegateNotApproved", + "type": "error" + }, + { + "inputs": [], + "name": "ForceLiquidateBorrowUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HealBorrowUnauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidBlocksPerYear", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTimeBasedConfiguration", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "errorCode", + "type": "uint256" + } + ], + "name": "LiquidateAccrueCollateralInterestFailed", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCloseAmountIsUintMax", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCloseAmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateCollateralFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateLiquidatorIsBorrower", + "type": "error" + }, + { + "inputs": [], + "name": "LiquidateSeizeLiquidatorIsBorrower", + "type": "error" + }, + { + "inputs": [], + "name": "MintFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "ProtocolSeizeShareTooBig", + "type": "error" + }, + { + "inputs": [], + "name": "RedeemFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "RedeemTransferOutNotPossible", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesCashNotAvailable", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesCashValidation", + "type": "error" + }, + { + "inputs": [], + "name": "ReduceReservesFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "RepayBorrowFreshnessCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetInterestRateModelFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetReserveFactorBoundsCheck", + "type": "error" + }, + { + "inputs": [], + "name": "SetReserveFactorFreshCheck", + "type": "error" + }, + { + "inputs": [], + "name": "TransferNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "cashPrior", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "interestAccumulated", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "AccrueInterest", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtOld", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtNew", + "type": "uint256" + } + ], + "name": "BadDebtIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtOld", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "badDebtNew", + "type": "uint256" + } + ], + "name": "BadDebtRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "HealBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "vTokenCollateral", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "LiquidateBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "mintTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBalance", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ComptrollerInterface", + "name": "oldComptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ComptrollerInterface", + "name": "newComptroller", + "type": "address" + } + ], + "name": "NewComptroller", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "oldInterestRateModel", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "NewMarketInterestRateModel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldProtocolSeizeShareMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newProtocolSeizeShareMantissa", + "type": "uint256" + } + ], + "name": "NewProtocolSeizeShare", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldProtocolShareReserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newProtocolShareReserve", + "type": "address" + } + ], + "name": "NewProtocolShareReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldReduceReservesBlockOrTimestampDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReduceReservesBlockOrTimestampDelta", + "type": "uint256" + } + ], + "name": "NewReduceReservesBlockDelta", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactorMantissa", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactorMantissa", + "type": "uint256" + } + ], + "name": "NewReserveFactor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldShortfall", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newShortfall", + "type": "address" + } + ], + "name": "NewShortfallContract", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ProtocolSeize", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBalance", + "type": "uint256" + } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "accountBorrows", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalBorrows", + "type": "uint256" + } + ], + "name": "RepayBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "benefactor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "ReservesAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "protocolShareReserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalReserves", + "type": "uint256" + } + ], + "name": "SpreadReservesReduced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "NO_ERROR", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrualBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accrueInterest", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "addAmount", + "type": "uint256" + } + ], + "name": "addReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "badDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "recoveredAmount_", + "type": "uint256" + } + ], + "name": "badDebtRecovered", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOfUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "blocksOrSecondsPerYear", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "borrowBalanceStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "borrowAmount", + "type": "uint256" + } + ], + "name": "borrowBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "borrowIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "borrowRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "comptroller", + "outputs": [ + { + "internalType": "contract ComptrollerInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "contract VTokenInterface", + "name": "vTokenCollateral", + "type": "address" + }, + { + "internalType": "bool", + "name": "skipLiquidityCheck", + "type": "bool" + } + ], + "name": "forceLiquidateBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getAccountSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "error", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "vTokenBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "borrowBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exchangeRate", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumberOrTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCash", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "healBorrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract ComptrollerInterface", + "name": "comptroller_", + "type": "address" + }, + { + "internalType": "contract InterestRateModel", + "name": "interestRateModel_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "initialExchangeRateMantissa_", + "type": "uint256" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "components": [ + { + "internalType": "address", + "name": "shortfall", + "type": "address" + }, + { + "internalType": "address payable", + "name": "protocolShareReserve", + "type": "address" + } + ], + "internalType": "struct VTokenInterface.RiskManagementInit", + "name": "riskManagement", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "reserveFactorMantissa_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "interestRateModel", + "outputs": [ + { + "internalType": "contract InterestRateModel", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isTimeBased", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isVToken", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + }, + { + "internalType": "contract VTokenInterface", + "name": "vTokenCollateral", + "type": "address" + } + ], + "name": "liquidateBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintAmount", + "type": "uint256" + } + ], + "name": "mintBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolSeizeShareMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolShareReserve", + "outputs": [ + { + "internalType": "address payable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemTokens", + "type": "uint256" + } + ], + "name": "redeemBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + } + ], + "name": "redeemUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "redeemer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "redeemAmount", + "type": "uint256" + } + ], + "name": "redeemUnderlyingBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "reduceAmount", + "type": "uint256" + } + ], + "name": "reduceReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockDelta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reduceReservesBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrow", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "repayAmount", + "type": "uint256" + } + ], + "name": "repayBorrowBehalf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reserveFactorMantissa", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "uint256", + "name": "seizeTokens", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract InterestRateModel", + "name": "newInterestRateModel", + "type": "address" + } + ], + "name": "setInterestRateModel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newProtocolSeizeShareMantissa_", + "type": "uint256" + } + ], + "name": "setProtocolSeizeShare", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "protocolShareReserve_", + "type": "address" + } + ], + "name": "setProtocolShareReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newReduceReservesBlockOrTimestampDelta", + "type": "uint256" + } + ], + "name": "setReduceReservesBlockDelta", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newReserveFactorMantissa", + "type": "uint256" + } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "shortfall_", + "type": "address" + } + ], + "name": "setShortfallContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "shortfall", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "supplyRatePerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrows", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalBorrowsCurrent", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/multisig/simulations/zksyncmainnet/vip-004/index.ts b/multisig/simulations/zksyncmainnet/vip-004/index.ts new file mode 100644 index 000000000..8261ad8c4 --- /dev/null +++ b/multisig/simulations/zksyncmainnet/vip-004/index.ts @@ -0,0 +1,411 @@ +import { expect } from "chai"; +import { BigNumberish } from "ethers"; +import { BigNumber, Contract } from "ethers"; +import { parseUnits } from "ethers/lib/utils"; +import { ethers } from "hardhat"; +import { NETWORK_ADDRESSES } from "src/networkAddresses"; +import { forking, pretendExecutingVip } from "src/vip-framework"; +import { checkVToken } from "src/vip-framework/checks/checkVToken"; +import { checkInterestRate } from "src/vip-framework/checks/interestRateModel"; + +import vip004, { + COMPTROLLER_CORE, + USDC_e, + USDT, + VUSDC_e_CORE, + VUSDT_CORE, + VWBTC_CORE, + VWETH_CORE, + VZK_CORE, + WBTC, + WETH, + ZK, +} from "../../../proposals/zksyncmainnet/vip-004"; +import COMPTROLLER_ABI from "./abi/comptroller.json"; +import ERC20_ABI from "./abi/erc20.json"; +import POOL_REGISTRY_ABI from "./abi/poolRegistry.json"; +import VTOKEN_ABI from "./abi/vToken.json"; + +const { zksyncmainnet } = NETWORK_ADDRESSES; + +const RESILIENT_ORACLE = zksyncmainnet.RESILIENT_ORACLE; +const GUARDIAN = zksyncmainnet.GUARDIAN; +const POOL_REGISTRY = zksyncmainnet.POOL_REGISTRY; +const PSR = "0xA1193e941BDf34E858f7F276221B4886EfdD040b"; + +const BLOCKS_PER_YEAR = BigNumber.from("31536000"); // equal to seconds in a year as it is timebased deployment + +type VTokenSymbol = "vWBTC_Core" | "vWETH_Core" | "vUSDT_Core" | "vUSDC_e_Core" | "vZK_Core"; + +const vTokens: { [key in VTokenSymbol]: string } = { + vWBTC_Core: VWBTC_CORE, + vWETH_Core: VWETH_CORE, + vUSDT_Core: VUSDT_CORE, + vUSDC_e_Core: VUSDC_e_CORE, + vZK_Core: VZK_CORE, +}; + +const tokens = { + WBTC: WBTC, + WETH: WETH, + USDT: USDT, + USDC: USDC_e, + ZK: ZK, +}; + +interface VTokenState { + name: string; + symbol: string; + decimals: number; + underlying: string; + exchangeRate: BigNumberish; + comptroller: string; +} + +const vTokenState: { [key in VTokenSymbol]: VTokenState } = { + // Core Pool + vWBTC_Core: { + name: "Venus WBTC (Core)", + symbol: "vWBTC_Core", + decimals: 8, + underlying: tokens.WBTC, + exchangeRate: parseUnits("1", 18), + comptroller: COMPTROLLER_CORE, + }, + vWETH_Core: { + name: "Venus WETH (Core)", + symbol: "vWETH_Core", + decimals: 8, + underlying: tokens.WETH, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_CORE, + }, + vUSDT_Core: { + name: "Venus USDT (Core)", + symbol: "vUSDT_Core", + decimals: 8, + underlying: tokens.USDT, + exchangeRate: parseUnits("1", 16), + comptroller: COMPTROLLER_CORE, + }, + vUSDC_e_Core: { + name: "Venus USDC.e (Core)", + symbol: "vUSDC.e_Core", + decimals: 8, + underlying: tokens.USDC, + exchangeRate: parseUnits("1", 16), + comptroller: COMPTROLLER_CORE, + }, + vZK_Core: { + name: "Venus ZK (Core)", + symbol: "vZK_Core", + decimals: 8, + underlying: tokens.ZK, + exchangeRate: parseUnits("1", 28), + comptroller: COMPTROLLER_CORE, + }, +}; + +interface RiskParameters { + borrowCap: string; + supplyCap: string; + collateralFactor: string; + liquidationThreshold: string; + reserveFactor: string; + initialSupply: string; + vTokenReceiver: string; +} + +const riskParameters: { [key in VTokenSymbol]: RiskParameters } = { + // Core Pool + vWBTC_Core: { + borrowCap: "20", + supplyCap: "40", + collateralFactor: "0.77", + liquidationThreshold: "0.8", + reserveFactor: "0.2", + initialSupply: "0.075", + vTokenReceiver: zksyncmainnet.VTREASURY, + }, + vWETH_Core: { + borrowCap: "1700", + supplyCap: "2000", + collateralFactor: "0.77", + liquidationThreshold: "0.80", + reserveFactor: "0.2", + initialSupply: "1.5", + vTokenReceiver: zksyncmainnet.VTREASURY, + }, + vUSDC_e_Core: { + borrowCap: "4200000", + supplyCap: "5000000", + collateralFactor: "0.72", + liquidationThreshold: "0.75", + reserveFactor: "0.1", + initialSupply: "5000", + vTokenReceiver: zksyncmainnet.VTREASURY, + }, + vUSDT_Core: { + borrowCap: "3300000", + supplyCap: "4000000", + collateralFactor: "0.77", + liquidationThreshold: "0.8", + reserveFactor: "0.1", + initialSupply: "5000", + vTokenReceiver: zksyncmainnet.VTREASURY, + }, + vZK_Core: { + borrowCap: "12500000", + supplyCap: "25000000", + collateralFactor: "0.35", + liquidationThreshold: "0.4", + reserveFactor: "0.25", + initialSupply: "25000", + vTokenReceiver: zksyncmainnet.VTREASURY, + }, +}; + +interface InterestRateModelSpec { + vTokens: VTokenSymbol[]; + kink: string; + base: string; + multiplier: string; + jump: string; +} + +const interestRateModels: InterestRateModelSpec[] = [ + { + vTokens: ["vWETH_Core"], + kink: "0.8", + base: "0", + multiplier: "0.0425", + jump: "0.8", + }, + { + vTokens: ["vWBTC_Core"], + kink: "0.45", + base: "0", + multiplier: "0.09", + jump: "2", + }, + { + vTokens: ["vUSDC_e_Core", "vUSDT_Core"], + kink: "0.8", + base: "0", + multiplier: "0.0875", + jump: "0.8", + }, + + { + vTokens: ["vZK_Core"], + kink: "0.45", + base: "0.02", + multiplier: "0.2", + jump: "3", + }, +]; + +const interestRateModelAddresses: { [key in VTokenSymbol]: string } = { + vWBTC_Core: "", + vWETH_Core: "", + vUSDT_Core: "", + vUSDC_e_Core: "", + vZK_Core: "", +}; + +forking(43555118, async () => { + let poolRegistry: Contract; + + before(async () => { + poolRegistry = await ethers.getContractAt(POOL_REGISTRY_ABI, POOL_REGISTRY); + }); + + describe("Contracts setup", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + checkVToken(address, vTokenState[symbol]); + } + }); + + describe("Post-Execution state", () => { + before(async () => { + await pretendExecutingVip(await vip004()); + + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + interestRateModelAddresses[symbol] = await vToken.interestRateModel(); + } + } + }); + + describe("PoolRegistry state", () => { + let registeredPools: { name: string; creator: string; comptroller: string }[]; + + before(async () => { + registeredPools = await poolRegistry.getAllPools(); + }); + + it("should have 1 pool(Core Pool)", async () => { + expect(registeredPools).to.have.lengthOf(1); + }); + + it("should register Core pool in PoolRegistry", async () => { + const pool = registeredPools[0]; + expect(pool.name).to.equal("Core"); + expect(pool.creator).to.equal(GUARDIAN); + expect(pool.comptroller).to.equal(COMPTROLLER_CORE); + }); + + it("should register Core pool vTokens in Core pool Comptroller", async () => { + const comptroller = await ethers.getContractAt(COMPTROLLER_ABI, COMPTROLLER_CORE); + const poolVTokens = await comptroller.getAllMarkets(); + expect(poolVTokens).to.have.lengthOf(5); + expect(poolVTokens).to.include(vTokens.vWBTC_Core); + expect(poolVTokens).to.include(vTokens.vWETH_Core); + expect(poolVTokens).to.include(vTokens.vUSDT_Core); + expect(poolVTokens).to.include(vTokens.vUSDC_e_Core); + expect(poolVTokens).to.include(vTokens.vZK_Core); + }); + + for (const [symbol, { underlying }] of Object.entries(vTokenState) as [VTokenSymbol, VTokenState][]) { + it(`should register ${symbol} in PoolRegistry`, async () => { + const registeredVToken = await poolRegistry.getVTokenForAsset(vTokenState[symbol].comptroller, underlying); + expect(registeredVToken).to.equal(vTokens[symbol]); + }); + } + }); + + describe("Ownership", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should transfer ownership of ${symbol} to GUARDIAN`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.owner()).to.equal(GUARDIAN); + }); + } + }); + + describe("ProtocolShareReserve", () => { + for (const [symbol, address] of Object.entries(vTokens) as [VTokenSymbol, string][]) { + it(`should set PSR for ${symbol}`, async () => { + const vToken = await ethers.getContractAt(VTOKEN_ABI, address); + expect(await vToken.protocolShareReserve()).to.equal(PSR); + }); + } + }); + + describe("Initial supply", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + it(`should mint initial supply of ${symbol} to ${params.vTokenReceiver}`, async () => { + // Since we're distributing 1:1, decimals should be accounted for in the exchange rate + const expectedSupply = parseUnits(params.initialSupply, 8); + const vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + expect(await vToken.balanceOf(params.vTokenReceiver)).to.equal(expectedSupply); + }); + } + }); + + describe("Risk parameters", () => { + for (const [symbol, params] of Object.entries(riskParameters) as [VTokenSymbol, RiskParameters][]) { + describe(`${symbol} risk parameters`, () => { + let vToken: Contract; + let comptroller: Contract; + let underlyingDecimals: number; + + before(async () => { + vToken = await ethers.getContractAt(VTOKEN_ABI, vTokens[symbol]); + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, vTokenState[symbol].comptroller); + const underlyingAddress = vTokenState[symbol].underlying; + const underlying = await ethers.getContractAt(ERC20_ABI, underlyingAddress); + underlyingDecimals = await underlying.decimals(); + }); + + it(`should set ${symbol} reserve factor to ${params.reserveFactor}`, async () => { + expect(await vToken.reserveFactorMantissa()).to.equal(parseUnits(params.reserveFactor, 18)); + }); + + it(`should set ${symbol} collateral factor to ${params.collateralFactor}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.collateralFactorMantissa).to.equal(parseUnits(params.collateralFactor, 18)); + }); + + it(`should set ${symbol} liquidation threshold to ${params.liquidationThreshold}`, async () => { + const market = await comptroller.markets(vTokens[symbol]); + expect(market.liquidationThresholdMantissa).to.equal(parseUnits(params.liquidationThreshold, 18)); + }); + + it(`should set ${symbol} protocol seize share to 0.05`, async () => { + expect(await vToken.protocolSeizeShareMantissa()).to.equal(parseUnits("0.05", 18)); + }); + + it(`should set ${symbol} supply cap to ${params.supplyCap}`, async () => { + expect(await comptroller.supplyCaps(vTokens[symbol])).to.equal( + parseUnits(params.supplyCap, underlyingDecimals), + ); + }); + + it(`should set ${symbol} borrow cap to ${params.borrowCap}`, async () => { + expect(await comptroller.borrowCaps(vTokens[symbol])).to.equal( + parseUnits(params.borrowCap, underlyingDecimals), + ); + }); + }); + } + }); + + describe("Pools configuration", () => { + const checkComptroller = (comptrollerAddress: string, comptrollerName: string) => { + describe(`${comptrollerName} Comptroller`, () => { + let comptroller: Contract; + + before(async () => { + comptroller = await ethers.getContractAt(COMPTROLLER_ABI, comptrollerAddress); + }); + + it("should use the correct comptroller address", async () => { + expect(comptroller.address).to.equal(comptrollerAddress); + }); + + it("should have the correct price oracle", async () => { + expect(await comptroller.oracle()).to.equal(RESILIENT_ORACLE); + }); + + it("should have close factor = 0.5", async () => { + expect(await comptroller.closeFactorMantissa()).to.equal(parseUnits("0.5", 18)); + }); + + it("should have liquidation incentive = 1.1", async () => { + expect(await comptroller.liquidationIncentiveMantissa()).to.equal(parseUnits("1.1", 18)); + }); + + it("should have minLiquidatableCollateral = $100", async () => { + expect(await comptroller.minLiquidatableCollateral()).to.equal(parseUnits("100", 18)); + }); + + it("should have owner = GUARDIAN", async () => { + expect(await comptroller.owner()).to.equal(GUARDIAN); + }); + }); + }; + + checkComptroller(COMPTROLLER_CORE, "Core"); + }); + + it("Interest rates", async () => { + for (const model of interestRateModels) { + for (const symbol of model.vTokens) { + checkInterestRate( + interestRateModelAddresses[symbol], + symbol, + { + base: model.base, + multiplier: model.multiplier, + jump: model.jump, + kink: model.kink, + }, + BLOCKS_PER_YEAR, + ); + } + } + }); + }); +}); diff --git a/package.json b/package.json index 0ba3e0b04..ac47f1e33 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,9 @@ "prettier": "prettier --write \"**/*.{js,json,md,ts,yaml,yml,sol}\"", "prettier:check": "prettier --check \"**/*.{js,json,md,ts,yaml,yml,sol}\"", "docgen": "hardhat docgen", - "clean": "hardhat clean && hardhat clean --config hardhat.config.zksync.ts" + "clean": "hardhat clean && hardhat clean --config hardhat.config.zksync.ts", + "local-test-node:zksyncmainnet": "hardhat node-zksync --fork https://mainnet.era.zksync.io --config hardhat.config.zksync.ts", + "local-test-node:zksyncsepolia": "hardhat node-zksync --fork https://sepolia.era.zksync.dev --config hardhat.config.zksync.ts" }, "dependencies": { "@morpho-labs/gnosis-tx-builder": "^1.3.1", diff --git a/simulations/vip-365/bscmainnet.ts b/simulations/vip-365/bscmainnet.ts new file mode 100644 index 000000000..8aad7cf1b --- /dev/null +++ b/simulations/vip-365/bscmainnet.ts @@ -0,0 +1,7 @@ +import { forking, testVip } from "src/vip-framework"; + +import vip365 from "../../vips/vip-365/bscmainnet"; + +forking(42104700, async () => { + testVip("VIP-365", await vip365(), {}); +}); diff --git a/src/networkAddresses.ts b/src/networkAddresses.ts index 1b1ec0a65..bf374beba 100644 --- a/src/networkAddresses.ts +++ b/src/networkAddresses.ts @@ -179,13 +179,14 @@ export const NETWORK_ADDRESSES = { }, zksyncmainnet: { NORMAL_TIMELOCK: "", // To be deployed - VTREASURY: "0xB2e9174e23382f7744CebF7e0Be54cA001D95599", GUARDIAN: "0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa", + VTREASURY: "0xB2e9174e23382f7744CebF7e0Be54cA001D95599", XVS: "0xD78ABD81a3D57712a3af080dc4185b698Fe9ac5A", RESILIENT_ORACLE: "0xDe564a4C887d5ad315a19a96DC81991c98b12182", CHAINLINK_ORACLE: "0x4FC29E1d3fFFbDfbf822F09d20A5BE97e59F66E5", XVS_VAULT_PROXY: "0xbbB3C88192a5B0DB759229BeF49DcD1f168F326F", GENERIC_TEST_USER_ACCOUNT: "0x6f057A858171e187124ddEDF034dAc63De5dE5dB", + POOL_REGISTRY: "0xFD96B926298034aed9bBe0Cca4b651E41eB87Bc4", }, opsepolia: { NORMAL_TIMELOCK: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", // opsepolia Multisig diff --git a/src/types.ts b/src/types.ts index 2d5ce03c7..bcc60a571 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,6 +40,10 @@ export interface Proposal { values: BigNumberish[]; signatures: string[]; params: any[][]; + // 1 means no change, 2 means double the gas fee. Will always be whole numbers. + gasFeeMultiplicationFactor?: number[]; + // 1 means no change, 2 means double the gas fee. Will always be whole numbers. + gasLimitMultiplicationFactor?: number[]; meta?: ProposalMeta; type?: ProposalType; } @@ -50,6 +54,10 @@ export interface Command { params: any[]; value?: string; dstChainId?: LzChainId; + // only matters for simulations. For some network forks, the gas fee estimation is not accurate. Should be a whole number. + gasFeeMultiplicationFactor?: number; + // only matters for simulations. For some network forks, the gas limit estimation is not accurate. Should be a whole number. + gasLimitMultiplicationFactor?: number; } export interface TokenConfig { diff --git a/src/utils.ts b/src/utils.ts index 3ff8ff522..14cb60edc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,10 +1,12 @@ import { JsonFragment, defaultAbiCoder } from "@ethersproject/abi"; -import { TransactionResponse } from "@ethersproject/providers"; +import { JsonRpcProvider, TransactionResponse } from "@ethersproject/providers"; import { mine } from "@nomicfoundation/hardhat-network-helpers"; import { NumberLike } from "@nomicfoundation/hardhat-network-helpers/dist/src/types"; +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import { BigNumber, Contract, utils } from "ethers"; import { FORKED_NETWORK, config, ethers, network } from "hardhat"; +import { EthereumProvider } from "hardhat/types"; import { NETWORK_ADDRESSES } from "./networkAddresses"; import { @@ -46,6 +48,11 @@ export const getPayload = (proposal: Proposal) => { const gasUsedPerCommand = 300000; export async function setForkBlock(_blockNumber: number) { + if (network.name === "zkSyncTestNode") { + console.log("zkSyncTestNode network does not support forking, skipping fork"); + return; + } + const blockNumber = config.networks.hardhat.zksync ? _blockNumber.toString(16) : _blockNumber; await network.provider.request({ method: "hardhat_reset", @@ -86,11 +93,21 @@ export function getCalldatas({ signatures, params }: { signatures: string[]; par }); } export const initMainnetUser = async (user: string, balance: NumberLike) => { - await network.provider.send("hardhat_impersonateAccount", [user]); + let provider: EthereumProvider | JsonRpcProvider = network.provider; + let signer = await ethers.getSigner(user); + + // zksync test node provider does not support default impersonation + if (network.name === "zkSyncTestNode") { + provider = new ethers.providers.JsonRpcProvider(config.networks.hardhat.forking?.url); + + signer = provider.getSigner(user) as unknown as SignerWithAddress; + } + + await provider.send("hardhat_impersonateAccount", [user]); const balanceHex = toRpcQuantity(balance); - await network.provider.send("hardhat_setBalance", [user, balanceHex]); + await provider.send("hardhat_setBalance", [user, balanceHex]); - return ethers.getSigner(user); + return signer; }; const toRpcQuantity = (x: NumberLike): string => { @@ -163,7 +180,17 @@ export const makeProposal = async ( meta?: ProposalMeta, type?: ProposalType, ): Promise => { - const proposal: Proposal = { signatures: [], targets: [], params: [], values: [], meta, type }; + const proposal: Proposal = { + signatures: [], + targets: [], + params: [], + values: [], + gasFeeMultiplicationFactor: [], + gasLimitMultiplicationFactor: [], + meta, + type, + }; + const map = new Map(); const _commands = []; for (const command of commands) { @@ -181,6 +208,10 @@ export const makeProposal = async ( proposal.values.push(..._commands.map(cmd => cmd.value ?? "0")); proposal.signatures.push(..._commands.map(cmd => cmd.signature)); proposal.params.push(..._commands.map(cmd => cmd.params)); + proposal.gasFeeMultiplicationFactor?.push( + ..._commands.map(cmd => (cmd.gasFeeMultiplicationFactor ?? network.zksync ? 2 : 1)), + ); + proposal.gasLimitMultiplicationFactor?.push(..._commands.map(cmd => cmd.gasLimitMultiplicationFactor ?? 1)); } for (const key of map.keys()) { const chainCommands = map.get(key); diff --git a/src/vip-framework/index.ts b/src/vip-framework/index.ts index 54ca389f2..ff4bc7343 100644 --- a/src/vip-framework/index.ts +++ b/src/vip-framework/index.ts @@ -4,7 +4,7 @@ import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { expect } from "chai"; import cliProgress from "cli-progress"; import { Contract, ContractInterface } from "ethers"; -import { FORKED_NETWORK, ethers, network } from "hardhat"; +import { FORKED_NETWORK, ethers } from "hardhat"; import { NETWORK_ADDRESSES } from "../networkAddresses"; import { NETWORK_CONFIG } from "../networkConfig"; @@ -72,16 +72,22 @@ const executeCommand = async (timelock: SignerWithAddress, proposal: Proposal, c return iface.encodeFunctionData(signature, params); }; - const feeData = await ethers.provider.getFeeData(); const txnParams: TransactionRequest = { to: proposal.targets[commandIdx], value: proposal.values[commandIdx], data: encodeMethodCall(proposal.signatures[commandIdx], proposal.params[commandIdx]), }; - if (network.zksync && feeData.maxFeePerGas) { - // Sometimes the gas estimation is wrong with zksync - txnParams.maxFeePerGas = feeData.maxFeePerGas.mul(15).div(10); + if (proposal.gasFeeMultiplicationFactor && proposal.gasFeeMultiplicationFactor[commandIdx]) { + const feeData = await ethers.provider.getFeeData(); + if (feeData.maxFeePerGas) { + txnParams.maxFeePerGas = feeData.maxFeePerGas.mul(proposal.gasFeeMultiplicationFactor[commandIdx]); + } + } + + if (proposal.gasLimitMultiplicationFactor && proposal.gasLimitMultiplicationFactor[commandIdx]) { + const gas = await timelock.estimateGas(txnParams); + txnParams.gasLimit = gas.mul(proposal.gasLimitMultiplicationFactor[commandIdx]); } await timelock.sendTransaction(txnParams); diff --git a/vips/vip-365/bscmainnet.ts b/vips/vip-365/bscmainnet.ts new file mode 100644 index 000000000..73fe0f588 --- /dev/null +++ b/vips/vip-365/bscmainnet.ts @@ -0,0 +1,174 @@ +import { ProposalType } from "src/types"; +import { makeProposal } from "src/utils"; +import { FAST_TRACK_TIMELOCK } from "src/vip-framework"; + +const vip365 = () => { + const meta = { + version: "v2", + title: "VIP-365 [zkSync] Configuration of markets and Prime, and enable XVS Vault", + description: `#### Summary + +If passed, this VIP will perform the following actions: + +- Configure the XVS Vault on zkSync Era, including the changes described in the [VIP-360](https://app.venus.io/#/governance/proposal/360) +- Configure the Venus markets on zkSync Era, for [WBTC](https://explorer.zksync.io/address/0xbbeb516fb02a01611cbbe0453fe3c580d7281011), [WETH](https://era.zksync.network/token/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91), [USDC.e](https://explorer.zksync.io/address/0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4), [USDT](https://explorer.zksync.io/address/0x493257fd37edb34451f62edf8d2a0c418852ba4c) and [ZK](https://explorer.zksync.io/address/0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e) +- Configure the [ProtocolShareReserve](https://explorer.zksync.io/address/0xA1193e941BDf34E858f7F276221B4886EfdD040b) contract on zkSync Era +- Configure the [NativeTokenGateway](https://explorer.zksync.io/address/0xeEDE4e1BDaC489BD851970bE3952B729C4238A68) contact for the Venus market of WETH, accepting deposits and withdrawals of ETH +- Configure the [Prime](https://explorer.zksync.io/address/0xdFe62Dcba3Ce0A827439390d7d45Af8baE599978) contract on zkSync Era, allowing users to stake XVS into the XVSVault to start their qualification period + +#### Description + +Following the [Chaos labs recommendations](https://community.venus.io/t/deploy-venus-protocol-on-zksync-era/4472/12), if passed, this VIP will enable the following Venus markets on zkSync Era: + +Underlying token: [WBTC](https://explorer.zksync.io/address/0xbbeb516fb02a01611cbbe0453fe3c580d7281011) + +- Borrow cap: 20 +- Supply cap: 40 +- Collateral factor: 0.77 +- Liquidation threshold: 0.8 +- Reserve factor: 0.25 +- Bootstrap liquidity: 0.075 WBTC - provided by the Venus Treasury + +Underlying token: [WETH](https://era.zksync.network/token/0x5aea5775959fbc2557cc8789bc1bf90a239d9a91) + +- Borrow cap: 1,700 +- Supply cap: 2,000 +- Collateral factor: 0.77 +- Liquidation threshold: 0.8 +- Reserve factor: 0.25 +- Bootstrap liquidity: 1.5 WETH - provided by the Venus Treasury + +Underlying token: [USDC.e](https://explorer.zksync.io/address/0x3355df6d4c9c3035724fd0e3914de96a5a83aaf4) + +- Borrow cap: 4,200,000 +- Supply cap: 5,000,000 +- Collateral factor: 0.72 +- Liquidation threshold: 0.75 +- Reserve factor: 0.1 +- Bootstrap liquidity: 5,000 USDC.e - provided by the Venus Treasury + +Underlying token: [USDT](https://explorer.zksync.io/address/0x493257fd37edb34451f62edf8d2a0c418852ba4c) + +- Borrow cap: 3,300,000 +- Supply cap: 4,000,000 +- Collateral factor: 0.77 +- Liquidation threshold: 0.8 +- Reserve factor: 0.1 +- Bootstrap liquidity: 5,000 USDT - provided by the Venus Treasury + +Underlying token: [ZK](https://explorer.zksync.io/address/0x5a7d6b2f92c77fad6ccabd7ee0624e64907eaf3e) + +- Borrow cap: 12,500,000 +- Supply cap: 25,000,000 +- Collateral factor: 0.35 +- Liquidation threshold: 0.4 +- Reserve factor: 0.25 +- Bootstrap liquidity: 25,000 ZK - provided by the Venus Treasury + +Initial interest rate curves for the new markets: + +- Underlying token: WBTC + - kink: 0.45 + - base (yearly): 0 + - multiplier (yearly): 0.09 + - jump multiplier (yearly): 2 +- Underlying token: WETH + - kink: 0.8 + - base (yearly): 0 + - multiplier (yearly): 0.0425 + - jump multiplier (yearly): 0.8 +- Underlying token: USDC.e, USDT + - kink: 0.8 + - base (yearly): 0 + - multiplier (yearly): 0.0875 + - jump multiplier (yearly): 0.8 +- Underlying token: ZK + - kink: 0.45 + - base (yearly): 0.02 + - multiplier (yearly): 0.2 + - jump multiplier (yearly): 3 + +Initial risk parameters for the new pool: + +- Close factor: 50% +- Liquidation incentive: 10% + +Oracles: + +- WBTC: [Chainlink](https://explorer.zksync.io/address/0x4Cba285c15e3B540C474A114a7b135193e4f1EA6) (main) +- WETH: [Chainlink](https://explorer.zksync.io/address/0x6D41d1dc818112880b40e26BD6FD347E41008eDA) (main) +- USDC.e: [Chainlink](https://explorer.zksync.io/address/0x1824D297C6d6D311A204495277B63e943C2D376E) (main) +- USDT: [Chainlink](https://explorer.zksync.io/address/0xB615075979AE1836B476F651f1eB79f0Cd3956a9) (main) +- ZK: [RedStone](https://explorer.zksync.io/address/0x5efDb74da192584746c96EcCe138681Ec1501218) (main) and [Chainlink](https://explorer.zksync.io/address/0xD1ce60dc8AE060DDD17cA8716C96f193bC88DD13) (pivot and fallback) + +#### Security and additional considerations + +We applied the following security procedures for this upgrade: + +- **VIP execution simulation:** in a simulation environment, checking ownership of the contracts and validating the usual operations on the markets +- **Deployment on testnet:** the same contracts have been deployed to testnet, and used in the Venus Protocol testnet deployment +- **Audit:** Certik, Quantstamp and Fairyproof have audited the deployed code + +#### Audit reports + +- [Certik audit audit report](https://github.com/VenusProtocol/isolated-pools/blob/aa1f7ae61b07839231ec16e9c4143905785d7aae/audits/088_timeBased_certik_20240117.pdf) (2024/01/17) +- [Quantstamp audit audit report](https://github.com/VenusProtocol/isolated-pools/blob/470416836922656783eab52ded54744489e8c345/audits/089_timeBased_quantstamp_20240319.pdf) (2024/03/19) +- [Fairyproof audit report](https://github.com/VenusProtocol/isolated-pools/blob/aa1f7ae61b07839231ec16e9c4143905785d7aae/audits/094_timeBased_fairyproof_20240304.pdf) (2024/03/04) + +#### Deployed contracts on zkSync Era + +- Pool registry: [0xFD96B926298034aed9bBe0Cca4b651E41eB87Bc4](https://explorer.zksync.io/address/0xFD96B926298034aed9bBe0Cca4b651E41eB87Bc4) +- Comptroller: [0xddE4D098D9995B659724ae6d5E3FB9681Ac941B1](https://explorer.zksync.io/address/0xddE4D098D9995B659724ae6d5E3FB9681Ac941B1) +- Markets: + - vWBTC_Core: [0xAF8fD83cFCbe963211FAaf1847F0F217F80B4719](https://explorer.zksync.io/address/0xAF8fD83cFCbe963211FAaf1847F0F217F80B4719) + - vWETH_Core: [0x1Fa916C27c7C2c4602124A14C77Dbb40a5FF1BE8](https://explorer.zksync.io/address/0x1Fa916C27c7C2c4602124A14C77Dbb40a5FF1BE8) + - vUSDC.e_Core: [0x1aF23bD57c62A99C59aD48236553D0Dd11e49D2D](https://explorer.zksync.io/address/0x1aF23bD57c62A99C59aD48236553D0Dd11e49D2D) + - vUSDT_Core: [0x69cDA960E3b20DFD480866fFfd377Ebe40bd0A46](https://explorer.zksync.io/address/0x69cDA960E3b20DFD480866fFfd377Ebe40bd0A46) + - vZK_Core: [0x697a70779C1A03Ba2BD28b7627a902BFf831b616](https://explorer.zksync.io/address/0x697a70779C1A03Ba2BD28b7627a902BFf831b616) +- [ProtocolShareReserve](https://explorer.zksync.io/address/0xA1193e941BDf34E858f7F276221B4886EfdD040b) +- [NativeTokenGateway](https://explorer.zksync.io/address/0xeEDE4e1BDaC489BD851970bE3952B729C4238A68) +- [Prime](https://explorer.zksync.io/address/0xdFe62Dcba3Ce0A827439390d7d45Af8baE599978) +- [PrimeLiquidityProvider](https://explorer.zksync.io/address/0x0EDE6d7fB474614C5D3d5a16581628bb96CB5dff) + +**References** + +- [VIP simulation - adding Venus markets](https://github.com/VenusProtocol/vips/pull/377) +- [VIP simulation - ProtocolShareReserve](https://github.com/VenusProtocol/vips/pull/367) +- [VIP simulation - NativeTokenGateway](https://github.com/VenusProtocol/vips/pull/368) +- [VIP simulation - Prime](https://github.com/VenusProtocol/vips/pull/378) +- [[VRC] Deploy Venus Protocol on zkSync Era](https://community.venus.io/t/deploy-venus-protocol-on-zksync-era/4472) +- Snapshot ["Deploy Venus Protocol on zkSync Era"](https://snapshot.org/#/venus-xvs.eth/proposal/0x56aec6471ddf25eddc0a39e00ab1bbb98477fe67576cd84c7993f7d37729a717) +- [Documentation](https://docs-v4.venus.io/) + +**Disclaimer for zkSync Era VIPs** + +Privilege commands on zkSync Era will be executed by the [Guardian wallet](https://explorer.zksync.io/address/0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa), until the [Multichain Governance](https://docs-v4.venus.io/technical-reference/reference-technical-articles/multichain-governance) contracts are fully enabled. + +If this VIP passes, the following multisig transactions will be executed. Otherwise, they will be rejected. + +* [XVS vault configuration](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0xb854ce0258d98aca0af31c1f63d82d4ecc9a59790f08d839a0e4041dce34f820) +* [Markets configuration](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x18965d1db2a609964f8b6832d96371d4cbf77daab3ecb54de3818108d71ce89e) +* [NativeTokenGateway configuration](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x2b050a3b262bc6c5084796f93769b82cac8a34c62911cf006c85826b5469a99f) +* [ProtocolShareReserve configuration](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x44e1f772b420ee5eeae26623d110c47c1151ba350375377d571498cbe0fb61e4) +* [Prime configuration](https://app.safe.global/transactions/tx?safe=zksync:0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa&id=multisig_0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa_0x57e29b8a10d51202c9d5ac7cd928e83b4ab93222af755117fa849e7b3872f06f) +`, + forDescription: "Execute this proposal", + againstDescription: "Do not execute this proposal", + abstainDescription: "Indifferent to execution", + }; + + return makeProposal( + [ + { + target: FAST_TRACK_TIMELOCK, + signature: "", + params: [], + value: "1", + }, + ], + meta, + ProposalType.FAST_TRACK, + ); +}; + +export default vip365;