@venusprotocol/isolated-pools 1.0.0-dev.1 → 1.0.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.
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +215 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +183 -0
- package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json +63 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC1967.sol/IERC1967.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC1967.sol/IERC1967.json +56 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.json +24 -0
- package/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.json +56 -0
- package/artifacts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.json +19 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol/BeaconProxy.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol/BeaconProxy.json +80 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.json +24 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.json +113 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +297 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json +194 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.json +233 -0
- package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +10 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +115 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +76 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +24 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol/ReentrancyGuardUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol/ReentrancyGuardUpgradeable.json +24 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.json +194 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol/IERC20PermitUpgradeable.json +86 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol/SafeERC20Upgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol/SafeERC20Upgradeable.json +10 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +10 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +24 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +369 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.json +181 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.json +282 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +4 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.json +40 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +4 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/OracleInterface.json +30 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +4 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.json +43 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +4 -0
- package/artifacts/@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol/TwapInterface.json +49 -0
- package/artifacts/build-info/16ab40c4151bb2c077b92cd42e217558.json +1 -0
- package/artifacts/build-info/f19d689bc99e63a20dd2a17a14e2b84a.json +1 -0
- package/artifacts/contracts/BaseJumpRateModelV2.sol/BaseJumpRateModelV2.dbg.json +4 -0
- package/artifacts/contracts/BaseJumpRateModelV2.sol/BaseJumpRateModelV2.json +276 -0
- package/artifacts/contracts/Comptroller.sol/Comptroller.dbg.json +4 -0
- package/artifacts/contracts/Comptroller.sol/Comptroller.json +1667 -0
- package/artifacts/contracts/ComptrollerInterface.sol/ComptrollerInterface.dbg.json +4 -0
- package/artifacts/contracts/ComptrollerInterface.sol/ComptrollerInterface.json +285 -0
- package/artifacts/contracts/ComptrollerInterface.sol/ComptrollerViewInterface.dbg.json +4 -0
- package/artifacts/contracts/ComptrollerInterface.sol/ComptrollerViewInterface.json +170 -0
- package/artifacts/contracts/ComptrollerStorage.sol/ComptrollerStorage.dbg.json +4 -0
- package/artifacts/contracts/ComptrollerStorage.sol/ComptrollerStorage.json +173 -0
- package/artifacts/contracts/ErrorReporter.sol/TokenErrorReporter.dbg.json +4 -0
- package/artifacts/contracts/ErrorReporter.sol/TokenErrorReporter.json +156 -0
- package/artifacts/contracts/ExponentialNoError.sol/ExponentialNoError.dbg.json +4 -0
- package/artifacts/contracts/ExponentialNoError.sol/ExponentialNoError.json +10 -0
- package/artifacts/contracts/Factories/JumpRateModelFactory.sol/JumpRateModelFactory.dbg.json +4 -0
- package/artifacts/contracts/Factories/JumpRateModelFactory.sol/JumpRateModelFactory.json +50 -0
- package/artifacts/contracts/Factories/VTokenProxyFactory.sol/VTokenProxyFactory.dbg.json +4 -0
- package/artifacts/contracts/Factories/VTokenProxyFactory.sol/VTokenProxyFactory.json +191 -0
- package/artifacts/contracts/Factories/WhitePaperInterestRateModelFactory.sol/WhitePaperInterestRateModelFactory.dbg.json +4 -0
- package/artifacts/contracts/Factories/WhitePaperInterestRateModelFactory.sol/WhitePaperInterestRateModelFactory.json +35 -0
- package/artifacts/contracts/IPancakeswapV2Router.sol/IPancakeswapV2Router.dbg.json +4 -0
- package/artifacts/contracts/IPancakeswapV2Router.sol/IPancakeswapV2Router.json +50 -0
- package/artifacts/contracts/InterestRateModel.sol/InterestRateModel.dbg.json +4 -0
- package/artifacts/contracts/InterestRateModel.sol/InterestRateModel.json +97 -0
- package/artifacts/contracts/JumpRateModelV2.sol/JumpRateModelV2.dbg.json +4 -0
- package/artifacts/contracts/JumpRateModelV2.sol/JumpRateModelV2.json +307 -0
- package/artifacts/contracts/Lens/PoolLens.sol/PoolLens.dbg.json +4 -0
- package/artifacts/contracts/Lens/PoolLens.sol/PoolLens.json +1087 -0
- package/artifacts/contracts/MaxLoopsLimitHelper.sol/MaxLoopsLimitHelper.dbg.json +4 -0
- package/artifacts/contracts/MaxLoopsLimitHelper.sol/MaxLoopsLimitHelper.json +59 -0
- package/artifacts/contracts/Pool/PoolRegistry.sol/PoolRegistry.dbg.json +4 -0
- package/artifacts/contracts/Pool/PoolRegistry.sol/PoolRegistry.json +923 -0
- package/artifacts/contracts/Pool/PoolRegistryInterface.sol/PoolRegistryInterface.dbg.json +4 -0
- package/artifacts/contracts/Pool/PoolRegistryInterface.sol/PoolRegistryInterface.json +176 -0
- package/artifacts/contracts/Proxy/UpgradeableBeacon.sol/Beacon.dbg.json +4 -0
- package/artifacts/contracts/Proxy/UpgradeableBeacon.sol/Beacon.json +113 -0
- package/artifacts/contracts/Rewards/RewardsDistributor.sol/RewardsDistributor.dbg.json +4 -0
- package/artifacts/contracts/Rewards/RewardsDistributor.sol/RewardsDistributor.json +928 -0
- package/artifacts/contracts/RiskFund/IProtocolShareReserve.sol/IProtocolShareReserve.dbg.json +4 -0
- package/artifacts/contracts/RiskFund/IProtocolShareReserve.sol/IProtocolShareReserve.json +29 -0
- package/artifacts/contracts/RiskFund/IRiskFund.sol/IRiskFund.dbg.json +4 -0
- package/artifacts/contracts/RiskFund/IRiskFund.sol/IRiskFund.json +101 -0
- package/artifacts/contracts/RiskFund/ProtocolShareReserve.sol/ProtocolShareReserve.dbg.json +4 -0
- package/artifacts/contracts/RiskFund/ProtocolShareReserve.sol/ProtocolShareReserve.json +296 -0
- package/artifacts/contracts/RiskFund/ReserveHelpers.sol/ReserveHelpers.dbg.json +4 -0
- package/artifacts/contracts/RiskFund/ReserveHelpers.sol/ReserveHelpers.json +83 -0
- package/artifacts/contracts/RiskFund/RiskFund.sol/RiskFund.dbg.json +4 -0
- package/artifacts/contracts/RiskFund/RiskFund.sol/RiskFund.json +615 -0
- package/artifacts/contracts/Shortfall/IShortfall.sol/IShortfall.dbg.json +4 -0
- package/artifacts/contracts/Shortfall/IShortfall.sol/IShortfall.json +24 -0
- package/artifacts/contracts/Shortfall/Shortfall.sol/Shortfall.dbg.json +4 -0
- package/artifacts/contracts/Shortfall/Shortfall.sol/Shortfall.json +756 -0
- package/artifacts/contracts/VToken.sol/VToken.dbg.json +4 -0
- package/artifacts/contracts/VToken.sol/VToken.json +1850 -0
- package/artifacts/contracts/VTokenInterfaces.sol/VTokenInterface.dbg.json +4 -0
- package/artifacts/contracts/VTokenInterfaces.sol/VTokenInterface.json +1398 -0
- package/artifacts/contracts/VTokenInterfaces.sol/VTokenStorage.dbg.json +4 -0
- package/artifacts/contracts/VTokenInterfaces.sol/VTokenStorage.json +219 -0
- package/artifacts/contracts/WhitePaperInterestRateModel.sol/WhitePaperInterestRateModel.dbg.json +4 -0
- package/artifacts/contracts/WhitePaperInterestRateModel.sol/WhitePaperInterestRateModel.json +192 -0
- package/artifacts/contracts/test/ComptrollerHarness.sol/ComptrollerHarness.dbg.json +4 -0
- package/artifacts/contracts/test/ComptrollerHarness.sol/ComptrollerHarness.json +1712 -0
- package/artifacts/contracts/test/ComptrollerHarness.sol/EchoTypesComptroller.dbg.json +4 -0
- package/artifacts/contracts/test/ComptrollerHarness.sol/EchoTypesComptroller.json +94 -0
- package/artifacts/contracts/test/ComptrollerScenario.sol/ComptrollerScenario.dbg.json +4 -0
- package/artifacts/contracts/test/ComptrollerScenario.sol/ComptrollerScenario.json +1744 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20.json +194 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20Base.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20Base.json +141 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20Harness.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20Harness.json +351 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20NS.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/ERC20NS.json +182 -0
- package/artifacts/contracts/test/ERC20.sol/NonStandardToken.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/NonStandardToken.json +247 -0
- package/artifacts/contracts/test/ERC20.sol/StandardToken.dbg.json +4 -0
- package/artifacts/contracts/test/ERC20.sol/StandardToken.json +259 -0
- package/artifacts/contracts/test/EvilToken.sol/EvilToken.dbg.json +4 -0
- package/artifacts/contracts/test/EvilToken.sol/EvilToken.json +303 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetNonStandardToken.dbg.json +4 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetNonStandardToken.json +265 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetToken.dbg.json +4 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetToken.json +277 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetTokenReEntrantHarness.dbg.json +4 -0
- package/artifacts/contracts/test/FaucetToken.sol/FaucetTokenReEntrantHarness.json +313 -0
- package/artifacts/contracts/test/FeeToken.sol/FeeToken.dbg.json +4 -0
- package/artifacts/contracts/test/FeeToken.sol/FeeToken.json +313 -0
- package/artifacts/contracts/test/HarnessMaxLoopsLimitHelper.sol/HarnessMaxLoopsLimitHelper.dbg.json +4 -0
- package/artifacts/contracts/test/HarnessMaxLoopsLimitHelper.sol/HarnessMaxLoopsLimitHelper.json +85 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IERC20.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IERC20.json +233 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeFactory.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeFactory.json +187 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakePair.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakePair.json +668 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeRouter01.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeRouter01.json +760 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeRouter02.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IPancakeRouter02.json +962 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IWETH.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/IWETH.json +55 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/PancakeLibrary.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/PancakeLibrary.json +10 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/PancakeRouter.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/PancakeRouter.json +982 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/SafeMath.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/SafeMath.json +10 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/TransferHelper.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPancakeSwap.sol/TransferHelper.json +10 -0
- package/artifacts/contracts/test/Mocks/MockPriceOracle.sol/MockPriceOracle.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockPriceOracle.sol/MockPriceOracle.json +85 -0
- package/artifacts/contracts/test/Mocks/MockToken.sol/MockToken.dbg.json +4 -0
- package/artifacts/contracts/test/Mocks/MockToken.sol/MockToken.json +315 -0
- package/artifacts/contracts/test/SafeMath.sol/SafeMath.dbg.json +4 -0
- package/artifacts/contracts/test/SafeMath.sol/SafeMath.json +10 -0
- package/artifacts/contracts/test/UpgradedVToken.sol/UpgradedVToken.dbg.json +4 -0
- package/artifacts/contracts/test/UpgradedVToken.sol/UpgradedVToken.json +1946 -0
- package/artifacts/contracts/test/VTokenHarness.sol/VTokenHarness.dbg.json +4 -0
- package/artifacts/contracts/test/VTokenHarness.sol/VTokenHarness.json +2306 -0
- package/contracts/Comptroller.sol +10 -1
- package/contracts/Pool/PoolRegistry.sol +2 -0
- package/dist/deploy/001-deploy-mock-tokens.d.ts +3 -0
- package/dist/deploy/001-deploy-mock-tokens.js +23 -0
- package/dist/deploy/002-price-oracle.d.ts +2 -0
- package/dist/deploy/002-price-oracle.js +9 -0
- package/dist/deploy/003-price-oracle-configure-feeds.d.ts +2 -0
- package/dist/deploy/003-price-oracle-configure-feeds.js +9 -0
- package/{deploy/004-swap-router.ts → dist/deploy/004-swap-router.d.ts} +0 -3
- package/dist/deploy/004-swap-router.js +8 -0
- package/dist/deploy/005-access-control.d.ts +3 -0
- package/dist/deploy/005-access-control.js +16 -0
- package/dist/deploy/006-deploy-factories.d.ts +3 -0
- package/dist/deploy/006-deploy-factories.js +68 -0
- package/dist/deploy/007-access-control-configure.d.ts +3 -0
- package/dist/deploy/007-access-control-configure.js +73 -0
- package/dist/deploy/008-deploy-pool-lens.d.ts +3 -0
- package/dist/deploy/008-deploy-pool-lens.js +15 -0
- package/dist/deploy/009-deploy-pools.d.ts +3 -0
- package/dist/deploy/009-deploy-pools.js +125 -0
- package/dist/deploy/010-rewards.d.ts +3 -0
- package/dist/deploy/010-rewards.js +76 -0
- package/dist/deploy/011-transfer-pools-ownership.d.ts +3 -0
- package/dist/deploy/011-transfer-pools-ownership.js +75 -0
- package/dist/deploy/012-riskfund-protocolshare.d.ts +3 -0
- package/dist/deploy/012-riskfund-protocolshare.js +139 -0
- package/dist/deploy/013-transfer-funds-ownership.d.ts +3 -0
- package/dist/deploy/013-transfer-funds-ownership.js +46 -0
- package/dist/hardhat.config.d.ts +14 -0
- package/dist/hardhat.config.js +237 -0
- package/dist/helpers/deploymentConfig.d.ts +59 -0
- package/dist/helpers/deploymentConfig.js +836 -0
- package/dist/helpers/utils.d.ts +3 -0
- package/dist/helpers/utils.js +28 -0
- package/package.json +2 -10
- package/deploy/001-deploy-mock-tokens.ts +0 -29
- package/deploy/002-price-oracle.ts +0 -7
- package/deploy/003-price-oracle-configure-feeds.ts +0 -7
- package/deploy/005-access-control.ts +0 -20
- package/deploy/006-deploy-factories.ts +0 -82
- package/deploy/007-access-control-configure.ts +0 -142
- package/deploy/008-deploy-pool-lens.ts +0 -19
- package/deploy/009-deploy-pools.ts +0 -171
- package/deploy/010-rewards.ts +0 -84
- package/deploy/011-transfer-pools-ownership.ts +0 -93
- package/deploy/012-riskfund-protocolshare.ts +0 -140
- package/deploy/013-transfer-funds-ownership.ts +0 -63
- package/helpers/deploymentConfig.ts +0 -897
- package/helpers/utils.ts +0 -24
|
@@ -92,6 +92,9 @@ contract Comptroller is
|
|
|
92
92
|
/// @notice Thrown when a market has an unexpected comptroller
|
|
93
93
|
error ComptrollerMismatch();
|
|
94
94
|
|
|
95
|
+
/// @notice Thrown when user is not member of market
|
|
96
|
+
error MarketNotCollateral(address vToken, address user);
|
|
97
|
+
|
|
95
98
|
/**
|
|
96
99
|
* @notice Thrown during the liquidation if user's total collateral amount is lower than
|
|
97
100
|
* a predefined threshold. In this case only batch liquidations (either liquidateAccount
|
|
@@ -503,7 +506,9 @@ contract Comptroller is
|
|
|
503
506
|
// Action.LIQUIDATE on it
|
|
504
507
|
_checkActionPauseState(vTokenCollateral, Action.SEIZE);
|
|
505
508
|
|
|
506
|
-
|
|
509
|
+
Market storage market = markets[vTokenCollateral];
|
|
510
|
+
|
|
511
|
+
if (!market.isListed) {
|
|
507
512
|
revert MarketNotListed(vTokenCollateral);
|
|
508
513
|
}
|
|
509
514
|
|
|
@@ -524,6 +529,10 @@ contract Comptroller is
|
|
|
524
529
|
}
|
|
525
530
|
}
|
|
526
531
|
|
|
532
|
+
if (!market.accountMembership[borrower]) {
|
|
533
|
+
revert MarketNotCollateral(vTokenCollateral, borrower);
|
|
534
|
+
}
|
|
535
|
+
|
|
527
536
|
// Keep the flywheel moving
|
|
528
537
|
uint256 rewardDistributorsCount = rewardsDistributors.length;
|
|
529
538
|
|
|
@@ -276,6 +276,8 @@ contract PoolRegistry is Ownable2StepUpgradeable, AccessControlledV8, PoolRegist
|
|
|
276
276
|
"PoolRegistry: Market already added for asset comptroller combination"
|
|
277
277
|
);
|
|
278
278
|
|
|
279
|
+
require(input.initialSupply > 0, "PoolRegistry: initialSupply is zero");
|
|
280
|
+
|
|
279
281
|
InterestRateModel rate;
|
|
280
282
|
if (input.rateModel == InterestRateModels.JumpRate) {
|
|
281
283
|
rate = InterestRateModel(
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const deploymentConfig_1 = require("../helpers/deploymentConfig");
|
|
4
|
+
const func = async function (hre) {
|
|
5
|
+
const { deployments, getNamedAccounts } = hre;
|
|
6
|
+
const { deploy } = deployments;
|
|
7
|
+
const { deployer } = await getNamedAccounts();
|
|
8
|
+
const { tokensConfig } = await (0, deploymentConfig_1.getConfig)(hre.network.name);
|
|
9
|
+
for (const token of tokensConfig) {
|
|
10
|
+
if (token.isMock) {
|
|
11
|
+
const contractName = `Mock${token.symbol}`;
|
|
12
|
+
await deploy(contractName, {
|
|
13
|
+
from: deployer,
|
|
14
|
+
contract: "MockToken",
|
|
15
|
+
args: [token.name, token.symbol, token.decimals],
|
|
16
|
+
log: true,
|
|
17
|
+
autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
func.tags = ["MockTokens"];
|
|
23
|
+
exports.default = func;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const _1_deploy_oracles_1 = __importDefault(require("@venusprotocol/oracle/dist/deploy/1-deploy-oracles"));
|
|
7
|
+
_1_deploy_oracles_1.default.tags = ["OracleDeploy"];
|
|
8
|
+
_1_deploy_oracles_1.default.skip = async (hre) => hre.network.live;
|
|
9
|
+
exports.default = _1_deploy_oracles_1.default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const _2_configure_feeds_1 = __importDefault(require("@venusprotocol/oracle/dist/deploy/2-configure-feeds"));
|
|
7
|
+
_2_configure_feeds_1.default.tags = ["Oracle"];
|
|
8
|
+
_2_configure_feeds_1.default.skip = async (hre) => hre.network.live;
|
|
9
|
+
exports.default = _2_configure_feeds_1.default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const _005_deploy_swaprouter_1 = __importDefault(require("@venusprotocol/venus-protocol/deploy/005-deploy-swaprouter"));
|
|
7
|
+
_005_deploy_swaprouter_1.default.tags = ["SwapRouter", "il"];
|
|
8
|
+
exports.default = _005_deploy_swaprouter_1.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const func = async function (hre) {
|
|
4
|
+
const { deployments, getNamedAccounts } = hre;
|
|
5
|
+
const { deploy } = deployments;
|
|
6
|
+
const { deployer } = await getNamedAccounts();
|
|
7
|
+
await deploy("AccessControlManager", {
|
|
8
|
+
from: deployer,
|
|
9
|
+
args: [],
|
|
10
|
+
log: true,
|
|
11
|
+
autoMine: true,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
func.tags = ["AccessControl", "il"];
|
|
15
|
+
func.skip = async (hre) => hre.network.live;
|
|
16
|
+
exports.default = func;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const ADDRESS_ONE = "0x0000000000000000000000000000000000000001";
|
|
5
|
+
const treasuryAddresses = {
|
|
6
|
+
hardhat: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
7
|
+
bsctestnet: "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C",
|
|
8
|
+
bscmainnet: "0xF322942f644A996A617BD29c16bd7d231d9F35E9", // Venus Treasury
|
|
9
|
+
};
|
|
10
|
+
const acmAddresses = {
|
|
11
|
+
bsctestnet: "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA",
|
|
12
|
+
bscmainnet: "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555",
|
|
13
|
+
};
|
|
14
|
+
const func = async function (hre) {
|
|
15
|
+
const { deployments, getNamedAccounts } = hre;
|
|
16
|
+
const { deploy } = deployments;
|
|
17
|
+
const { deployer } = await getNamedAccounts();
|
|
18
|
+
let accessControlManager;
|
|
19
|
+
if (hre.network.live) {
|
|
20
|
+
const networkName = hre.network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
|
|
21
|
+
accessControlManager = await hardhat_1.ethers.getContractAt("AccessControlManager", acmAddresses[networkName]);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
accessControlManager = await hardhat_1.ethers.getContract("AccessControlManager");
|
|
25
|
+
}
|
|
26
|
+
const vBep20Factory = await deploy("VTokenProxyFactory", {
|
|
27
|
+
from: deployer,
|
|
28
|
+
args: [],
|
|
29
|
+
log: true,
|
|
30
|
+
autoMine: true, // speed up deployment on local network (ganache, hardhat), no effect on live networks
|
|
31
|
+
});
|
|
32
|
+
const jumpRateModelFactory = await deploy("JumpRateModelFactory", {
|
|
33
|
+
from: deployer,
|
|
34
|
+
args: [],
|
|
35
|
+
log: true,
|
|
36
|
+
autoMine: true,
|
|
37
|
+
});
|
|
38
|
+
const whitePaperRateFactory = await deploy("WhitePaperInterestRateModelFactory", {
|
|
39
|
+
from: deployer,
|
|
40
|
+
args: [],
|
|
41
|
+
log: true,
|
|
42
|
+
autoMine: true,
|
|
43
|
+
});
|
|
44
|
+
await deploy("PoolRegistry", {
|
|
45
|
+
from: deployer,
|
|
46
|
+
contract: "PoolRegistry",
|
|
47
|
+
proxy: {
|
|
48
|
+
owner: deployer,
|
|
49
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
50
|
+
execute: {
|
|
51
|
+
methodName: "initialize",
|
|
52
|
+
args: [
|
|
53
|
+
vBep20Factory.address,
|
|
54
|
+
jumpRateModelFactory.address,
|
|
55
|
+
whitePaperRateFactory.address,
|
|
56
|
+
ADDRESS_ONE,
|
|
57
|
+
treasuryAddresses[hre.network.name],
|
|
58
|
+
accessControlManager.address,
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
upgradeIndex: 0,
|
|
62
|
+
},
|
|
63
|
+
autoMine: true,
|
|
64
|
+
log: true,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
func.tags = ["Factories", "il"];
|
|
68
|
+
exports.default = func;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const ADDRESSES = {
|
|
5
|
+
bsctestnet: "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA",
|
|
6
|
+
bscmainnet: "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555",
|
|
7
|
+
};
|
|
8
|
+
const func = async function (hre) {
|
|
9
|
+
const { deployments, getNamedAccounts } = hre;
|
|
10
|
+
const { deploy } = deployments;
|
|
11
|
+
const { deployer } = await getNamedAccounts();
|
|
12
|
+
const poolRegistry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
13
|
+
const vBep20Factory = await hardhat_1.ethers.getContract("VTokenProxyFactory");
|
|
14
|
+
let accessControlManager;
|
|
15
|
+
if (hre.network.live) {
|
|
16
|
+
const networkName = hre.network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
|
|
17
|
+
accessControlManager = await hardhat_1.ethers.getContractAt("AccessControlManager", ADDRESSES[networkName]);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
await deploy("AccessControlManager", {
|
|
21
|
+
from: deployer,
|
|
22
|
+
args: [],
|
|
23
|
+
log: true,
|
|
24
|
+
autoMine: true,
|
|
25
|
+
});
|
|
26
|
+
accessControlManager = await hardhat_1.ethers.getContract("AccessControlManager");
|
|
27
|
+
}
|
|
28
|
+
console.log("==================================================");
|
|
29
|
+
console.log("Access Control Initial Configuration: ");
|
|
30
|
+
console.log("==================================================");
|
|
31
|
+
console.log(" Role | Contract | Function Sig");
|
|
32
|
+
console.log("--------------------------------------------------");
|
|
33
|
+
let tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setCollateralFactor(address,uint256,uint256)", poolRegistry.address);
|
|
34
|
+
await tx.wait();
|
|
35
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setCollateralFactor(address,uint256,uint256)");
|
|
36
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setMarketSupplyCaps(address[],uint256[])", poolRegistry.address);
|
|
37
|
+
await tx.wait();
|
|
38
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setMarketSupplyCaps(address[],uint256[])");
|
|
39
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setMarketBorrowCaps(address[],uint256[])", poolRegistry.address);
|
|
40
|
+
await tx.wait();
|
|
41
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setMarketBorrowCaps(address[],uint256[])");
|
|
42
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setLiquidationIncentive(uint256)", poolRegistry.address);
|
|
43
|
+
await tx.wait();
|
|
44
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setLiquidationIncentive(uint256)");
|
|
45
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setCloseFactor(uint256)", poolRegistry.address);
|
|
46
|
+
await tx.wait();
|
|
47
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setCloseFactor(uint256)");
|
|
48
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setMinLiquidatableCollateral(uint256)", poolRegistry.address);
|
|
49
|
+
await tx.wait();
|
|
50
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | setMinLiquidatableCollateral(uint256)");
|
|
51
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "supportMarket(address)", poolRegistry.address);
|
|
52
|
+
await tx.wait();
|
|
53
|
+
console.log("DEFAULT_ADMIN | PoolRegistry | supportMarket(address)");
|
|
54
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setInterestRateModel(address)", vBep20Factory.address);
|
|
55
|
+
await tx.wait();
|
|
56
|
+
console.log("DEFAULT_ADMIN | VTokenProxyFactory | setInterestRateModel(address)");
|
|
57
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "swapPoolsAssets(address[],uint256[],address[][])", deployer);
|
|
58
|
+
await tx.wait();
|
|
59
|
+
console.log("DEFAULT_ADMIN | Deployer | swapPoolsAssets(address[],uint256[])");
|
|
60
|
+
tx = await accessControlManager.giveCallPermission(poolRegistry.address, "createRegistryPool(string,address,uint256,uint256,uint256,address,uint256,address)", deployer);
|
|
61
|
+
await tx.wait();
|
|
62
|
+
console.log("PoolRegistry | Deployer | createRegistryPool(string,address,uint256,uint256,uint256,address,uint256,address)");
|
|
63
|
+
tx = await accessControlManager.giveCallPermission(poolRegistry.address, "addMarket(AddMarketInput)", deployer);
|
|
64
|
+
await tx.wait();
|
|
65
|
+
console.log("PoolRegistry | Deployer | addMarket(AddMarketInput)");
|
|
66
|
+
tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "setRewardTokenSpeeds(address[],uint256[],uint256[])", deployer);
|
|
67
|
+
await tx.wait();
|
|
68
|
+
console.log("DEFAULT_ADMIN | Deployer | setRewardTokenSpeeds(address[],uint256[],uint256[])");
|
|
69
|
+
console.log("--------------------------------------------------");
|
|
70
|
+
console.log("Access Control setup ended successfully");
|
|
71
|
+
};
|
|
72
|
+
func.tags = ["AccessControlConfig", "il"];
|
|
73
|
+
exports.default = func;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const func = async function (hre) {
|
|
4
|
+
const { deployments, getNamedAccounts } = hre;
|
|
5
|
+
const { deploy } = deployments;
|
|
6
|
+
const { deployer } = await getNamedAccounts();
|
|
7
|
+
await deploy("PoolLens", {
|
|
8
|
+
from: deployer,
|
|
9
|
+
args: [],
|
|
10
|
+
log: true,
|
|
11
|
+
autoMine: true,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
func.tags = ["PoolLens", "il"];
|
|
15
|
+
exports.default = func;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const deploymentConfig_1 = require("../helpers/deploymentConfig");
|
|
5
|
+
const treasuryAddresses = {
|
|
6
|
+
bsctestnet: "0xFEA1c651A47FE29dB9b1bf3cC1f224d8D9CFF68C",
|
|
7
|
+
bscmainnet: "0xF322942f644A996A617BD29c16bd7d231d9F35E9", // Venus Treasury
|
|
8
|
+
};
|
|
9
|
+
const acmAddresses = {
|
|
10
|
+
bsctestnet: "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA",
|
|
11
|
+
bscmainnet: "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555",
|
|
12
|
+
};
|
|
13
|
+
const func = async function (hre) {
|
|
14
|
+
const { deployments, getNamedAccounts } = hre;
|
|
15
|
+
const { deploy } = deployments;
|
|
16
|
+
const { deployer } = await getNamedAccounts();
|
|
17
|
+
let tx;
|
|
18
|
+
const priceOracle = await hardhat_1.ethers.getContract("ResilientOracle");
|
|
19
|
+
const poolRegistry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
20
|
+
let accessControlManager;
|
|
21
|
+
if (hre.network.live) {
|
|
22
|
+
const networkName = hre.network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
|
|
23
|
+
accessControlManager = await hardhat_1.ethers.getContractAt("AccessControlManager", acmAddresses[networkName]);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
accessControlManager = await hardhat_1.ethers.getContract("AccessControlManager");
|
|
27
|
+
}
|
|
28
|
+
const maxLoopsLimit = 150;
|
|
29
|
+
// Comptroller Beacon
|
|
30
|
+
const comptrollerImpl = await deploy("ComptrollerImpl", {
|
|
31
|
+
contract: "Comptroller",
|
|
32
|
+
from: deployer,
|
|
33
|
+
args: [poolRegistry.address],
|
|
34
|
+
log: true,
|
|
35
|
+
autoMine: true,
|
|
36
|
+
});
|
|
37
|
+
const ComptrollerBeacon = await deploy("ComptrollerBeacon", {
|
|
38
|
+
contract: "Beacon",
|
|
39
|
+
from: deployer,
|
|
40
|
+
args: [comptrollerImpl.address],
|
|
41
|
+
log: true,
|
|
42
|
+
autoMine: true,
|
|
43
|
+
});
|
|
44
|
+
// VToken Beacon
|
|
45
|
+
const vTokenImpl = await deploy("VtokenImpl", {
|
|
46
|
+
contract: "VToken",
|
|
47
|
+
from: deployer,
|
|
48
|
+
args: [],
|
|
49
|
+
log: true,
|
|
50
|
+
autoMine: true,
|
|
51
|
+
});
|
|
52
|
+
const vTokenBeacon = await deploy("VTokenBeacon", {
|
|
53
|
+
contract: "Beacon",
|
|
54
|
+
from: deployer,
|
|
55
|
+
args: [vTokenImpl.address],
|
|
56
|
+
log: true,
|
|
57
|
+
autoMine: true,
|
|
58
|
+
});
|
|
59
|
+
const { tokensConfig, poolConfig } = await (0, deploymentConfig_1.getConfig)(hre.network.name);
|
|
60
|
+
let pools = await poolRegistry.callStatic.getAllPools();
|
|
61
|
+
for (let i = 0; i < poolConfig.length; i++) {
|
|
62
|
+
const pool = poolConfig[i];
|
|
63
|
+
let comptrollerProxy;
|
|
64
|
+
if (i >= pools.length) {
|
|
65
|
+
// Create pool
|
|
66
|
+
console.log("Registering new pool with name " + pool.name);
|
|
67
|
+
tx = await poolRegistry.createRegistryPool(pool.name, ComptrollerBeacon.address, pool.closeFactor, pool.liquidationIncentive, pool.minLiquidatableCollateral, priceOracle.address, maxLoopsLimit, accessControlManager.address);
|
|
68
|
+
await tx.wait();
|
|
69
|
+
console.log("New Pool Registered");
|
|
70
|
+
pools = await poolRegistry.callStatic.getAllPools();
|
|
71
|
+
comptrollerProxy = await hardhat_1.ethers.getContractAt("Comptroller", pools[i].comptroller);
|
|
72
|
+
tx = await comptrollerProxy.acceptOwnership();
|
|
73
|
+
await tx.wait();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
comptrollerProxy = await hardhat_1.ethers.getContractAt("Comptroller", pools[i].comptroller);
|
|
77
|
+
}
|
|
78
|
+
// Add Markets
|
|
79
|
+
for (const vtoken of pool.vtokens) {
|
|
80
|
+
const { name, asset, symbol, rateModel, baseRatePerYear, multiplierPerYear, jumpMultiplierPerYear, kink_, collateralFactor, liquidationThreshold, reserveFactor, initialSupply, supplyCap, borrowCap, } = vtoken;
|
|
81
|
+
const token = (0, deploymentConfig_1.getTokenConfig)(asset, tokensConfig);
|
|
82
|
+
let tokenContract;
|
|
83
|
+
if (token.isMock) {
|
|
84
|
+
tokenContract = await hardhat_1.ethers.getContract(`Mock${token.symbol}`);
|
|
85
|
+
console.log("Minting " + initialSupply + " mock tokens to owner");
|
|
86
|
+
tx = await tokenContract.faucet(initialSupply);
|
|
87
|
+
await tx.wait(1);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
tokenContract = await hardhat_1.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/ERC20.sol:ERC20", token.tokenAddress);
|
|
91
|
+
// Make sure that deployer has at least `initialSupply` balance of the token
|
|
92
|
+
}
|
|
93
|
+
console.log("Approving PoolRegistry for: " + initialSupply);
|
|
94
|
+
tx = await tokenContract.approve(poolRegistry.address, initialSupply);
|
|
95
|
+
await tx.wait(1);
|
|
96
|
+
console.log("Adding market " + name + " to pool " + pool.name);
|
|
97
|
+
tx = await poolRegistry.addMarket({
|
|
98
|
+
comptroller: comptrollerProxy.address,
|
|
99
|
+
asset: tokenContract.address,
|
|
100
|
+
decimals: 8,
|
|
101
|
+
name: name,
|
|
102
|
+
symbol: symbol,
|
|
103
|
+
rateModel: rateModel,
|
|
104
|
+
baseRatePerYear: baseRatePerYear,
|
|
105
|
+
multiplierPerYear: multiplierPerYear,
|
|
106
|
+
jumpMultiplierPerYear: jumpMultiplierPerYear,
|
|
107
|
+
kink_: kink_,
|
|
108
|
+
collateralFactor: collateralFactor,
|
|
109
|
+
liquidationThreshold: liquidationThreshold,
|
|
110
|
+
reserveFactor: reserveFactor,
|
|
111
|
+
accessControlManager: accessControlManager.address,
|
|
112
|
+
beaconAddress: vTokenBeacon.address,
|
|
113
|
+
initialSupply: initialSupply,
|
|
114
|
+
vTokenReceiver: hre.network.name === "hardhat" ? deployer : treasuryAddresses[hre.network.name],
|
|
115
|
+
supplyCap: supplyCap,
|
|
116
|
+
borrowCap: borrowCap,
|
|
117
|
+
});
|
|
118
|
+
await tx.wait();
|
|
119
|
+
console.log(`Market ${name} added to pool ${pool.name}`);
|
|
120
|
+
console.log(`-----------------------------------------`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
func.tags = ["Pools", "il"];
|
|
125
|
+
exports.default = func;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const deploymentConfig_1 = require("../helpers/deploymentConfig");
|
|
5
|
+
const acmAddresses = {
|
|
6
|
+
bsctestnet: "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA",
|
|
7
|
+
bscmainnet: "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555",
|
|
8
|
+
};
|
|
9
|
+
const func = async function (hre) {
|
|
10
|
+
const { deployments, getNamedAccounts } = hre;
|
|
11
|
+
const { deploy } = deployments;
|
|
12
|
+
const { deployer } = await getNamedAccounts();
|
|
13
|
+
const maxLoopsLimit = 150;
|
|
14
|
+
const poolRegistry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
15
|
+
let accessControl;
|
|
16
|
+
if (hre.network.live) {
|
|
17
|
+
const networkName = hre.network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
|
|
18
|
+
accessControl = await hardhat_1.ethers.getContractAt("AccessControlManager", acmAddresses[networkName]);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
accessControl = await hardhat_1.ethers.getContract("AccessControlManager");
|
|
22
|
+
}
|
|
23
|
+
const { tokensConfig, poolConfig } = await (0, deploymentConfig_1.getConfig)(hre.network.name);
|
|
24
|
+
const pools = await poolRegistry.callStatic.getAllPools();
|
|
25
|
+
for (let i = 0; i < poolConfig.length; i++) {
|
|
26
|
+
const rewards = poolConfig[i].rewards;
|
|
27
|
+
if (!rewards)
|
|
28
|
+
continue;
|
|
29
|
+
for (const reward of rewards) {
|
|
30
|
+
const comptrollerAddress = pools[i].comptroller;
|
|
31
|
+
// Get reward token address
|
|
32
|
+
const tokenConfig = (0, deploymentConfig_1.getTokenConfig)(reward.asset, tokensConfig);
|
|
33
|
+
const rewardTokenAddress = await (0, deploymentConfig_1.getTokenAddress)(tokenConfig, deployments);
|
|
34
|
+
// Custom contract name so we can obtain the proxy after that easily
|
|
35
|
+
const contractName = "Rewards" + reward.asset + poolConfig[i].name;
|
|
36
|
+
await deploy(contractName, {
|
|
37
|
+
from: deployer,
|
|
38
|
+
contract: "RewardsDistributor",
|
|
39
|
+
proxy: {
|
|
40
|
+
owner: deployer,
|
|
41
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
42
|
+
execute: {
|
|
43
|
+
methodName: "initialize",
|
|
44
|
+
args: [comptrollerAddress, rewardTokenAddress, maxLoopsLimit, accessControl.address],
|
|
45
|
+
},
|
|
46
|
+
upgradeIndex: 0,
|
|
47
|
+
},
|
|
48
|
+
autoMine: true,
|
|
49
|
+
log: true,
|
|
50
|
+
});
|
|
51
|
+
const rewardsDistributor = await hardhat_1.ethers.getContract(contractName);
|
|
52
|
+
const vTokens = [];
|
|
53
|
+
for (const marketUnderlying of reward.markets) {
|
|
54
|
+
const assetConfig = (0, deploymentConfig_1.getTokenConfig)(marketUnderlying, tokensConfig);
|
|
55
|
+
const tokenAddress = await (0, deploymentConfig_1.getTokenAddress)(assetConfig, deployments);
|
|
56
|
+
const marketAddress = await poolRegistry.getVTokenForAsset(comptrollerAddress, tokenAddress);
|
|
57
|
+
vTokens.push(marketAddress);
|
|
58
|
+
}
|
|
59
|
+
let tx = await rewardsDistributor.setRewardTokenSpeeds(vTokens, reward.supplySpeeds, reward.borrowSpeeds);
|
|
60
|
+
await tx.wait(1);
|
|
61
|
+
const comptrollerProxy = await hardhat_1.ethers.getContractAt("Comptroller", pools[i].comptroller);
|
|
62
|
+
try {
|
|
63
|
+
console.log("Adding reward distributor to comptroller " + comptrollerAddress);
|
|
64
|
+
tx = await comptrollerProxy.addRewardsDistributor(rewardsDistributor.address);
|
|
65
|
+
await tx.wait(1);
|
|
66
|
+
console.log("Added rewards distributor sucessfully");
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
console.log("Rewards distributor already added.");
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
func.tags = ["Rewards", "il"];
|
|
76
|
+
exports.default = func;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const targetOwners = {
|
|
5
|
+
hardhat: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
|
|
6
|
+
bsctestnet: "0xFA747c4a62c4D168276329F822d004026A1c05E9",
|
|
7
|
+
mainnet: "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396", // NORMAL VIP Timelock
|
|
8
|
+
};
|
|
9
|
+
const contracts = {
|
|
10
|
+
singleStepOwnership: ["ComptrollerBeacon", "VTokenBeacon", "DefaultProxyAdmin"],
|
|
11
|
+
twoStepOwnership: [
|
|
12
|
+
"PoolRegistry",
|
|
13
|
+
"RewardsBNXPool 1",
|
|
14
|
+
"RewardsXVSPool 1",
|
|
15
|
+
"RewardsANKRPool 2",
|
|
16
|
+
"RewardsXVSPool 2",
|
|
17
|
+
"RewardsMBOXPool 2",
|
|
18
|
+
"RewardsNFTPool 2",
|
|
19
|
+
"RewardsRACAPool 2",
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
const func = async function (hre) {
|
|
23
|
+
await transferSingleStepOwnerships(contracts.singleStepOwnership, hre.network.name);
|
|
24
|
+
await transfer2StepOwnerships(contracts.twoStepOwnership, hre.network.name);
|
|
25
|
+
// Transfer ownership to the already added pools
|
|
26
|
+
const poolRegistry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
27
|
+
const pools = await poolRegistry.callStatic.getAllPools();
|
|
28
|
+
for (const pool of pools) {
|
|
29
|
+
const comptrollerProxy = await hardhat_1.ethers.getContractAt("Comptroller", pool.comptroller);
|
|
30
|
+
const owner = await comptrollerProxy.owner();
|
|
31
|
+
if (owner !== targetOwners[hre.network.name]) {
|
|
32
|
+
const tx = await comptrollerProxy.transferOwnership(targetOwners[hre.network.name]);
|
|
33
|
+
await tx.wait(1);
|
|
34
|
+
const pendingOwner = await comptrollerProxy.pendingOwner();
|
|
35
|
+
console.log(`Comptroller ${comptrollerProxy.address} owner ${owner} sucessfully changed to ${pendingOwner}. Please accept the ownership.`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.error(`Comptroller ${comptrollerProxy} owner ${owner} is equal to target ownership address ${targetOwners[hre.network.name]}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const transfer2StepOwnerships = async (contractNames, networkName) => {
|
|
43
|
+
for (const contractName of contractNames) {
|
|
44
|
+
const contract = await hardhat_1.ethers.getContract(contractName);
|
|
45
|
+
const owner = await contract.owner();
|
|
46
|
+
let tx;
|
|
47
|
+
if (owner !== targetOwners[networkName]) {
|
|
48
|
+
tx = await contract.transferOwnership(targetOwners[networkName]);
|
|
49
|
+
await tx.wait(1);
|
|
50
|
+
const pendingOwner = await contract.pendingOwner();
|
|
51
|
+
console.log(`${contractName} owner ${owner} sucessfully changed to ${pendingOwner}. Please accept the ownership.`);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.error(`${contractName} owner ${owner} is equal to target ownership address ${targetOwners[networkName]}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const transferSingleStepOwnerships = async (contractNames, networkName) => {
|
|
59
|
+
for (const contractName of contractNames) {
|
|
60
|
+
const contract = await hardhat_1.ethers.getContract(contractName);
|
|
61
|
+
const owner = await contract.owner();
|
|
62
|
+
let tx;
|
|
63
|
+
if (owner !== targetOwners[networkName]) {
|
|
64
|
+
tx = await contract.transferOwnership(targetOwners[networkName]);
|
|
65
|
+
await tx.wait(1);
|
|
66
|
+
const newOwner = await contract.owner();
|
|
67
|
+
console.log(`${contractName} owner ${owner} sucessfully changed to ${newOwner}.`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
console.error(`${contractName} owner ${owner} is equal to target ownership address ${targetOwners[networkName]}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
func.tags = ["TransferPoolsOwnership"];
|
|
75
|
+
exports.default = func;
|