@venusprotocol/venus-protocol 9.8.0-dev.2 → 9.8.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,7 +104,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
104
104
  parseUnits("0.125", 18),
105
105
  parseUnits("0.4", 18),
106
106
  parseUnits("0.9", 18),
107
- parseUnits("0.21", 18),
107
+ parseUnits("0.05", 18),
108
108
  parseUnits("0.8", 18),
109
109
  parseUnits("5", 18),
110
110
  ],
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "0x4E026f23f65EA7ad206886F91f74B79adBA2bc62",
2
+ "address": "0xb16Db373A194acb9018919B77ae480f2a8f0F128",
3
3
  "abi": [
4
4
  {
5
5
  "inputs": [
@@ -288,19 +288,19 @@
288
288
  "type": "function"
289
289
  }
290
290
  ],
291
- "transactionHash": "0x43b2fae66685ca832a7f7f3df91456a1ccc6a37d11b68f23b56169bfe123c9c2",
291
+ "transactionHash": "0xf0bc9bbbb86ed37ffde73ac24c718417684164eed3de380df1cc0c010652d6f1",
292
292
  "receipt": {
293
293
  "to": null,
294
- "from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1",
295
- "contractAddress": "0x4E026f23f65EA7ad206886F91f74B79adBA2bc62",
296
- "transactionIndex": 141,
297
- "gasUsed": "485524",
294
+ "from": "0xa05f990d647287e4E84715b813BC000aEA970467",
295
+ "contractAddress": "0xb16Db373A194acb9018919B77ae480f2a8f0F128",
296
+ "transactionIndex": 53,
297
+ "gasUsed": "485512",
298
298
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
299
- "blockHash": "0x7a2c22bc774da139319b82356c8c539b1a5d63dda80daa2705271b3e9a8c1ddb",
300
- "transactionHash": "0x43b2fae66685ca832a7f7f3df91456a1ccc6a37d11b68f23b56169bfe123c9c2",
299
+ "blockHash": "0x2cb609ba39d5a2da7dac5d9a1fb7a22daa48543209654b67e9d3cc5548acc211",
300
+ "transactionHash": "0xf0bc9bbbb86ed37ffde73ac24c718417684164eed3de380df1cc0c010652d6f1",
301
301
  "logs": [],
302
- "blockNumber": 44745645,
303
- "cumulativeGasUsed": "15426519",
302
+ "blockNumber": 48277851,
303
+ "cumulativeGasUsed": "6991326",
304
304
  "status": 1,
305
305
  "byzantium": true
306
306
  },
@@ -309,12 +309,12 @@
309
309
  "125000000000000000",
310
310
  "400000000000000000",
311
311
  "900000000000000000",
312
- "210000000000000000",
312
+ "50000000000000000",
313
313
  "800000000000000000",
314
314
  "5000000000000000000"
315
315
  ],
316
- "numDeployments": 5,
317
- "solcInputHash": "7584667b44eb77970ba8d274006d81ae",
316
+ "numDeployments": 6,
317
+ "solcInputHash": "0853484adf400255247dccdbf868a509",
318
318
  "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"baseRatePerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink1_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplier2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"baseRate2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink2_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"jumpMultiplierPerYear_\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidKink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NegativeValueNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE_RATE_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_RATE_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_YEAR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"JUMP_MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInterestRateModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"baseRate2PerYear_\":\"The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\",\"baseRatePerYear_\":\"The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\",\"jumpMultiplierPerYear_\":\"The multiplier after hitting KINK_2\",\"kink1_\":\"The utilization point at which the multiplier2 is applied\",\"kink2_\":\"The utilization point at which the jump multiplier is applied\",\"multiplier2PerYear_\":\"The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\",\"multiplierPerYear_\":\"The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\"}},\"getBorrowRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserveFactorMantissa\":\"The current reserve factor for the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"utilizationRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The utilization rate as a mantissa between [0, EXP_SCALE]\"}}},\"title\":\"TwoKinksInterestRateModel\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidKink()\":[{\"notice\":\"Thrown when the kink points are not in the correct order\"}],\"NegativeValueNotAllowed()\":[{\"notice\":\"Thrown when a negative value is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"BASE_RATE_2_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\"},\"BASE_RATE_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\"},\"JUMP_MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\"},\"KINK_1()\":{\"notice\":\"The utilization point at which the multiplier2 is applied\"},\"KINK_2()\":{\"notice\":\"The utilization point at which the jump multiplier is applied\"},\"MULTIPLIER_2_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\"},\"MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\"},\"RATE_1()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"RATE_2()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"constructor\":{\"notice\":\"Construct an interest rate model\"},\"getBorrowRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per slot (block)\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per slot (block)\"},\"isInterestRateModel()\":{\"notice\":\"Indicator that this is an InterestRateModel contract (for inspection)\"},\"utilizationRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\"}},\"notice\":\"An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":\"TwoKinksInterestRateModel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/InterestRateModels/InterestRateModelV8.sol\":{\"content\":\"pragma solidity 0.8.25;\\n\\n/**\\n * @title Venus's InterestRateModelV8 Interface\\n * @author Venus\\n */\\nabstract contract InterestRateModelV8 {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view virtual returns (uint256);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) external view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9b71896f66909fb3fe829c413594121f0e165d8508e8a6fa29a6938ddcfbb61f\"},\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { InterestRateModelV8 } from \\\"./InterestRateModelV8.sol\\\";\\n\\n/**\\n * @title TwoKinksInterestRateModel\\n * @author Venus\\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\\n */\\ncontract TwoKinksInterestRateModel is InterestRateModelV8 {\\n int256 public constant BLOCKS_PER_YEAR = (60 * 60 * 24 * 365) / 3; // (assuming 3s blocks)\\n\\n ////////////////////// SLOPE 1 //////////////////////\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_PER_BLOCK;\\n\\n ////////////////////// SLOPE 2 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the multiplier2 is applied\\n */\\n int256 public immutable KINK_1;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_2_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_2_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_1;\\n\\n ////////////////////// SLOPE 3 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n int256 public immutable KINK_2;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_2;\\n\\n /// @notice Base unit for computations, usually used in scaling (multiplications, divisions)\\n uint256 internal constant EXP_SCALE = 1e18;\\n\\n /**\\n * @notice Thrown when a negative value is not allowed\\n */\\n error NegativeValueNotAllowed();\\n\\n /**\\n * @notice Thrown when the kink points are not in the correct order\\n */\\n error InvalidKink();\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\\n * @param kink1_ The utilization point at which the multiplier2 is applied\\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\\n * @param baseRate2PerYear_ The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\\n * @param kink2_ The utilization point at which the jump multiplier is applied\\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\\n */\\n constructor(\\n int256 baseRatePerYear_,\\n int256 multiplierPerYear_,\\n int256 kink1_,\\n int256 multiplier2PerYear_,\\n int256 baseRate2PerYear_,\\n int256 kink2_,\\n int256 jumpMultiplierPerYear_\\n ) {\\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\\n revert NegativeValueNotAllowed();\\n }\\n\\n if (kink2_ <= kink1_ || kink1_ <= 0) {\\n revert InvalidKink();\\n }\\n\\n BASE_RATE_PER_BLOCK = baseRatePerYear_ / BLOCKS_PER_YEAR;\\n MULTIPLIER_PER_BLOCK = multiplierPerYear_ / BLOCKS_PER_YEAR;\\n KINK_1 = kink1_;\\n MULTIPLIER_2_PER_BLOCK = multiplier2PerYear_ / BLOCKS_PER_YEAR;\\n BASE_RATE_2_PER_BLOCK = baseRate2PerYear_ / BLOCKS_PER_YEAR;\\n KINK_2 = kink2_;\\n JUMP_MULTIPLIER_PER_BLOCK = jumpMultiplierPerYear_ / BLOCKS_PER_YEAR;\\n\\n int256 expScale = int256(EXP_SCALE);\\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n\\n int256 slope2Util;\\n unchecked {\\n slope2Util = KINK_2 - KINK_1;\\n }\\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view override returns (uint256) {\\n return _getBorrowRate(cash, borrows, reserves);\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param reserveFactorMantissa The current reserve factor for the market\\n * @return The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) public view virtual override returns (uint256) {\\n uint256 oneMinusReserveFactor = EXP_SCALE - reserveFactorMantissa;\\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves);\\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\\n return (utilizationRate(cash, borrows, reserves) * rateToPool) / EXP_SCALE;\\n }\\n\\n /**\\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The utilization rate as a mantissa between [0, EXP_SCALE]\\n */\\n function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) {\\n // Utilization rate is 0 when there are no borrows\\n if (borrows == 0) {\\n return 0;\\n }\\n\\n uint256 rate = (borrows * EXP_SCALE) / (cash + borrows - reserves);\\n\\n if (rate > EXP_SCALE) {\\n rate = EXP_SCALE;\\n }\\n\\n return rate;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block), with the error code expected by the market\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function _getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) internal view returns (uint256) {\\n int256 util = int256(utilizationRate(cash, borrows, reserves));\\n int256 expScale = int256(EXP_SCALE);\\n\\n if (util < KINK_1) {\\n return _minCap(((util * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n } else if (util < KINK_2) {\\n int256 slope2Util;\\n unchecked {\\n slope2Util = util - KINK_1;\\n }\\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n\\n return _minCap(RATE_1 + rate2);\\n } else {\\n int256 slope3Util;\\n unchecked {\\n slope3Util = util - KINK_2;\\n }\\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK) / expScale);\\n\\n return _minCap(RATE_1 + RATE_2 + rate3);\\n }\\n }\\n\\n /**\\n * @notice Returns 0 if number is less than 0, otherwise returns the input\\n * @param number The first number\\n * @return The maximum of 0 and input number\\n */\\n function _minCap(int256 number) internal pure returns (uint256) {\\n int256 zero;\\n return uint256(number > zero ? number : zero);\\n }\\n}\\n\",\"keccak256\":\"0x5e1c42a7adfb2b10fddac364289e7af8285d0f387f4961c5bd76624ae11ef2d3\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
319
319
  "bytecode": "0x6101a060405234801561001157600080fd5b50604051610adb380380610adb83398101604081905261003091610166565b600087128061003f5750600083125b1561005d576040516341820e7560e11b815260040160405180910390fd5b848213158061006d575060008513155b1561008b57604051637099641d60e11b815260040160405180910390fd5b61009862a06680886101d0565b60a0526100a862a06680876101d0565b60805260c08590526100bd62a06680856101d0565b60e0526100cd62a06680846101d0565b610100526101408290526100e462a06680826101d0565b6101605260a05160805160c051670de0b6b3a764000092918391610108919061020c565b61011291906101d0565b61011c9190610242565b6101205260c051610140516101005160e0519290910391839061013f908461020c565b61014991906101d0565b6101539190610242565b610180525061026a975050505050505050565b600080600080600080600060e0888a03121561018157600080fd5b5050855160208701516040880151606089015160808a015160a08b015160c0909b0151949c939b50919990985090965094509092509050565b634e487b7160e01b600052601160045260246000fd5b6000826101ed57634e487b7160e01b600052601260045260246000fd5b600160ff1b821460001984141615610207576102076101ba565b500590565b80820260008212600160ff1b84141615610228576102286101ba565b818105831482151761023c5761023c6101ba565b92915050565b8082018281126000831280158216821582161715610262576102626101ba565b505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516107ae61032d600039600081816101a601526105b5015260008181610299015261057b0152600081816101580152818161046b015261055201526000818160f30152818161052101526105d601526000818161020701526104b801526000818161027201526104dd01526000818161017f015281816103d2015261049301526000818161024101526103fd0152600081816101e0015261042201526107ae6000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c80638ea0930e1161008c578063c563364911610066578063c56336491461023c578063d37db1d214610263578063ebf22a081461026d578063fe8167d81461029457600080fd5b80638ea0930e146101db578063b571268114610202578063b81688161461022957600080fd5b806338afe9c4116100c857806338afe9c4146101535780633b53e8881461017a5780635d0054c4146101a15780636e71e2d8146101c857600080fd5b8062084e89146100ee57806315f24053146101285780632191f92a1461013b575b600080fd5b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b610115610136366004610611565b6102bb565b610143600181565b604051901515815260200161011f565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101156101d6366004610611565b6102d2565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011561023736600461063d565b61033b565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011562a0668081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b60006102c88484846103b7565b90505b9392505050565b6000826000036102e4575060006102cb565b6000826102f18587610685565b6102fb919061069e565b61030d670de0b6b3a7640000866106b1565b61031791906106de565b9050670de0b6b3a76400008111156102c85750670de0b6b3a7640000949350505050565b60008061035083670de0b6b3a764000061069e565b9050600061035f8787876103b7565b90506000670de0b6b3a764000061037684846106b1565b61038091906106de565b9050670de0b6b3a7640000816103978a8a8a6102d2565b6103a191906106b1565b6103ab91906106de565b98975050505050505050565b6000806103c58585856102d2565b9050670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000821215610469576104607f0000000000000000000000000000000000000000000000000000000000000000826104477f0000000000000000000000000000000000000000000000000000000000000000866106f2565b6104519190610722565b61045b9190610750565b6105fa565b925050506102cb565b7f0000000000000000000000000000000000000000000000000000000000000000821215610550577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105027f0000000000000000000000000000000000000000000000000000000000000000856106f2565b61050c9190610722565b6105169190610750565b905061054561045b827f0000000000000000000000000000000000000000000000000000000000000000610750565b9450505050506102cb565b7f000000000000000000000000000000000000000000000000000000000000000082036000826105a07f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105aa9190610722565b9050610545816104517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610750565b60008080831361060a57806102cb565b5090919050565b60008060006060848603121561062657600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561065357600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106985761069861066f565b92915050565b818103818111156106985761069861066f565b80820281158282048414176106985761069861066f565b634e487b7160e01b600052601260045260246000fd5b6000826106ed576106ed6106c8565b500490565b80820260008212600160ff1b8414161561070e5761070e61066f565b81810583148215176106985761069861066f565b600082610731576107316106c8565b600160ff1b82146000198414161561074b5761074b61066f565b500590565b80820182811260008312801582168215821617156107705761077061066f565b50509291505056fea264697066735822122059285f5683ee3684ab772b05bd7629497a6d7358bac7b9afa55a9e81818dc59164736f6c63430008190033",
320
320
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100e95760003560e01c80638ea0930e1161008c578063c563364911610066578063c56336491461023c578063d37db1d214610263578063ebf22a081461026d578063fe8167d81461029457600080fd5b80638ea0930e146101db578063b571268114610202578063b81688161461022957600080fd5b806338afe9c4116100c857806338afe9c4146101535780633b53e8881461017a5780635d0054c4146101a15780636e71e2d8146101c857600080fd5b8062084e89146100ee57806315f24053146101285780632191f92a1461013b575b600080fd5b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b610115610136366004610611565b6102bb565b610143600181565b604051901515815260200161011f565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101156101d6366004610611565b6102d2565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011561023736600461063d565b61033b565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011562a0668081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b60006102c88484846103b7565b90505b9392505050565b6000826000036102e4575060006102cb565b6000826102f18587610685565b6102fb919061069e565b61030d670de0b6b3a7640000866106b1565b61031791906106de565b9050670de0b6b3a76400008111156102c85750670de0b6b3a7640000949350505050565b60008061035083670de0b6b3a764000061069e565b9050600061035f8787876103b7565b90506000670de0b6b3a764000061037684846106b1565b61038091906106de565b9050670de0b6b3a7640000816103978a8a8a6102d2565b6103a191906106b1565b6103ab91906106de565b98975050505050505050565b6000806103c58585856102d2565b9050670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000821215610469576104607f0000000000000000000000000000000000000000000000000000000000000000826104477f0000000000000000000000000000000000000000000000000000000000000000866106f2565b6104519190610722565b61045b9190610750565b6105fa565b925050506102cb565b7f0000000000000000000000000000000000000000000000000000000000000000821215610550577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105027f0000000000000000000000000000000000000000000000000000000000000000856106f2565b61050c9190610722565b6105169190610750565b905061054561045b827f0000000000000000000000000000000000000000000000000000000000000000610750565b9450505050506102cb565b7f000000000000000000000000000000000000000000000000000000000000000082036000826105a07f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105aa9190610722565b9050610545816104517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610750565b60008080831361060a57806102cb565b5090919050565b60008060006060848603121561062657600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561065357600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106985761069861066f565b92915050565b818103818111156106985761069861066f565b80820281158282048414176106985761069861066f565b634e487b7160e01b600052601260045260246000fd5b6000826106ed576106ed6106c8565b500490565b80820260008212600160ff1b8414161561070e5761070e61066f565b81810583148215176106985761069861066f565b600082610731576107316106c8565b600160ff1b82146000198414161561074b5761074b61066f565b500590565b80820182811260008312801582168215821617156107705761077061066f565b50509291505056fea264697066735822122059285f5683ee3684ab772b05bd7629497a6d7358bac7b9afa55a9e81818dc59164736f6c63430008190033",
@@ -0,0 +1,79 @@
1
+ {
2
+ "language": "Solidity",
3
+ "sources": {
4
+ "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": {
5
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
6
+ },
7
+ "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
8
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
9
+ },
10
+ "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
11
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
12
+ },
13
+ "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": {
14
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
15
+ },
16
+ "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": {
17
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
18
+ },
19
+ "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": {
20
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
21
+ },
22
+ "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": {
23
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n"
24
+ },
25
+ "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
26
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
27
+ },
28
+ "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
29
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
30
+ },
31
+ "@openzeppelin/contracts/access/IAccessControl.sol": {
32
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n"
33
+ },
34
+ "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": {
35
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n"
36
+ },
37
+ "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": {
38
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n"
39
+ },
40
+ "contracts/Admin/VBNBAdmin.sol": {
41
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IProtocolShareReserve, IWBNB, VBNBAdminStorage, VTokenInterface } from \"./VBNBAdminStorage.sol\";\n\n/**\n * @title VBNBAdmin\n * @author Venus\n * @notice This contract is the \"admin\" of the vBNB market, reducing the reserves of the market, sending them to the `ProtocolShareReserve` contract,\n * and allowing the executions of the rest of the privileged functions in the vBNB contract (after checking if the sender has the required permissions).\n */\ncontract VBNBAdmin is ReentrancyGuardUpgradeable, AccessControlledV8, VBNBAdminStorage {\n using SafeERC20Upgradeable for IWBNB;\n\n /// @notice address of vBNB\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n VTokenInterface public immutable vBNB;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n IWBNB public immutable WBNB;\n\n /// @notice Emitted when PSR is updated\n event ProtocolShareReserveUpdated(\n IProtocolShareReserve indexed oldProtocolShareReserve,\n IProtocolShareReserve indexed newProtocolShareReserve\n );\n\n /// @notice Emitted reserves are reduced\n event ReservesReduced(uint256 reduceAmount);\n\n /// @param _vBNB Address of the vBNB contract\n /// @param _WBNB Address of the WBNB token\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(VTokenInterface _vBNB, IWBNB _WBNB) {\n require(address(_WBNB) != address(0), \"WBNB address invalid\");\n require(address(_vBNB) != address(0), \"vBNB address invalid\");\n\n vBNB = _vBNB;\n WBNB = _WBNB;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice Used to initialize non-immutable variables\n function initialize(\n IProtocolShareReserve _protocolShareReserve,\n address accessControlManager\n ) external initializer {\n require(address(_protocolShareReserve) != address(0), \"PSR address invalid\");\n protocolShareReserve = _protocolShareReserve;\n\n __ReentrancyGuard_init();\n __AccessControlled_init(accessControlManager);\n }\n\n /**\n * @notice PSR setter.\n * @param protocolShareReserve_ Address of the PSR contract\n * @custom:access Only owner (Governance)\n * @custom:event Emits ProtocolShareReserveUpdated event.\n */\n function setProtocolShareReserve(IProtocolShareReserve protocolShareReserve_) external onlyOwner {\n require(address(protocolShareReserve_) != address(0), \"PSR address invalid\");\n emit ProtocolShareReserveUpdated(protocolShareReserve, protocolShareReserve_);\n protocolShareReserve = protocolShareReserve_;\n }\n\n /**\n * @notice Reduce reserves of vBNB, wrap them and send them to the PSR contract\n * @param reduceAmount amount of reserves to reduce\n * @custom:event Emits ReservesReduced event.\n */\n function reduceReserves(uint reduceAmount) external nonReentrant {\n require(vBNB._reduceReserves(reduceAmount) == 0, \"reduceReserves failed\");\n _wrapBNB();\n\n uint256 balance = WBNB.balanceOf(address(this));\n WBNB.safeTransfer(address(protocolShareReserve), balance);\n protocolShareReserve.updateAssetsState(\n vBNB.comptroller(),\n address(WBNB),\n IProtocolShareReserve.IncomeType.SPREAD\n );\n\n emit ReservesReduced(reduceAmount);\n }\n\n /**\n * @notice Sets the interest rate model of the vBNB contract\n * @param newInterestRateModel Address of the new interest rate model\n * @custom:access Controlled by ACM\n */\n function setInterestRateModel(address newInterestRateModel) public returns (uint256) {\n _checkAccessAllowed(\"setInterestRateModel(address)\");\n return vBNB._setInterestRateModel(newInterestRateModel);\n }\n\n /**\n * @notice Wraps BNB into WBNB\n */\n function _wrapBNB() internal {\n uint256 bnbBalance = address(this).balance;\n WBNB.deposit{ value: bnbBalance }();\n }\n\n /**\n * @notice Invoked when BNB is sent to this contract\n * @custom:access Only vBNB is considered a valid sender\n */\n receive() external payable {\n require(msg.sender == address(vBNB), \"only vBNB can send BNB to this contract\");\n }\n\n /**\n * @notice Invoked when called function does not exist in the contract. The function will be executed in the vBNB contract.\n * @custom:access Only owner (Governance)\n */\n fallback(bytes calldata data) external payable onlyOwner returns (bytes memory) {\n (bool ok, bytes memory res) = address(vBNB).call{ value: msg.value }(data);\n require(ok, \"call failed\");\n return res;\n }\n}\n"
42
+ },
43
+ "contracts/Admin/VBNBAdminStorage.sol": {
44
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\n\ninterface VTokenInterface {\n function _reduceReserves(uint reduceAmount) external returns (uint);\n\n function _acceptAdmin() external returns (uint);\n\n function comptroller() external returns (address);\n\n function _setInterestRateModel(address newInterestRateModel) external returns (uint);\n}\n\ninterface IWBNB is IERC20Upgradeable {\n function deposit() external payable;\n}\n\ninterface IProtocolShareReserve {\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(address comptroller, address asset, IncomeType incomeType) external;\n}\n\ncontract VBNBAdminStorage {\n /// @notice address of protocol share reserve contract\n IProtocolShareReserve public protocolShareReserve;\n\n /// @dev gap to prevent collision in inheritence\n uint256[49] private __gap;\n}\n"
45
+ },
46
+ "contracts/InterestRateModels/InterestRateModelV8.sol": {
47
+ "content": "pragma solidity 0.8.25;\n\n/**\n * @title Venus's InterestRateModelV8 Interface\n * @author Venus\n */\nabstract contract InterestRateModelV8 {\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\n bool public constant isInterestRateModel = true;\n\n /**\n * @notice Calculates the current borrow interest rate per block\n * @param cash The total amount of cash the market has\n * @param borrows The total amount of borrows the market has outstanding\n * @param reserves The total amnount of reserves the market has\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\n */\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view virtual returns (uint256);\n\n /**\n * @notice Calculates the current supply interest rate per block\n * @param cash The total amount of cash the market has\n * @param borrows The total amount of borrows the market has outstanding\n * @param reserves The total amnount of reserves the market has\n * @param reserveFactorMantissa The current reserve factor the market has\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\n */\n function getSupplyRate(\n uint256 cash,\n uint256 borrows,\n uint256 reserves,\n uint256 reserveFactorMantissa\n ) external view virtual returns (uint256);\n}\n"
48
+ },
49
+ "contracts/InterestRateModels/TwoKinksInterestRateModel.sol": {
50
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { InterestRateModelV8 } from \"./InterestRateModelV8.sol\";\n\n/**\n * @title TwoKinksInterestRateModel\n * @author Venus\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\n */\ncontract TwoKinksInterestRateModel is InterestRateModelV8 {\n int256 public constant BLOCKS_PER_YEAR = (60 * 60 * 24 * 365) / 3; // (assuming 3s blocks)\n\n ////////////////////// SLOPE 1 //////////////////////\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\n */\n int256 public immutable MULTIPLIER_PER_BLOCK;\n\n /**\n * @notice The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\n */\n int256 public immutable BASE_RATE_PER_BLOCK;\n\n ////////////////////// SLOPE 2 //////////////////////\n\n /**\n * @notice The utilization point at which the multiplier2 is applied\n */\n int256 public immutable KINK_1;\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\n */\n int256 public immutable MULTIPLIER_2_PER_BLOCK;\n\n /**\n * @notice The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\n */\n int256 public immutable BASE_RATE_2_PER_BLOCK;\n\n /**\n * @notice The maximum kink interest rate scaled by EXP_SCALE\n */\n int256 public immutable RATE_1;\n\n ////////////////////// SLOPE 3 //////////////////////\n\n /**\n * @notice The utilization point at which the jump multiplier is applied\n */\n int256 public immutable KINK_2;\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\n */\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK;\n\n /**\n * @notice The maximum kink interest rate scaled by EXP_SCALE\n */\n int256 public immutable RATE_2;\n\n /// @notice Base unit for computations, usually used in scaling (multiplications, divisions)\n uint256 internal constant EXP_SCALE = 1e18;\n\n /**\n * @notice Thrown when a negative value is not allowed\n */\n error NegativeValueNotAllowed();\n\n /**\n * @notice Thrown when the kink points are not in the correct order\n */\n error InvalidKink();\n\n /**\n * @notice Construct an interest rate model\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\n * @param kink1_ The utilization point at which the multiplier2 is applied\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\n * @param baseRate2PerYear_ The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\n * @param kink2_ The utilization point at which the jump multiplier is applied\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\n */\n constructor(\n int256 baseRatePerYear_,\n int256 multiplierPerYear_,\n int256 kink1_,\n int256 multiplier2PerYear_,\n int256 baseRate2PerYear_,\n int256 kink2_,\n int256 jumpMultiplierPerYear_\n ) {\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\n revert NegativeValueNotAllowed();\n }\n\n if (kink2_ <= kink1_ || kink1_ <= 0) {\n revert InvalidKink();\n }\n\n BASE_RATE_PER_BLOCK = baseRatePerYear_ / BLOCKS_PER_YEAR;\n MULTIPLIER_PER_BLOCK = multiplierPerYear_ / BLOCKS_PER_YEAR;\n KINK_1 = kink1_;\n MULTIPLIER_2_PER_BLOCK = multiplier2PerYear_ / BLOCKS_PER_YEAR;\n BASE_RATE_2_PER_BLOCK = baseRate2PerYear_ / BLOCKS_PER_YEAR;\n KINK_2 = kink2_;\n JUMP_MULTIPLIER_PER_BLOCK = jumpMultiplierPerYear_ / BLOCKS_PER_YEAR;\n\n int256 expScale = int256(EXP_SCALE);\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\n\n int256 slope2Util;\n unchecked {\n slope2Util = KINK_2 - KINK_1;\n }\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\n }\n\n /**\n * @notice Calculates the current borrow rate per slot (block)\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view override returns (uint256) {\n return _getBorrowRate(cash, borrows, reserves);\n }\n\n /**\n * @notice Calculates the current supply rate per slot (block)\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @param reserveFactorMantissa The current reserve factor for the market\n * @return The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function getSupplyRate(\n uint256 cash,\n uint256 borrows,\n uint256 reserves,\n uint256 reserveFactorMantissa\n ) public view virtual override returns (uint256) {\n uint256 oneMinusReserveFactor = EXP_SCALE - reserveFactorMantissa;\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves);\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\n return (utilizationRate(cash, borrows, reserves) * rateToPool) / EXP_SCALE;\n }\n\n /**\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The utilization rate as a mantissa between [0, EXP_SCALE]\n */\n function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) {\n // Utilization rate is 0 when there are no borrows\n if (borrows == 0) {\n return 0;\n }\n\n uint256 rate = (borrows * EXP_SCALE) / (cash + borrows - reserves);\n\n if (rate > EXP_SCALE) {\n rate = EXP_SCALE;\n }\n\n return rate;\n }\n\n /**\n * @notice Calculates the current borrow rate per slot (block), with the error code expected by the market\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function _getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) internal view returns (uint256) {\n int256 util = int256(utilizationRate(cash, borrows, reserves));\n int256 expScale = int256(EXP_SCALE);\n\n if (util < KINK_1) {\n return _minCap(((util * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\n } else if (util < KINK_2) {\n int256 slope2Util;\n unchecked {\n slope2Util = util - KINK_1;\n }\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\n\n return _minCap(RATE_1 + rate2);\n } else {\n int256 slope3Util;\n unchecked {\n slope3Util = util - KINK_2;\n }\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK) / expScale);\n\n return _minCap(RATE_1 + RATE_2 + rate3);\n }\n }\n\n /**\n * @notice Returns 0 if number is less than 0, otherwise returns the input\n * @param number The first number\n * @return The maximum of 0 and input number\n */\n function _minCap(int256 number) internal pure returns (uint256) {\n int256 zero;\n return uint256(number > zero ? number : zero);\n }\n}\n"
51
+ }
52
+ },
53
+ "settings": {
54
+ "optimizer": {
55
+ "enabled": true,
56
+ "runs": 200
57
+ },
58
+ "evmVersion": "paris",
59
+ "outputSelection": {
60
+ "*": {
61
+ "*": [
62
+ "storageLayout",
63
+ "abi",
64
+ "evm.bytecode",
65
+ "evm.deployedBytecode",
66
+ "evm.methodIdentifiers",
67
+ "metadata",
68
+ "devdoc",
69
+ "userdoc",
70
+ "evm.gasEstimates"
71
+ ],
72
+ "": ["ast"]
73
+ }
74
+ },
75
+ "metadata": {
76
+ "useLiteralContent": true
77
+ }
78
+ }
79
+ }
@@ -6498,7 +6498,7 @@
6498
6498
  ]
6499
6499
  },
6500
6500
  "InterestRateModelVBNB": {
6501
- "address": "0x4E026f23f65EA7ad206886F91f74B79adBA2bc62",
6501
+ "address": "0xb16Db373A194acb9018919B77ae480f2a8f0F128",
6502
6502
  "abi": [
6503
6503
  {
6504
6504
  "inputs": [
@@ -16,7 +16,7 @@
16
16
  "DefaultProxyAdmin": "0x6beb6D2695B67FEb73ad4f172E8E2975497187e4",
17
17
  "ETH": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
18
18
  "FIL": "0x0D8Ce2A99Bb6e3B7Db580eD848240e4a0F9aE153",
19
- "InterestRateModelVBNB": "0x4E026f23f65EA7ad206886F91f74B79adBA2bc62",
19
+ "InterestRateModelVBNB": "0xb16Db373A194acb9018919B77ae480f2a8f0F128",
20
20
  "InterestRateModelVETH": "0x3aa125788FC6b9F801772baEa887aA40328015e9",
21
21
  "JumpRateModel_base0bps_slope10000bps_jump25000bps_kink8000bps": "0x9e8fbACBfbD811Fc561af3Af7df8e38dEd4c52F3",
22
22
  "JumpRateModel_base0bps_slope10000bps_jump50000bps_kink8000bps": "0x958F4C84d3ad523Fa9936Dc465A123C7AD43D69B",
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "0x86954c6fCA6B464269Aa7011B143c4D93Dfa1146",
2
+ "address": "0xfc78B2C1441D968944F418C822Cac0237c380f5F",
3
3
  "abi": [
4
4
  {
5
5
  "inputs": [
@@ -288,33 +288,33 @@
288
288
  "type": "function"
289
289
  }
290
290
  ],
291
- "transactionHash": "0x4bbf88b57774d0047417f0e612ae0f5fde107f0bb46c3a0d5a15d6b9425147ad",
291
+ "transactionHash": "0x1bf8d5dcf60a605c7906e481372a4ddb7cef1dd355bf59cc2a43bba845308221",
292
292
  "receipt": {
293
293
  "to": null,
294
- "from": "0x464779C41C5f1Be598853C1F87bCC7087Ea75f28",
295
- "contractAddress": "0x86954c6fCA6B464269Aa7011B143c4D93Dfa1146",
294
+ "from": "0x30D519A93Bc1F7C437225361F8Cd8e0f0a29662E",
295
+ "contractAddress": "0xfc78B2C1441D968944F418C822Cac0237c380f5F",
296
296
  "transactionIndex": 0,
297
- "gasUsed": "485524",
297
+ "gasUsed": "485512",
298
298
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
299
- "blockHash": "0x88b54ec08cd78520e07d2ebb26fe48a03675607d4474f2659a1a8910cf3a32d9",
300
- "transactionHash": "0x4bbf88b57774d0047417f0e612ae0f5fde107f0bb46c3a0d5a15d6b9425147ad",
299
+ "blockHash": "0x763c8694a91bbc290e09b05787edcaab9bab20cd0695c03201bcf13edf19f3ee",
300
+ "transactionHash": "0x1bf8d5dcf60a605c7906e481372a4ddb7cef1dd355bf59cc2a43bba845308221",
301
301
  "logs": [],
302
- "blockNumber": 44812385,
303
- "cumulativeGasUsed": "485524",
302
+ "blockNumber": 50001356,
303
+ "cumulativeGasUsed": "485512",
304
304
  "status": 1,
305
305
  "byzantium": true
306
306
  },
307
307
  "args": [
308
308
  0,
309
- "225000000000000000",
309
+ "125000000000000000",
310
310
  "400000000000000000",
311
- "350000000000000000",
312
- "210000000000000000",
313
- "700000000000000000",
311
+ "900000000000000000",
312
+ "50000000000000000",
313
+ "800000000000000000",
314
314
  "5000000000000000000"
315
315
  ],
316
- "numDeployments": 2,
317
- "solcInputHash": "4d53145ac87d6351787dba7f52e12c3e",
316
+ "numDeployments": 3,
317
+ "solcInputHash": "0853484adf400255247dccdbf868a509",
318
318
  "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"baseRatePerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink1_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplier2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"baseRate2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink2_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"jumpMultiplierPerYear_\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidKink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NegativeValueNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE_RATE_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_RATE_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BLOCKS_PER_YEAR\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"JUMP_MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_2_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_PER_BLOCK\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInterestRateModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"baseRate2PerYear_\":\"The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\",\"baseRatePerYear_\":\"The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\",\"jumpMultiplierPerYear_\":\"The multiplier after hitting KINK_2\",\"kink1_\":\"The utilization point at which the multiplier2 is applied\",\"kink2_\":\"The utilization point at which the jump multiplier is applied\",\"multiplier2PerYear_\":\"The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\",\"multiplierPerYear_\":\"The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\"}},\"getBorrowRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserveFactorMantissa\":\"The current reserve factor for the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\"}},\"utilizationRate(uint256,uint256,uint256)\":{\"params\":{\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The utilization rate as a mantissa between [0, EXP_SCALE]\"}}},\"title\":\"TwoKinksInterestRateModel\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidKink()\":[{\"notice\":\"Thrown when the kink points are not in the correct order\"}],\"NegativeValueNotAllowed()\":[{\"notice\":\"Thrown when a negative value is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"BASE_RATE_2_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\"},\"BASE_RATE_PER_BLOCK()\":{\"notice\":\"The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\"},\"JUMP_MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\"},\"KINK_1()\":{\"notice\":\"The utilization point at which the multiplier2 is applied\"},\"KINK_2()\":{\"notice\":\"The utilization point at which the jump multiplier is applied\"},\"MULTIPLIER_2_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\"},\"MULTIPLIER_PER_BLOCK()\":{\"notice\":\"The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\"},\"RATE_1()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"RATE_2()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"constructor\":{\"notice\":\"Construct an interest rate model\"},\"getBorrowRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per slot (block)\"},\"getSupplyRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per slot (block)\"},\"isInterestRateModel()\":{\"notice\":\"Indicator that this is an InterestRateModel contract (for inspection)\"},\"utilizationRate(uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\"}},\"notice\":\"An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":\"TwoKinksInterestRateModel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/InterestRateModels/InterestRateModelV8.sol\":{\"content\":\"pragma solidity 0.8.25;\\n\\n/**\\n * @title Venus's InterestRateModelV8 Interface\\n * @author Venus\\n */\\nabstract contract InterestRateModelV8 {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view virtual returns (uint256);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amnount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) external view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9b71896f66909fb3fe829c413594121f0e165d8508e8a6fa29a6938ddcfbb61f\"},\"contracts/InterestRateModels/TwoKinksInterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { InterestRateModelV8 } from \\\"./InterestRateModelV8.sol\\\";\\n\\n/**\\n * @title TwoKinksInterestRateModel\\n * @author Venus\\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\\n */\\ncontract TwoKinksInterestRateModel is InterestRateModelV8 {\\n int256 public constant BLOCKS_PER_YEAR = (60 * 60 * 24 * 365) / 3; // (assuming 3s blocks)\\n\\n ////////////////////// SLOPE 1 //////////////////////\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_PER_BLOCK;\\n\\n ////////////////////// SLOPE 2 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the multiplier2 is applied\\n */\\n int256 public immutable KINK_1;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_2_PER_BLOCK;\\n\\n /**\\n * @notice The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_2_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_1;\\n\\n ////////////////////// SLOPE 3 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n int256 public immutable KINK_2;\\n\\n /**\\n * @notice The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_2;\\n\\n /// @notice Base unit for computations, usually used in scaling (multiplications, divisions)\\n uint256 internal constant EXP_SCALE = 1e18;\\n\\n /**\\n * @notice Thrown when a negative value is not allowed\\n */\\n error NegativeValueNotAllowed();\\n\\n /**\\n * @notice Thrown when the kink points are not in the correct order\\n */\\n error InvalidKink();\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\\n * @param kink1_ The utilization point at which the multiplier2 is applied\\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\\n * @param baseRate2PerYear_ The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\\n * @param kink2_ The utilization point at which the jump multiplier is applied\\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\\n */\\n constructor(\\n int256 baseRatePerYear_,\\n int256 multiplierPerYear_,\\n int256 kink1_,\\n int256 multiplier2PerYear_,\\n int256 baseRate2PerYear_,\\n int256 kink2_,\\n int256 jumpMultiplierPerYear_\\n ) {\\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\\n revert NegativeValueNotAllowed();\\n }\\n\\n if (kink2_ <= kink1_ || kink1_ <= 0) {\\n revert InvalidKink();\\n }\\n\\n BASE_RATE_PER_BLOCK = baseRatePerYear_ / BLOCKS_PER_YEAR;\\n MULTIPLIER_PER_BLOCK = multiplierPerYear_ / BLOCKS_PER_YEAR;\\n KINK_1 = kink1_;\\n MULTIPLIER_2_PER_BLOCK = multiplier2PerYear_ / BLOCKS_PER_YEAR;\\n BASE_RATE_2_PER_BLOCK = baseRate2PerYear_ / BLOCKS_PER_YEAR;\\n KINK_2 = kink2_;\\n JUMP_MULTIPLIER_PER_BLOCK = jumpMultiplierPerYear_ / BLOCKS_PER_YEAR;\\n\\n int256 expScale = int256(EXP_SCALE);\\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n\\n int256 slope2Util;\\n unchecked {\\n slope2Util = KINK_2 - KINK_1;\\n }\\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view override returns (uint256) {\\n return _getBorrowRate(cash, borrows, reserves);\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per slot (block)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param reserveFactorMantissa The current reserve factor for the market\\n * @return The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) public view virtual override returns (uint256) {\\n uint256 oneMinusReserveFactor = EXP_SCALE - reserveFactorMantissa;\\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves);\\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\\n return (utilizationRate(cash, borrows, reserves) * rateToPool) / EXP_SCALE;\\n }\\n\\n /**\\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The utilization rate as a mantissa between [0, EXP_SCALE]\\n */\\n function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) {\\n // Utilization rate is 0 when there are no borrows\\n if (borrows == 0) {\\n return 0;\\n }\\n\\n uint256 rate = (borrows * EXP_SCALE) / (cash + borrows - reserves);\\n\\n if (rate > EXP_SCALE) {\\n rate = EXP_SCALE;\\n }\\n\\n return rate;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block), with the error code expected by the market\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\\n */\\n function _getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) internal view returns (uint256) {\\n int256 util = int256(utilizationRate(cash, borrows, reserves));\\n int256 expScale = int256(EXP_SCALE);\\n\\n if (util < KINK_1) {\\n return _minCap(((util * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\\n } else if (util < KINK_2) {\\n int256 slope2Util;\\n unchecked {\\n slope2Util = util - KINK_1;\\n }\\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\\n\\n return _minCap(RATE_1 + rate2);\\n } else {\\n int256 slope3Util;\\n unchecked {\\n slope3Util = util - KINK_2;\\n }\\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK) / expScale);\\n\\n return _minCap(RATE_1 + RATE_2 + rate3);\\n }\\n }\\n\\n /**\\n * @notice Returns 0 if number is less than 0, otherwise returns the input\\n * @param number The first number\\n * @return The maximum of 0 and input number\\n */\\n function _minCap(int256 number) internal pure returns (uint256) {\\n int256 zero;\\n return uint256(number > zero ? number : zero);\\n }\\n}\\n\",\"keccak256\":\"0x5e1c42a7adfb2b10fddac364289e7af8285d0f387f4961c5bd76624ae11ef2d3\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
319
319
  "bytecode": "0x6101a060405234801561001157600080fd5b50604051610adb380380610adb83398101604081905261003091610166565b600087128061003f5750600083125b1561005d576040516341820e7560e11b815260040160405180910390fd5b848213158061006d575060008513155b1561008b57604051637099641d60e11b815260040160405180910390fd5b61009862a06680886101d0565b60a0526100a862a06680876101d0565b60805260c08590526100bd62a06680856101d0565b60e0526100cd62a06680846101d0565b610100526101408290526100e462a06680826101d0565b6101605260a05160805160c051670de0b6b3a764000092918391610108919061020c565b61011291906101d0565b61011c9190610242565b6101205260c051610140516101005160e0519290910391839061013f908461020c565b61014991906101d0565b6101539190610242565b610180525061026a975050505050505050565b600080600080600080600060e0888a03121561018157600080fd5b5050855160208701516040880151606089015160808a015160a08b015160c0909b0151949c939b50919990985090965094509092509050565b634e487b7160e01b600052601160045260246000fd5b6000826101ed57634e487b7160e01b600052601260045260246000fd5b600160ff1b821460001984141615610207576102076101ba565b500590565b80820260008212600160ff1b84141615610228576102286101ba565b818105831482151761023c5761023c6101ba565b92915050565b8082018281126000831280158216821582161715610262576102626101ba565b505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516107ae61032d600039600081816101a601526105b5015260008181610299015261057b0152600081816101580152818161046b015261055201526000818160f30152818161052101526105d601526000818161020701526104b801526000818161027201526104dd01526000818161017f015281816103d2015261049301526000818161024101526103fd0152600081816101e0015261042201526107ae6000f3fe608060405234801561001057600080fd5b50600436106100e95760003560e01c80638ea0930e1161008c578063c563364911610066578063c56336491461023c578063d37db1d214610263578063ebf22a081461026d578063fe8167d81461029457600080fd5b80638ea0930e146101db578063b571268114610202578063b81688161461022957600080fd5b806338afe9c4116100c857806338afe9c4146101535780633b53e8881461017a5780635d0054c4146101a15780636e71e2d8146101c857600080fd5b8062084e89146100ee57806315f24053146101285780632191f92a1461013b575b600080fd5b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b610115610136366004610611565b6102bb565b610143600181565b604051901515815260200161011f565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101156101d6366004610611565b6102d2565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011561023736600461063d565b61033b565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011562a0668081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b60006102c88484846103b7565b90505b9392505050565b6000826000036102e4575060006102cb565b6000826102f18587610685565b6102fb919061069e565b61030d670de0b6b3a7640000866106b1565b61031791906106de565b9050670de0b6b3a76400008111156102c85750670de0b6b3a7640000949350505050565b60008061035083670de0b6b3a764000061069e565b9050600061035f8787876103b7565b90506000670de0b6b3a764000061037684846106b1565b61038091906106de565b9050670de0b6b3a7640000816103978a8a8a6102d2565b6103a191906106b1565b6103ab91906106de565b98975050505050505050565b6000806103c58585856102d2565b9050670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000821215610469576104607f0000000000000000000000000000000000000000000000000000000000000000826104477f0000000000000000000000000000000000000000000000000000000000000000866106f2565b6104519190610722565b61045b9190610750565b6105fa565b925050506102cb565b7f0000000000000000000000000000000000000000000000000000000000000000821215610550577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105027f0000000000000000000000000000000000000000000000000000000000000000856106f2565b61050c9190610722565b6105169190610750565b905061054561045b827f0000000000000000000000000000000000000000000000000000000000000000610750565b9450505050506102cb565b7f000000000000000000000000000000000000000000000000000000000000000082036000826105a07f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105aa9190610722565b9050610545816104517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610750565b60008080831361060a57806102cb565b5090919050565b60008060006060848603121561062657600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561065357600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106985761069861066f565b92915050565b818103818111156106985761069861066f565b80820281158282048414176106985761069861066f565b634e487b7160e01b600052601260045260246000fd5b6000826106ed576106ed6106c8565b500490565b80820260008212600160ff1b8414161561070e5761070e61066f565b81810583148215176106985761069861066f565b600082610731576107316106c8565b600160ff1b82146000198414161561074b5761074b61066f565b500590565b80820182811260008312801582168215821617156107705761077061066f565b50509291505056fea264697066735822122059285f5683ee3684ab772b05bd7629497a6d7358bac7b9afa55a9e81818dc59164736f6c63430008190033",
320
320
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100e95760003560e01c80638ea0930e1161008c578063c563364911610066578063c56336491461023c578063d37db1d214610263578063ebf22a081461026d578063fe8167d81461029457600080fd5b80638ea0930e146101db578063b571268114610202578063b81688161461022957600080fd5b806338afe9c4116100c857806338afe9c4146101535780633b53e8881461017a5780635d0054c4146101a15780636e71e2d8146101c857600080fd5b8062084e89146100ee57806315f24053146101285780632191f92a1461013b575b600080fd5b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b610115610136366004610611565b6102bb565b610143600181565b604051901515815260200161011f565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101156101d6366004610611565b6102d2565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011561023736600461063d565b61033b565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61011562a0668081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b60006102c88484846103b7565b90505b9392505050565b6000826000036102e4575060006102cb565b6000826102f18587610685565b6102fb919061069e565b61030d670de0b6b3a7640000866106b1565b61031791906106de565b9050670de0b6b3a76400008111156102c85750670de0b6b3a7640000949350505050565b60008061035083670de0b6b3a764000061069e565b9050600061035f8787876103b7565b90506000670de0b6b3a764000061037684846106b1565b61038091906106de565b9050670de0b6b3a7640000816103978a8a8a6102d2565b6103a191906106b1565b6103ab91906106de565b98975050505050505050565b6000806103c58585856102d2565b9050670de0b6b3a76400007f0000000000000000000000000000000000000000000000000000000000000000821215610469576104607f0000000000000000000000000000000000000000000000000000000000000000826104477f0000000000000000000000000000000000000000000000000000000000000000866106f2565b6104519190610722565b61045b9190610750565b6105fa565b925050506102cb565b7f0000000000000000000000000000000000000000000000000000000000000000821215610550577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105027f0000000000000000000000000000000000000000000000000000000000000000856106f2565b61050c9190610722565b6105169190610750565b905061054561045b827f0000000000000000000000000000000000000000000000000000000000000000610750565b9450505050506102cb565b7f000000000000000000000000000000000000000000000000000000000000000082036000826105a07f0000000000000000000000000000000000000000000000000000000000000000846106f2565b6105aa9190610722565b9050610545816104517f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610750565b60008080831361060a57806102cb565b5090919050565b60008060006060848603121561062657600080fd5b505081359360208301359350604090920135919050565b6000806000806080858703121561065357600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106985761069861066f565b92915050565b818103818111156106985761069861066f565b80820281158282048414176106985761069861066f565b634e487b7160e01b600052601260045260246000fd5b6000826106ed576106ed6106c8565b500490565b80820260008212600160ff1b8414161561070e5761070e61066f565b81810583148215176106985761069861066f565b600082610731576107316106c8565b600160ff1b82146000198414161561074b5761074b61066f565b500590565b80820182811260008312801582168215821617156107705761077061066f565b50509291505056fea264697066735822122059285f5683ee3684ab772b05bd7629497a6d7358bac7b9afa55a9e81818dc59164736f6c63430008190033",
@@ -0,0 +1,79 @@
1
+ {
2
+ "language": "Solidity",
3
+ "sources": {
4
+ "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": {
5
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
6
+ },
7
+ "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
8
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
9
+ },
10
+ "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
11
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n"
12
+ },
13
+ "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": {
14
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n"
15
+ },
16
+ "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": {
17
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
18
+ },
19
+ "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": {
20
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
21
+ },
22
+ "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": {
23
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n"
24
+ },
25
+ "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
26
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n"
27
+ },
28
+ "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
29
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n"
30
+ },
31
+ "@openzeppelin/contracts/access/IAccessControl.sol": {
32
+ "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n"
33
+ },
34
+ "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": {
35
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n"
36
+ },
37
+ "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": {
38
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n"
39
+ },
40
+ "contracts/Admin/VBNBAdmin.sol": {
41
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IProtocolShareReserve, IWBNB, VBNBAdminStorage, VTokenInterface } from \"./VBNBAdminStorage.sol\";\n\n/**\n * @title VBNBAdmin\n * @author Venus\n * @notice This contract is the \"admin\" of the vBNB market, reducing the reserves of the market, sending them to the `ProtocolShareReserve` contract,\n * and allowing the executions of the rest of the privileged functions in the vBNB contract (after checking if the sender has the required permissions).\n */\ncontract VBNBAdmin is ReentrancyGuardUpgradeable, AccessControlledV8, VBNBAdminStorage {\n using SafeERC20Upgradeable for IWBNB;\n\n /// @notice address of vBNB\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n VTokenInterface public immutable vBNB;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n IWBNB public immutable WBNB;\n\n /// @notice Emitted when PSR is updated\n event ProtocolShareReserveUpdated(\n IProtocolShareReserve indexed oldProtocolShareReserve,\n IProtocolShareReserve indexed newProtocolShareReserve\n );\n\n /// @notice Emitted reserves are reduced\n event ReservesReduced(uint256 reduceAmount);\n\n /// @param _vBNB Address of the vBNB contract\n /// @param _WBNB Address of the WBNB token\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(VTokenInterface _vBNB, IWBNB _WBNB) {\n require(address(_WBNB) != address(0), \"WBNB address invalid\");\n require(address(_vBNB) != address(0), \"vBNB address invalid\");\n\n vBNB = _vBNB;\n WBNB = _WBNB;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice Used to initialize non-immutable variables\n function initialize(\n IProtocolShareReserve _protocolShareReserve,\n address accessControlManager\n ) external initializer {\n require(address(_protocolShareReserve) != address(0), \"PSR address invalid\");\n protocolShareReserve = _protocolShareReserve;\n\n __ReentrancyGuard_init();\n __AccessControlled_init(accessControlManager);\n }\n\n /**\n * @notice PSR setter.\n * @param protocolShareReserve_ Address of the PSR contract\n * @custom:access Only owner (Governance)\n * @custom:event Emits ProtocolShareReserveUpdated event.\n */\n function setProtocolShareReserve(IProtocolShareReserve protocolShareReserve_) external onlyOwner {\n require(address(protocolShareReserve_) != address(0), \"PSR address invalid\");\n emit ProtocolShareReserveUpdated(protocolShareReserve, protocolShareReserve_);\n protocolShareReserve = protocolShareReserve_;\n }\n\n /**\n * @notice Reduce reserves of vBNB, wrap them and send them to the PSR contract\n * @param reduceAmount amount of reserves to reduce\n * @custom:event Emits ReservesReduced event.\n */\n function reduceReserves(uint reduceAmount) external nonReentrant {\n require(vBNB._reduceReserves(reduceAmount) == 0, \"reduceReserves failed\");\n _wrapBNB();\n\n uint256 balance = WBNB.balanceOf(address(this));\n WBNB.safeTransfer(address(protocolShareReserve), balance);\n protocolShareReserve.updateAssetsState(\n vBNB.comptroller(),\n address(WBNB),\n IProtocolShareReserve.IncomeType.SPREAD\n );\n\n emit ReservesReduced(reduceAmount);\n }\n\n /**\n * @notice Sets the interest rate model of the vBNB contract\n * @param newInterestRateModel Address of the new interest rate model\n * @custom:access Controlled by ACM\n */\n function setInterestRateModel(address newInterestRateModel) public returns (uint256) {\n _checkAccessAllowed(\"setInterestRateModel(address)\");\n return vBNB._setInterestRateModel(newInterestRateModel);\n }\n\n /**\n * @notice Wraps BNB into WBNB\n */\n function _wrapBNB() internal {\n uint256 bnbBalance = address(this).balance;\n WBNB.deposit{ value: bnbBalance }();\n }\n\n /**\n * @notice Invoked when BNB is sent to this contract\n * @custom:access Only vBNB is considered a valid sender\n */\n receive() external payable {\n require(msg.sender == address(vBNB), \"only vBNB can send BNB to this contract\");\n }\n\n /**\n * @notice Invoked when called function does not exist in the contract. The function will be executed in the vBNB contract.\n * @custom:access Only owner (Governance)\n */\n fallback(bytes calldata data) external payable onlyOwner returns (bytes memory) {\n (bool ok, bytes memory res) = address(vBNB).call{ value: msg.value }(data);\n require(ok, \"call failed\");\n return res;\n }\n}\n"
42
+ },
43
+ "contracts/Admin/VBNBAdminStorage.sol": {
44
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\n\ninterface VTokenInterface {\n function _reduceReserves(uint reduceAmount) external returns (uint);\n\n function _acceptAdmin() external returns (uint);\n\n function comptroller() external returns (address);\n\n function _setInterestRateModel(address newInterestRateModel) external returns (uint);\n}\n\ninterface IWBNB is IERC20Upgradeable {\n function deposit() external payable;\n}\n\ninterface IProtocolShareReserve {\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(address comptroller, address asset, IncomeType incomeType) external;\n}\n\ncontract VBNBAdminStorage {\n /// @notice address of protocol share reserve contract\n IProtocolShareReserve public protocolShareReserve;\n\n /// @dev gap to prevent collision in inheritence\n uint256[49] private __gap;\n}\n"
45
+ },
46
+ "contracts/InterestRateModels/InterestRateModelV8.sol": {
47
+ "content": "pragma solidity 0.8.25;\n\n/**\n * @title Venus's InterestRateModelV8 Interface\n * @author Venus\n */\nabstract contract InterestRateModelV8 {\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\n bool public constant isInterestRateModel = true;\n\n /**\n * @notice Calculates the current borrow interest rate per block\n * @param cash The total amount of cash the market has\n * @param borrows The total amount of borrows the market has outstanding\n * @param reserves The total amnount of reserves the market has\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\n */\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view virtual returns (uint256);\n\n /**\n * @notice Calculates the current supply interest rate per block\n * @param cash The total amount of cash the market has\n * @param borrows The total amount of borrows the market has outstanding\n * @param reserves The total amnount of reserves the market has\n * @param reserveFactorMantissa The current reserve factor the market has\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\n */\n function getSupplyRate(\n uint256 cash,\n uint256 borrows,\n uint256 reserves,\n uint256 reserveFactorMantissa\n ) external view virtual returns (uint256);\n}\n"
48
+ },
49
+ "contracts/InterestRateModels/TwoKinksInterestRateModel.sol": {
50
+ "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { InterestRateModelV8 } from \"./InterestRateModelV8.sol\";\n\n/**\n * @title TwoKinksInterestRateModel\n * @author Venus\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\n */\ncontract TwoKinksInterestRateModel is InterestRateModelV8 {\n int256 public constant BLOCKS_PER_YEAR = (60 * 60 * 24 * 365) / 3; // (assuming 3s blocks)\n\n ////////////////////// SLOPE 1 //////////////////////\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 1 of the interest rate scaled by EXP_SCALE\n */\n int256 public immutable MULTIPLIER_PER_BLOCK;\n\n /**\n * @notice The base interest rate per block which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\n */\n int256 public immutable BASE_RATE_PER_BLOCK;\n\n ////////////////////// SLOPE 2 //////////////////////\n\n /**\n * @notice The utilization point at which the multiplier2 is applied\n */\n int256 public immutable KINK_1;\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 2 of the interest rate scaled by EXP_SCALE\n */\n int256 public immutable MULTIPLIER_2_PER_BLOCK;\n\n /**\n * @notice The base interest rate per block which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\n */\n int256 public immutable BASE_RATE_2_PER_BLOCK;\n\n /**\n * @notice The maximum kink interest rate scaled by EXP_SCALE\n */\n int256 public immutable RATE_1;\n\n ////////////////////// SLOPE 3 //////////////////////\n\n /**\n * @notice The utilization point at which the jump multiplier is applied\n */\n int256 public immutable KINK_2;\n\n /**\n * @notice The multiplier of utilization rate per block that gives the slope 3 of interest rate scaled by EXP_SCALE\n */\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK;\n\n /**\n * @notice The maximum kink interest rate scaled by EXP_SCALE\n */\n int256 public immutable RATE_2;\n\n /// @notice Base unit for computations, usually used in scaling (multiplications, divisions)\n uint256 internal constant EXP_SCALE = 1e18;\n\n /**\n * @notice Thrown when a negative value is not allowed\n */\n error NegativeValueNotAllowed();\n\n /**\n * @notice Thrown when the kink points are not in the correct order\n */\n error InvalidKink();\n\n /**\n * @notice Construct an interest rate model\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\n * @param kink1_ The utilization point at which the multiplier2 is applied\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\n * @param baseRate2PerYear_ The additional base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\n * @param kink2_ The utilization point at which the jump multiplier is applied\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\n */\n constructor(\n int256 baseRatePerYear_,\n int256 multiplierPerYear_,\n int256 kink1_,\n int256 multiplier2PerYear_,\n int256 baseRate2PerYear_,\n int256 kink2_,\n int256 jumpMultiplierPerYear_\n ) {\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\n revert NegativeValueNotAllowed();\n }\n\n if (kink2_ <= kink1_ || kink1_ <= 0) {\n revert InvalidKink();\n }\n\n BASE_RATE_PER_BLOCK = baseRatePerYear_ / BLOCKS_PER_YEAR;\n MULTIPLIER_PER_BLOCK = multiplierPerYear_ / BLOCKS_PER_YEAR;\n KINK_1 = kink1_;\n MULTIPLIER_2_PER_BLOCK = multiplier2PerYear_ / BLOCKS_PER_YEAR;\n BASE_RATE_2_PER_BLOCK = baseRate2PerYear_ / BLOCKS_PER_YEAR;\n KINK_2 = kink2_;\n JUMP_MULTIPLIER_PER_BLOCK = jumpMultiplierPerYear_ / BLOCKS_PER_YEAR;\n\n int256 expScale = int256(EXP_SCALE);\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\n\n int256 slope2Util;\n unchecked {\n slope2Util = KINK_2 - KINK_1;\n }\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\n }\n\n /**\n * @notice Calculates the current borrow rate per slot (block)\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) external view override returns (uint256) {\n return _getBorrowRate(cash, borrows, reserves);\n }\n\n /**\n * @notice Calculates the current supply rate per slot (block)\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @param reserveFactorMantissa The current reserve factor for the market\n * @return The supply rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function getSupplyRate(\n uint256 cash,\n uint256 borrows,\n uint256 reserves,\n uint256 reserveFactorMantissa\n ) public view virtual override returns (uint256) {\n uint256 oneMinusReserveFactor = EXP_SCALE - reserveFactorMantissa;\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves);\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\n return (utilizationRate(cash, borrows, reserves) * rateToPool) / EXP_SCALE;\n }\n\n /**\n * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The utilization rate as a mantissa between [0, EXP_SCALE]\n */\n function utilizationRate(uint256 cash, uint256 borrows, uint256 reserves) public pure returns (uint256) {\n // Utilization rate is 0 when there are no borrows\n if (borrows == 0) {\n return 0;\n }\n\n uint256 rate = (borrows * EXP_SCALE) / (cash + borrows - reserves);\n\n if (rate > EXP_SCALE) {\n rate = EXP_SCALE;\n }\n\n return rate;\n }\n\n /**\n * @notice Calculates the current borrow rate per slot (block), with the error code expected by the market\n * @param cash The amount of cash in the market\n * @param borrows The amount of borrows in the market\n * @param reserves The amount of reserves in the market\n * @return The borrow rate percentage per slot (block) as a mantissa (scaled by EXP_SCALE)\n */\n function _getBorrowRate(uint256 cash, uint256 borrows, uint256 reserves) internal view returns (uint256) {\n int256 util = int256(utilizationRate(cash, borrows, reserves));\n int256 expScale = int256(EXP_SCALE);\n\n if (util < KINK_1) {\n return _minCap(((util * MULTIPLIER_PER_BLOCK) / expScale) + BASE_RATE_PER_BLOCK);\n } else if (util < KINK_2) {\n int256 slope2Util;\n unchecked {\n slope2Util = util - KINK_1;\n }\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK) / expScale) + BASE_RATE_2_PER_BLOCK;\n\n return _minCap(RATE_1 + rate2);\n } else {\n int256 slope3Util;\n unchecked {\n slope3Util = util - KINK_2;\n }\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK) / expScale);\n\n return _minCap(RATE_1 + RATE_2 + rate3);\n }\n }\n\n /**\n * @notice Returns 0 if number is less than 0, otherwise returns the input\n * @param number The first number\n * @return The maximum of 0 and input number\n */\n function _minCap(int256 number) internal pure returns (uint256) {\n int256 zero;\n return uint256(number > zero ? number : zero);\n }\n}\n"
51
+ }
52
+ },
53
+ "settings": {
54
+ "optimizer": {
55
+ "enabled": true,
56
+ "runs": 200
57
+ },
58
+ "evmVersion": "paris",
59
+ "outputSelection": {
60
+ "*": {
61
+ "*": [
62
+ "storageLayout",
63
+ "abi",
64
+ "evm.bytecode",
65
+ "evm.deployedBytecode",
66
+ "evm.methodIdentifiers",
67
+ "metadata",
68
+ "devdoc",
69
+ "userdoc",
70
+ "evm.gasEstimates"
71
+ ],
72
+ "": ["ast"]
73
+ }
74
+ },
75
+ "metadata": {
76
+ "useLiteralContent": true
77
+ }
78
+ }
79
+ }
@@ -1597,7 +1597,7 @@
1597
1597
  ]
1598
1598
  },
1599
1599
  "InterestRateModelVBNB": {
1600
- "address": "0x86954c6fCA6B464269Aa7011B143c4D93Dfa1146",
1600
+ "address": "0xfc78B2C1441D968944F418C822Cac0237c380f5F",
1601
1601
  "abi": [
1602
1602
  {
1603
1603
  "inputs": [
@@ -8,7 +8,7 @@
8
8
  "ComptrollerLens": "0x350d56985A269C148648207E4Cea9f87656E762a",
9
9
  "DefaultProxyAdmin": "0x7877ffd62649b6a1557b55d4c20fcbab17344c91",
10
10
  "ETH": "0x98f7A83361F7Ac8765CcEBAB1425da6b341958a7",
11
- "InterestRateModelVBNB": "0x86954c6fCA6B464269Aa7011B143c4D93Dfa1146",
11
+ "InterestRateModelVBNB": "0xfc78B2C1441D968944F418C822Cac0237c380f5F",
12
12
  "JumpRateModel_base0bps_slope1000bps_jump25000bps_kink8000bps": "0x4348FC0CBD4ab6E46311ef90ba706169e50fC804",
13
13
  "JumpRateModel_base0bps_slope687bps_jump25000bps_kink8000bps": "0xf59B7f2733a549dCF82b804d69d9c6a38985B90B",
14
14
  "JumpRateModel_base0bps_slope900bps_jump20000bps_kink5000bps": "0x12b88631a2033c0e9afA36b295cdFCf49493E89e",
@@ -92,7 +92,7 @@ const func = async function (hre) {
92
92
  (0, utils_1.parseUnits)("0.125", 18),
93
93
  (0, utils_1.parseUnits)("0.4", 18),
94
94
  (0, utils_1.parseUnits)("0.9", 18),
95
- (0, utils_1.parseUnits)("0.21", 18),
95
+ (0, utils_1.parseUnits)("0.05", 18),
96
96
  (0, utils_1.parseUnits)("0.8", 18),
97
97
  (0, utils_1.parseUnits)("5", 18),
98
98
  ],
@@ -6498,7 +6498,7 @@
6498
6498
  ]
6499
6499
  },
6500
6500
  "InterestRateModelVBNB": {
6501
- "address": "0x4E026f23f65EA7ad206886F91f74B79adBA2bc62",
6501
+ "address": "0xb16Db373A194acb9018919B77ae480f2a8f0F128",
6502
6502
  "abi": [
6503
6503
  {
6504
6504
  "inputs": [
@@ -1597,7 +1597,7 @@
1597
1597
  ]
1598
1598
  },
1599
1599
  "InterestRateModelVBNB": {
1600
- "address": "0x86954c6fCA6B464269Aa7011B143c4D93Dfa1146",
1600
+ "address": "0xfc78B2C1441D968944F418C822Cac0237c380f5F",
1601
1601
  "abi": [
1602
1602
  {
1603
1603
  "inputs": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venusprotocol/venus-protocol",
3
- "version": "9.8.0-dev.2",
3
+ "version": "9.8.0-dev.3",
4
4
  "description": "The Venus Money Market",
5
5
  "repository": "git@github.com:VenusProtocol/venus-protocol.git",
6
6
  "author": "Venus",