mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Deployment function optimizations WIP
This commit is contained in:
parent
88a2cb21f4
commit
03504849f1
|
@ -97,7 +97,7 @@
|
||||||
},
|
},
|
||||||
"PriceOracle": {
|
"PriceOracle": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x1750499D05Ed1674d822430FB960d5F6731fDf64",
|
"address": "0x0C6c3C47A1f650809B0D1048FDf9603e09473D7E",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
},
|
},
|
||||||
"MockAggregator": {
|
"MockAggregator": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xEC1C93A9f6a9e18E97784c76aC52053587FcDB89",
|
"address": "0xc11f8E173ee67ffA7BBdD185D2399994AAd23Ec6",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
},
|
},
|
||||||
"ChainlinkProxyPriceProvider": {
|
"ChainlinkProxyPriceProvider": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x7B6C3e5486D9e6959441ab554A889099eed76290",
|
"address": "0xD662fb7FDC7526C79AA4417d2A4415416e057ec4",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
},
|
},
|
||||||
"LendingRateOracle": {
|
"LendingRateOracle": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xD83D2773a7873ae2b5f8Fb92097e20a8C64F691E",
|
"address": "0xEC1C93A9f6a9e18E97784c76aC52053587FcDB89",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
},
|
},
|
||||||
"DefaultReserveInterestRateStrategy": {
|
"DefaultReserveInterestRateStrategy": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xB660Fdd109a95718cB9d20E3A89EE6cE342aDcB6",
|
"address": "0x7d40dD74d3aE1a7e4A7dd08eaE899e85940563cd",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -220,7 +220,7 @@
|
||||||
},
|
},
|
||||||
"MockFlashLoanReceiver": {
|
"MockFlashLoanReceiver": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
"address": "0x63387deC8C4a0F17Cf0C27Ea3476F03F6a45d3AE"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
"address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA"
|
"address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA"
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
},
|
},
|
||||||
"WalletBalanceProvider": {
|
"WalletBalanceProvider": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4",
|
"address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -567,7 +567,7 @@
|
||||||
},
|
},
|
||||||
"AaveProtocolTestHelpers": {
|
"AaveProtocolTestHelpers": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xe7536f450378748E1BD4645D3c77ec38e0F3ba28"
|
"address": "0x93472C0e03215F9c33DA240Eb16703C8244eAa8c"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
"address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4"
|
"address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4"
|
||||||
|
@ -578,7 +578,7 @@
|
||||||
},
|
},
|
||||||
"StableDebtToken": {
|
"StableDebtToken": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x830bceA96E56DBC1F8578f75fBaC0AF16B32A07d",
|
"address": "0x5f687ea375c359E0CF6aa8A1004BE0c3BaBee7Fd",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -592,7 +592,7 @@
|
||||||
},
|
},
|
||||||
"VariableDebtToken": {
|
"VariableDebtToken": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xA0AB1cB92A4AF81f84dCd258155B5c25D247b54E",
|
"address": "0x626FdE749F9d499d3777320CAf29484B624ab84a",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -610,7 +610,7 @@
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x5f7134cd38C826a7649f9Cc47dda24d834DD2967",
|
"address": "0xB660Fdd109a95718cB9d20E3A89EE6cE342aDcB6",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"coverage": {
|
"coverage": {
|
||||||
|
@ -620,7 +620,7 @@
|
||||||
},
|
},
|
||||||
"MockAToken": {
|
"MockAToken": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x392E5355a0e88Bd394F717227c752670fb3a8020",
|
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -648,7 +648,7 @@
|
||||||
},
|
},
|
||||||
"MockStableDebtToken": {
|
"MockStableDebtToken": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460",
|
"address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -662,7 +662,7 @@
|
||||||
},
|
},
|
||||||
"MockVariableDebtToken": {
|
"MockVariableDebtToken": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xEBAB67ee3ef604D5c250A53b4b8fcbBC6ec3007C",
|
"address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -676,7 +676,7 @@
|
||||||
},
|
},
|
||||||
"MockSwapAdapter": {
|
"MockSwapAdapter": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10"
|
"address": "0x8280D40C9E9F04229D2435EAad6e0011309ce81B"
|
||||||
},
|
},
|
||||||
"coverage": {
|
"coverage": {
|
||||||
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
||||||
|
|
|
@ -2,6 +2,7 @@ import {
|
||||||
AaveProtocolTestHelpersFactory,
|
AaveProtocolTestHelpersFactory,
|
||||||
ATokenFactory,
|
ATokenFactory,
|
||||||
DefaultReserveInterestRateStrategyFactory,
|
DefaultReserveInterestRateStrategyFactory,
|
||||||
|
GenericLogicFactory,
|
||||||
LendingPoolAddressesProviderFactory,
|
LendingPoolAddressesProviderFactory,
|
||||||
LendingPoolAddressesProviderRegistryFactory,
|
LendingPoolAddressesProviderRegistryFactory,
|
||||||
LendingPoolConfiguratorFactory,
|
LendingPoolConfiguratorFactory,
|
||||||
|
@ -11,20 +12,23 @@ import {
|
||||||
MockFlashLoanReceiverFactory,
|
MockFlashLoanReceiverFactory,
|
||||||
MockSwapAdapterFactory,
|
MockSwapAdapterFactory,
|
||||||
PriceOracleFactory,
|
PriceOracleFactory,
|
||||||
|
ReserveLogicFactory,
|
||||||
StableDebtTokenFactory,
|
StableDebtTokenFactory,
|
||||||
VariableDebtTokenFactory,
|
VariableDebtTokenFactory,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import {Ierc20DetailedFactory} from '../types/Ierc20DetailedFactory';
|
import {Ierc20DetailedFactory} from '../types/Ierc20DetailedFactory';
|
||||||
import {MockTokenMap} from './contracts-helpers';
|
import {getContract, MockTokenMap} from './contracts-helpers';
|
||||||
import {BRE, getDb} from './misc-utils';
|
import {BRE, getDb} from './misc-utils';
|
||||||
import {eContractid, PoolConfiguration, tEthereumAddress, TokenContractId} from './types';
|
import {eContractid, PoolConfiguration, tEthereumAddress, TokenContractId} from './types';
|
||||||
|
|
||||||
|
export const getFirstSigner = async () => (await BRE.ethers.getSigners())[0];
|
||||||
|
|
||||||
export const getLendingPoolAddressesProvider = async (address?: tEthereumAddress) =>
|
export const getLendingPoolAddressesProvider = async (address?: tEthereumAddress) =>
|
||||||
await LendingPoolAddressesProviderFactory.connect(
|
await LendingPoolAddressesProviderFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.LendingPoolAddressesProvider}.${BRE.network.name}`).value())
|
(await getDb().get(`${eContractid.LendingPoolAddressesProvider}.${BRE.network.name}`).value())
|
||||||
.address,
|
.address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getLendingPoolConfiguratorProxy = async (address?: tEthereumAddress) => {
|
export const getLendingPoolConfiguratorProxy = async (address?: tEthereumAddress) => {
|
||||||
|
@ -32,7 +36,7 @@ export const getLendingPoolConfiguratorProxy = async (address?: tEthereumAddress
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.LendingPoolConfigurator}.${BRE.network.name}`).value())
|
(await getDb().get(`${eContractid.LendingPoolConfigurator}.${BRE.network.name}`).value())
|
||||||
.address,
|
.address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,48 +44,48 @@ export const getLendingPool = async (address?: tEthereumAddress) =>
|
||||||
await LendingPoolFactory.connect(
|
await LendingPoolFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.LendingPool}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.LendingPool}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getPriceOracle = async (address?: tEthereumAddress) =>
|
export const getPriceOracle = async (address?: tEthereumAddress) =>
|
||||||
await PriceOracleFactory.connect(
|
await PriceOracleFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.PriceOracle}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.PriceOracle}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getAToken = async (address?: tEthereumAddress) =>
|
export const getAToken = async (address?: tEthereumAddress) =>
|
||||||
await ATokenFactory.connect(
|
await ATokenFactory.connect(
|
||||||
address || (await getDb().get(`${eContractid.AToken}.${BRE.network.name}`).value()).address,
|
address || (await getDb().get(`${eContractid.AToken}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getStableDebtToken = async (address?: tEthereumAddress) =>
|
export const getStableDebtToken = async (address?: tEthereumAddress) =>
|
||||||
await StableDebtTokenFactory.connect(
|
await StableDebtTokenFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.StableDebtToken}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.StableDebtToken}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getVariableDebtToken = async (address?: tEthereumAddress) =>
|
export const getVariableDebtToken = async (address?: tEthereumAddress) =>
|
||||||
await VariableDebtTokenFactory.connect(
|
await VariableDebtTokenFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.VariableDebtToken}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.VariableDebtToken}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMintableErc20 = async (address: tEthereumAddress) =>
|
export const getMintableErc20 = async (address: tEthereumAddress) =>
|
||||||
await MintableErc20Factory.connect(
|
await MintableErc20Factory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.MintableERC20}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.MintableERC20}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getIErc20Detailed = async (address: tEthereumAddress) =>
|
export const getIErc20Detailed = async (address: tEthereumAddress) =>
|
||||||
await Ierc20DetailedFactory.connect(
|
await Ierc20DetailedFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.IERC20Detailed}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.IERC20Detailed}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getAaveProtocolTestHelpers = async (address?: tEthereumAddress) =>
|
export const getAaveProtocolTestHelpers = async (address?: tEthereumAddress) =>
|
||||||
|
@ -89,7 +93,7 @@ export const getAaveProtocolTestHelpers = async (address?: tEthereumAddress) =>
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.AaveProtocolTestHelpers}.${BRE.network.name}`).value())
|
(await getDb().get(`${eContractid.AaveProtocolTestHelpers}.${BRE.network.name}`).value())
|
||||||
.address,
|
.address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getInterestRateStrategy = async (address?: tEthereumAddress) =>
|
export const getInterestRateStrategy = async (address?: tEthereumAddress) =>
|
||||||
|
@ -100,7 +104,7 @@ export const getInterestRateStrategy = async (address?: tEthereumAddress) =>
|
||||||
.get(`${eContractid.DefaultReserveInterestRateStrategy}.${BRE.network.name}`)
|
.get(`${eContractid.DefaultReserveInterestRateStrategy}.${BRE.network.name}`)
|
||||||
.value()
|
.value()
|
||||||
).address,
|
).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMockFlashLoanReceiver = async (address?: tEthereumAddress) =>
|
export const getMockFlashLoanReceiver = async (address?: tEthereumAddress) =>
|
||||||
|
@ -108,21 +112,21 @@ export const getMockFlashLoanReceiver = async (address?: tEthereumAddress) =>
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.MockFlashLoanReceiver}.${BRE.network.name}`).value())
|
(await getDb().get(`${eContractid.MockFlashLoanReceiver}.${BRE.network.name}`).value())
|
||||||
.address,
|
.address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMockSwapAdapter = async (address?: tEthereumAddress) =>
|
export const getMockSwapAdapter = async (address?: tEthereumAddress) =>
|
||||||
await MockSwapAdapterFactory.connect(
|
await MockSwapAdapterFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.MockSwapAdapter}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.MockSwapAdapter}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getLendingRateOracle = async (address?: tEthereumAddress) =>
|
export const getLendingRateOracle = async (address?: tEthereumAddress) =>
|
||||||
await LendingRateOracleFactory.connect(
|
await LendingRateOracleFactory.connect(
|
||||||
address ||
|
address ||
|
||||||
(await getDb().get(`${eContractid.LendingRateOracle}.${BRE.network.name}`).value()).address,
|
(await getDb().get(`${eContractid.LendingRateOracle}.${BRE.network.name}`).value()).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getMockedTokens = async (config: PoolConfiguration) => {
|
export const getMockedTokens = async (config: PoolConfiguration) => {
|
||||||
|
@ -189,5 +193,27 @@ export const getLendingPoolAddressesProviderRegistry = async (address?: tEthereu
|
||||||
.get(`${eContractid.LendingPoolAddressesProviderRegistry}.${BRE.network.name}`)
|
.get(`${eContractid.LendingPoolAddressesProviderRegistry}.${BRE.network.name}`)
|
||||||
.value()
|
.value()
|
||||||
).address,
|
).address,
|
||||||
BRE.ethers.provider
|
await getFirstSigner()
|
||||||
|
);
|
||||||
|
|
||||||
|
export const getReserveLogicLibrary = async (address?: tEthereumAddress) =>
|
||||||
|
await ReserveLogicFactory.connect(
|
||||||
|
address ||
|
||||||
|
(
|
||||||
|
await getDb()
|
||||||
|
.get(`${eContractid.LendingPoolAddressesProviderRegistry}.${BRE.network.name}`)
|
||||||
|
.value()
|
||||||
|
).address,
|
||||||
|
await getFirstSigner()
|
||||||
|
);
|
||||||
|
|
||||||
|
export const getGenericLogic = async (address?: tEthereumAddress) =>
|
||||||
|
await GenericLogicFactory.connect(
|
||||||
|
address ||
|
||||||
|
(
|
||||||
|
await getDb()
|
||||||
|
.get(`${eContractid.LendingPoolAddressesProviderRegistry}.${BRE.network.name}`)
|
||||||
|
.value()
|
||||||
|
).address,
|
||||||
|
await getFirstSigner()
|
||||||
);
|
);
|
||||||
|
|
|
@ -15,16 +15,10 @@ import {
|
||||||
PoolConfiguration,
|
PoolConfiguration,
|
||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
import {LendingPoolAddressesProvider} from '../types/LendingPoolAddressesProvider';
|
|
||||||
import {MintableErc20 as MintableERC20} from '../types/MintableErc20';
|
import {MintableErc20 as MintableERC20} from '../types/MintableErc20';
|
||||||
import {LendingPoolAddressesProviderRegistry} from '../types/LendingPoolAddressesProviderRegistry';
|
|
||||||
import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator';
|
|
||||||
import {readArtifact} from '@nomiclabs/buidler/plugins';
|
import {readArtifact} from '@nomiclabs/buidler/plugins';
|
||||||
import {Artifact} from '@nomiclabs/buidler/types';
|
import {Artifact} from '@nomiclabs/buidler/types';
|
||||||
import {LendingPool} from '../types/LendingPool';
|
|
||||||
import {DefaultReserveInterestRateStrategy} from '../types/DefaultReserveInterestRateStrategy';
|
import {DefaultReserveInterestRateStrategy} from '../types/DefaultReserveInterestRateStrategy';
|
||||||
import {LendingPoolCollateralManager} from '../types/LendingPoolCollateralManager';
|
|
||||||
import {InitializableAdminUpgradeabilityProxy} from '../types/InitializableAdminUpgradeabilityProxy';
|
|
||||||
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
||||||
import {WalletBalanceProvider} from '../types/WalletBalanceProvider';
|
import {WalletBalanceProvider} from '../types/WalletBalanceProvider';
|
||||||
import {AToken} from '../types/AToken';
|
import {AToken} from '../types/AToken';
|
||||||
|
@ -35,7 +29,7 @@ import {VariableDebtToken} from '../types/VariableDebtToken';
|
||||||
import {MockContract} from 'ethereum-waffle';
|
import {MockContract} from 'ethereum-waffle';
|
||||||
import {getReservesConfigByPool} from './configuration';
|
import {getReservesConfigByPool} from './configuration';
|
||||||
import {verifyContract} from './etherscan-verification';
|
import {verifyContract} from './etherscan-verification';
|
||||||
|
import {getFirstSigner, getGenericLogic} from './contracts-getters';
|
||||||
const {
|
const {
|
||||||
ProtocolGlobalParams: {UsdAddress},
|
ProtocolGlobalParams: {UsdAddress},
|
||||||
} = CommonsConfig;
|
} = CommonsConfig;
|
||||||
|
@ -45,15 +39,25 @@ import {ZERO_ADDRESS} from './constants';
|
||||||
import {MockSwapAdapter} from '../types/MockSwapAdapter';
|
import {MockSwapAdapter} from '../types/MockSwapAdapter';
|
||||||
import {signTypedData_v4, TypedData} from 'eth-sig-util';
|
import {signTypedData_v4, TypedData} from 'eth-sig-util';
|
||||||
import {fromRpcSig, ECDSASignature} from 'ethereumjs-util';
|
import {fromRpcSig, ECDSASignature} from 'ethereumjs-util';
|
||||||
|
import {getIErc20Detailed} from './contracts-getters';
|
||||||
import {
|
import {
|
||||||
ChainlinkProxyPriceProviderFactory,
|
ChainlinkProxyPriceProviderFactory,
|
||||||
|
GenericLogicFactory,
|
||||||
|
InitializableAdminUpgradeabilityProxyFactory,
|
||||||
|
LendingPoolAddressesProviderFactory,
|
||||||
|
LendingPoolAddressesProviderRegistryFactory,
|
||||||
LendingPoolCollateralManagerFactory,
|
LendingPoolCollateralManagerFactory,
|
||||||
|
LendingPoolConfiguratorFactory,
|
||||||
|
LendingPoolFactory,
|
||||||
|
LendingPoolLibraryAddresses,
|
||||||
LendingRateOracleFactory,
|
LendingRateOracleFactory,
|
||||||
MockAggregatorFactory,
|
MockAggregatorFactory,
|
||||||
|
MockFlashLoanReceiverFactory,
|
||||||
|
MockSwapAdapterFactory,
|
||||||
PriceOracleFactory,
|
PriceOracleFactory,
|
||||||
|
ReserveLogicFactory,
|
||||||
|
WalletBalanceProviderFactory,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
import {getIErc20Detailed} from './contracts-getters';
|
|
||||||
|
|
||||||
export const registerContractInJsonDb = async (contractId: string, contractInstance: Contract) => {
|
export const registerContractInJsonDb = async (contractId: string, contractInstance: Contract) => {
|
||||||
const currentNetwork = BRE.network.name;
|
const currentNetwork = BRE.network.name;
|
||||||
|
@ -109,71 +113,69 @@ export const deployContract = async <ContractType extends Contract>(
|
||||||
return contract;
|
return contract;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const withSaveAndVerify = async (
|
||||||
|
instance: Contract,
|
||||||
|
id: string,
|
||||||
|
args: (string | string[])[],
|
||||||
|
verify?: boolean
|
||||||
|
) => {
|
||||||
|
await registerContractInJsonDb(id, instance);
|
||||||
|
if (verify) {
|
||||||
|
await verifyContract(id, instance.address, args);
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
};
|
||||||
|
|
||||||
export const getContract = async <ContractType extends Contract>(
|
export const getContract = async <ContractType extends Contract>(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
address: string
|
address: string
|
||||||
): Promise<ContractType> => (await BRE.ethers.getContractAt(contractName, address)) as ContractType;
|
): Promise<ContractType> => (await BRE.ethers.getContractAt(contractName, address)) as ContractType;
|
||||||
|
|
||||||
export const deployLendingPoolAddressesProvider = async (verify?: boolean) => {
|
export const deployLendingPoolAddressesProvider = async (verify?: boolean) =>
|
||||||
const instance = await deployContract<LendingPoolAddressesProvider>(
|
withSaveAndVerify(
|
||||||
|
await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.LendingPoolAddressesProvider,
|
eContractid.LendingPoolAddressesProvider,
|
||||||
[]
|
[],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.LendingPoolAddressesProvider, instance.address, []);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) => {
|
export const deployLendingPoolAddressesProviderRegistry = async (verify?: boolean) =>
|
||||||
const instance = await deployContract<LendingPoolAddressesProviderRegistry>(
|
withSaveAndVerify(
|
||||||
|
await new LendingPoolAddressesProviderRegistryFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.LendingPoolAddressesProviderRegistry,
|
eContractid.LendingPoolAddressesProviderRegistry,
|
||||||
[]
|
[],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.LendingPoolAddressesProviderRegistry, instance.address, []);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deployLendingPoolConfigurator = async (verify?: boolean) => {
|
export const deployLendingPoolConfigurator = async (verify?: boolean) =>
|
||||||
const instance = await deployContract<LendingPoolConfigurator>(
|
withSaveAndVerify(
|
||||||
|
await new LendingPoolConfiguratorFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.LendingPoolConfigurator,
|
eContractid.LendingPoolConfigurator,
|
||||||
[]
|
[],
|
||||||
);
|
verify
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.LendingPoolConfigurator, instance.address, []);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
const deployLibrary = async (libraryId: eContractid) => {
|
|
||||||
const factory = await BRE.ethers.getContractFactory(libraryId);
|
|
||||||
const library = await factory.deploy();
|
|
||||||
await library.deployed();
|
|
||||||
|
|
||||||
return library;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const linkLibrariesToArtifact = async (artifact: Artifact) => {
|
|
||||||
const reserveLogic = await deployLibrary(eContractid.ReserveLogic);
|
|
||||||
|
|
||||||
const genericLogicArtifact = await readArtifact(
|
|
||||||
BRE.config.paths.artifacts,
|
|
||||||
eContractid.GenericLogic
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const linkedGenericLogicByteCode = linkBytecode(genericLogicArtifact, {
|
export const deployReserveLogicLibrary = async (verify?: boolean) =>
|
||||||
[eContractid.ReserveLogic]: reserveLogic.address,
|
withSaveAndVerify(
|
||||||
});
|
await new ReserveLogicFactory(await getFirstSigner()).deploy(),
|
||||||
|
eContractid.ReserveLogic,
|
||||||
const genericLogicFactory = await BRE.ethers.getContractFactory(
|
[],
|
||||||
genericLogicArtifact.abi,
|
verify
|
||||||
linkedGenericLogicByteCode
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const genericLogic = await (await genericLogicFactory.deploy()).deployed();
|
export const deployGenericLogic = async (verify?: boolean) =>
|
||||||
|
withSaveAndVerify(
|
||||||
|
await new GenericLogicFactory(await getFirstSigner()).deploy(),
|
||||||
|
eContractid.GenericLogic,
|
||||||
|
[],
|
||||||
|
verify
|
||||||
|
);
|
||||||
|
|
||||||
|
export const deployValidationLogic = async (
|
||||||
|
reserveLogic: Contract,
|
||||||
|
genericLogic: Contract,
|
||||||
|
verify?: boolean
|
||||||
|
) => {
|
||||||
const validationLogicArtifact = await readArtifact(
|
const validationLogicArtifact = await readArtifact(
|
||||||
BRE.config.paths.artifacts,
|
BRE.config.paths.artifacts,
|
||||||
eContractid.ValidationLogic
|
eContractid.ValidationLogic
|
||||||
|
@ -191,141 +193,122 @@ export const linkLibrariesToArtifact = async (artifact: Artifact) => {
|
||||||
|
|
||||||
const validationLogic = await (await validationLogicFactory.deploy()).deployed();
|
const validationLogic = await (await validationLogicFactory.deploy()).deployed();
|
||||||
|
|
||||||
const linkedBytecode = linkBytecode(artifact, {
|
return withSaveAndVerify(validationLogic, eContractid.ValidationLogic, [], verify);
|
||||||
[eContractid.ReserveLogic]: reserveLogic.address,
|
};
|
||||||
[eContractid.GenericLogic]: genericLogic.address,
|
|
||||||
[eContractid.ValidationLogic]: validationLogic.address,
|
|
||||||
});
|
|
||||||
const factory = await BRE.ethers.getContractFactory(artifact.abi, linkedBytecode);
|
|
||||||
|
|
||||||
return factory;
|
export const deployAaveLibraries = async (
|
||||||
|
verify?: boolean
|
||||||
|
): Promise<LendingPoolLibraryAddresses> => {
|
||||||
|
const reserveLogic = await deployReserveLogicLibrary(verify);
|
||||||
|
const genericLogic = await deployGenericLogic(verify);
|
||||||
|
const validationLogic = await deployValidationLogic(reserveLogic, genericLogic, verify);
|
||||||
|
|
||||||
|
// Hardcoded solidity placeholders, if any library changes path this will fail.
|
||||||
|
// Placeholder can be calculated via solidity keccak, but the LendingPoolLibraryAddresses Type seems to
|
||||||
|
// require a hardcoded string.
|
||||||
|
//
|
||||||
|
// how-to: PLACEHOLDER = solidityKeccak256(['string'], `${libPath}:${libName}`).slice(2, 36)
|
||||||
|
// '__$PLACEHOLDER$__'
|
||||||
|
// or grab placeholdes from LendingPoolLibraryAddresses at Typechain generation.
|
||||||
|
return {
|
||||||
|
['__$5201a97c05ba6aa659e2f36a933dd51801$__']: reserveLogic.address,
|
||||||
|
['__$d3b4366daeb9cadc7528af6145b50b2183$__']: genericLogic.address,
|
||||||
|
['__$4c26be947d349222af871a3168b3fe584b$__']: validationLogic.address,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deployLendingPool = async (verify?: boolean) => {
|
export const deployLendingPool = async (verify?: boolean) => {
|
||||||
const lendingPoolArtifact = await readArtifact(
|
const libraries = await deployAaveLibraries(verify);
|
||||||
BRE.config.paths.artifacts,
|
return withSaveAndVerify(
|
||||||
eContractid.LendingPool
|
await new LendingPoolFactory(libraries, await getFirstSigner()).deploy(),
|
||||||
|
eContractid.LendingPool,
|
||||||
|
[],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
const factory = await linkLibrariesToArtifact(lendingPoolArtifact);
|
|
||||||
const lendingPool = await factory.deploy();
|
|
||||||
const instance = (await lendingPool.deployed()) as LendingPool;
|
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.LendingPool, instance.address, []);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deployPriceOracle = async (verify?: boolean) => {
|
export const deployPriceOracle = async (verify?: boolean) =>
|
||||||
const instance = await new PriceOracleFactory().deploy();
|
withSaveAndVerify(
|
||||||
if (verify) {
|
await new PriceOracleFactory(await getFirstSigner()).deploy(),
|
||||||
await verifyContract(eContractid.PriceOracle, instance.address, []);
|
eContractid.PriceOracle,
|
||||||
}
|
[],
|
||||||
return instance;
|
verify
|
||||||
};
|
);
|
||||||
|
|
||||||
export const deployLendingRateOracle = async (verify?: boolean) => {
|
export const deployLendingRateOracle = async (verify?: boolean) =>
|
||||||
const instance = await new LendingRateOracleFactory().deploy();
|
withSaveAndVerify(
|
||||||
if (verify) {
|
await new LendingRateOracleFactory(await getFirstSigner()).deploy(),
|
||||||
await verifyContract(eContractid.LendingRateOracle, instance.address, []);
|
eContractid.LendingRateOracle,
|
||||||
}
|
[],
|
||||||
return instance;
|
verify
|
||||||
};
|
);
|
||||||
|
|
||||||
export const deployMockAggregator = async (price: tStringTokenSmallUnits, verify?: boolean) => {
|
export const deployMockAggregator = async (price: tStringTokenSmallUnits, verify?: boolean) =>
|
||||||
const args: [tStringTokenSmallUnits] = [price];
|
withSaveAndVerify(
|
||||||
const instance = await new MockAggregatorFactory().deploy(...args);
|
await new MockAggregatorFactory(await getFirstSigner()).deploy(price),
|
||||||
if (verify) {
|
eContractid.MockAggregator,
|
||||||
await verifyContract(eContractid.MockAggregator, instance.address, args);
|
[price],
|
||||||
}
|
verify
|
||||||
return instance;
|
);
|
||||||
};
|
|
||||||
|
|
||||||
export const deployChainlinkProxyPriceProvider = async (
|
export const deployChainlinkProxyPriceProvider = async (
|
||||||
[assetsAddresses, sourcesAddresses, fallbackOracleAddress]: [
|
args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress],
|
||||||
tEthereumAddress[],
|
|
||||||
tEthereumAddress[],
|
|
||||||
tEthereumAddress
|
|
||||||
],
|
|
||||||
verify?: boolean
|
verify?: boolean
|
||||||
) => {
|
) =>
|
||||||
const args: [tEthereumAddress[], tEthereumAddress[], tEthereumAddress] = [
|
withSaveAndVerify(
|
||||||
assetsAddresses,
|
await new ChainlinkProxyPriceProviderFactory(await getFirstSigner()).deploy(...args),
|
||||||
sourcesAddresses,
|
eContractid.ChainlinkProxyPriceProvider,
|
||||||
fallbackOracleAddress,
|
args,
|
||||||
];
|
verify
|
||||||
const instance = await new ChainlinkProxyPriceProviderFactory().deploy(...args);
|
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.MockAggregator, instance.address, args);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getChainlingProxyPriceProvider = async (address?: tEthereumAddress) =>
|
|
||||||
new ChainlinkProxyPriceProviderFactory().attach(
|
|
||||||
address ||
|
|
||||||
(await getDb().get(`${eContractid.ChainlinkProxyPriceProvider}.${BRE.network.name}`).value())
|
|
||||||
.address
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export const deployLendingPoolCollateralManager = async (verify?: boolean) => {
|
export const deployLendingPoolCollateralManager = async (verify?: boolean) => {
|
||||||
const collateralManagerArtifact = await readArtifact(
|
const genericLogic = await getGenericLogic();
|
||||||
BRE.config.paths.artifacts,
|
const libraries = {
|
||||||
eContractid.LendingPoolCollateralManager
|
// See deployAaveLibraries() function
|
||||||
|
['__$d3b4366daeb9cadc7528af6145b50b2183$__']: genericLogic.address,
|
||||||
|
};
|
||||||
|
|
||||||
|
return withSaveAndVerify(
|
||||||
|
await new LendingPoolCollateralManagerFactory(libraries, await getFirstSigner()).deploy(),
|
||||||
|
eContractid.LendingPoolCollateralManager,
|
||||||
|
[],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
|
|
||||||
const factory = await linkLibrariesToArtifact(collateralManagerArtifact);
|
|
||||||
const args: string[] = [];
|
|
||||||
const collateralManager = await factory.deploy(args);
|
|
||||||
const instance = (await collateralManager.deployed()) as LendingPoolCollateralManager;
|
|
||||||
|
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.LendingPoolCollateralManager, instance.address, args);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deployInitializableAdminUpgradeabilityProxy = async (verify?: boolean) => {
|
export const deployInitializableAdminUpgradeabilityProxy = async (verify?: boolean) =>
|
||||||
const instance = await deployContract<InitializableAdminUpgradeabilityProxy>(
|
withSaveAndVerify(
|
||||||
|
await new InitializableAdminUpgradeabilityProxyFactory(await getFirstSigner()).deploy(),
|
||||||
eContractid.InitializableAdminUpgradeabilityProxy,
|
eContractid.InitializableAdminUpgradeabilityProxy,
|
||||||
[]
|
[],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.InitializableAdminUpgradeabilityProxy, instance.address, []);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deployMockFlashLoanReceiver = async (
|
export const deployMockFlashLoanReceiver = async (
|
||||||
addressesProvider: tEthereumAddress,
|
addressesProvider: tEthereumAddress,
|
||||||
verify?: boolean
|
verify?: boolean
|
||||||
) => {
|
) =>
|
||||||
const args = [addressesProvider];
|
withSaveAndVerify(
|
||||||
const instance = await deployContract<MockFlashLoanReceiver>(
|
await new MockFlashLoanReceiverFactory(await getFirstSigner()).deploy(addressesProvider),
|
||||||
eContractid.MockFlashLoanReceiver,
|
eContractid.MockFlashLoanReceiver,
|
||||||
args
|
[addressesProvider],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.MockFlashLoanReceiver, instance.address, args);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deployWalletBalancerProvider = async (
|
export const deployWalletBalancerProvider = async (
|
||||||
addressesProvider: tEthereumAddress,
|
addressesProvider: tEthereumAddress,
|
||||||
verify?: boolean
|
verify?: boolean
|
||||||
) => {
|
) =>
|
||||||
const args = [addressesProvider];
|
withSaveAndVerify(
|
||||||
const instance = await deployContract<WalletBalanceProvider>(
|
await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(addressesProvider),
|
||||||
eContractid.WalletBalanceProvider,
|
eContractid.WalletBalanceProvider,
|
||||||
args
|
[addressesProvider],
|
||||||
|
verify
|
||||||
);
|
);
|
||||||
if (verify) {
|
|
||||||
await verifyContract(eContractid.WalletBalanceProvider, instance.address, args);
|
|
||||||
}
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
export const deployMockSwapAdapter = async (addressesProvider: tEthereumAddress) =>
|
export const deployMockSwapAdapter = async (addressesProvider: tEthereumAddress) =>
|
||||||
await deployContract<MockSwapAdapter>(eContractid.MockSwapAdapter, [addressesProvider]);
|
await new MockSwapAdapterFactory(await getFirstSigner()).deploy(addressesProvider);
|
||||||
|
|
||||||
export const deployAaveProtocolTestHelpers = async (
|
export const deployAaveProtocolTestHelpers = async (
|
||||||
addressesProvider: tEthereumAddress,
|
addressesProvider: tEthereumAddress,
|
||||||
|
@ -565,121 +548,6 @@ export const deployMockTokens = async (config: PoolConfiguration, verify?: boole
|
||||||
return tokens;
|
return tokens;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initReserves = async (
|
|
||||||
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
|
||||||
tokenAddresses: {[symbol: string]: tEthereumAddress},
|
|
||||||
lendingPoolAddressesProvider: LendingPoolAddressesProvider,
|
|
||||||
lendingPool: LendingPool,
|
|
||||||
helpers: AaveProtocolTestHelpers,
|
|
||||||
lendingPoolConfigurator: LendingPoolConfigurator,
|
|
||||||
aavePool: AavePools,
|
|
||||||
incentivesController: tEthereumAddress,
|
|
||||||
verify: boolean
|
|
||||||
) => {
|
|
||||||
if (aavePool !== AavePools.proto && aavePool !== AavePools.secondary) {
|
|
||||||
console.log(`Invalid Aave pool ${aavePool}`);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let [assetSymbol, {reserveDecimals}] of Object.entries(reservesParams) as [
|
|
||||||
string,
|
|
||||||
IReserveParams
|
|
||||||
][]) {
|
|
||||||
const assetAddressIndex = Object.keys(tokenAddresses).findIndex(
|
|
||||||
(value) => value === assetSymbol
|
|
||||||
);
|
|
||||||
const [, tokenAddress] = (Object.entries(tokenAddresses) as [string, string][])[
|
|
||||||
assetAddressIndex
|
|
||||||
];
|
|
||||||
|
|
||||||
const {isActive: reserveInitialized} = await helpers.getReserveConfigurationData(tokenAddress);
|
|
||||||
|
|
||||||
if (reserveInitialized) {
|
|
||||||
console.log(`Reserve ${assetSymbol} is already active, skipping configuration`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const reserveParamIndex = Object.keys(reservesParams).findIndex(
|
|
||||||
(value) => value === assetSymbol
|
|
||||||
);
|
|
||||||
const [
|
|
||||||
,
|
|
||||||
{
|
|
||||||
baseVariableBorrowRate,
|
|
||||||
variableRateSlope1,
|
|
||||||
variableRateSlope2,
|
|
||||||
stableRateSlope1,
|
|
||||||
stableRateSlope2,
|
|
||||||
},
|
|
||||||
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
|
||||||
const rateStrategyContract = await deployDefaultReserveInterestRateStrategy(
|
|
||||||
[
|
|
||||||
lendingPoolAddressesProvider.address,
|
|
||||||
baseVariableBorrowRate,
|
|
||||||
variableRateSlope1,
|
|
||||||
variableRateSlope2,
|
|
||||||
stableRateSlope1,
|
|
||||||
stableRateSlope2,
|
|
||||||
],
|
|
||||||
verify
|
|
||||||
);
|
|
||||||
|
|
||||||
const stableDebtToken = await deployStableDebtToken(
|
|
||||||
[
|
|
||||||
`Aave stable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
`stableDebt${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
tokenAddress,
|
|
||||||
lendingPool.address,
|
|
||||||
incentivesController,
|
|
||||||
],
|
|
||||||
verify
|
|
||||||
);
|
|
||||||
|
|
||||||
const variableDebtToken = await deployVariableDebtToken(
|
|
||||||
[
|
|
||||||
`Aave variable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
`variableDebt${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
tokenAddress,
|
|
||||||
lendingPool.address,
|
|
||||||
incentivesController,
|
|
||||||
],
|
|
||||||
verify
|
|
||||||
);
|
|
||||||
|
|
||||||
const aToken = await deployGenericAToken(
|
|
||||||
[
|
|
||||||
lendingPool.address,
|
|
||||||
tokenAddress,
|
|
||||||
`Aave interest bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
`a${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
|
||||||
incentivesController,
|
|
||||||
],
|
|
||||||
verify
|
|
||||||
);
|
|
||||||
|
|
||||||
if (process.env.POOL === AavePools.secondary) {
|
|
||||||
if (assetSymbol.search('UNI') === -1) {
|
|
||||||
assetSymbol = `Uni${assetSymbol}`;
|
|
||||||
} else {
|
|
||||||
assetSymbol = assetSymbol.replace(/_/g, '').replace('UNI', 'Uni');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await lendingPoolConfigurator.initReserve(
|
|
||||||
tokenAddress,
|
|
||||||
aToken.address,
|
|
||||||
stableDebtToken.address,
|
|
||||||
variableDebtToken.address,
|
|
||||||
reserveDecimals,
|
|
||||||
rateStrategyContract.address
|
|
||||||
);
|
|
||||||
} catch (e) {
|
|
||||||
console.log(`Reserve initialization for ${assetSymbol} failed with error ${e}. Skipped.`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const buildPermitParams = (
|
export const buildPermitParams = (
|
||||||
chainId: number,
|
chainId: number,
|
||||||
token: tEthereumAddress,
|
token: tEthereumAddress,
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
import {iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
|
import {AavePools, iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types';
|
||||||
import {LendingPool} from '../types/LendingPool';
|
import {LendingPool} from '../types/LendingPool';
|
||||||
import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator';
|
import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator';
|
||||||
import {AaveProtocolTestHelpers} from '../types/AaveProtocolTestHelpers';
|
import {AaveProtocolTestHelpers} from '../types/AaveProtocolTestHelpers';
|
||||||
|
import {LendingPoolAddressesProvider} from '../types/LendingPoolAddressesProvider';
|
||||||
|
import {
|
||||||
|
deployDefaultReserveInterestRateStrategy,
|
||||||
|
deployStableDebtToken,
|
||||||
|
deployVariableDebtToken,
|
||||||
|
deployGenericAToken,
|
||||||
|
} from './contracts-helpers';
|
||||||
|
|
||||||
export const enableReservesToBorrow = async (
|
export const enableReservesToBorrow = async (
|
||||||
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
||||||
|
@ -79,3 +86,123 @@ export const enableReservesAsCollateral = async (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const initReserves = async (
|
||||||
|
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
||||||
|
tokenAddresses: {[symbol: string]: tEthereumAddress},
|
||||||
|
lendingPoolAddressesProvider: LendingPoolAddressesProvider,
|
||||||
|
lendingPool: LendingPool,
|
||||||
|
helpers: AaveProtocolTestHelpers,
|
||||||
|
lendingPoolConfigurator: LendingPoolConfigurator,
|
||||||
|
aavePool: AavePools,
|
||||||
|
incentivesController: tEthereumAddress,
|
||||||
|
verify: boolean
|
||||||
|
) => {
|
||||||
|
if (aavePool !== AavePools.proto && aavePool !== AavePools.secondary) {
|
||||||
|
console.log(`Invalid Aave pool ${aavePool}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let [assetSymbol, {reserveDecimals}] of Object.entries(reservesParams) as [
|
||||||
|
string,
|
||||||
|
IReserveParams
|
||||||
|
][]) {
|
||||||
|
const assetAddressIndex = Object.keys(tokenAddresses).findIndex(
|
||||||
|
(value) => value === assetSymbol
|
||||||
|
);
|
||||||
|
const [, tokenAddress] = (Object.entries(tokenAddresses) as [string, string][])[
|
||||||
|
assetAddressIndex
|
||||||
|
];
|
||||||
|
|
||||||
|
const {isActive: reserveInitialized} = await helpers.getReserveConfigurationData(tokenAddress);
|
||||||
|
|
||||||
|
if (reserveInitialized) {
|
||||||
|
console.log(`Reserve ${assetSymbol} is already active, skipping configuration`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const reserveParamIndex = Object.keys(reservesParams).findIndex(
|
||||||
|
(value) => value === assetSymbol
|
||||||
|
);
|
||||||
|
const [
|
||||||
|
,
|
||||||
|
{
|
||||||
|
baseVariableBorrowRate,
|
||||||
|
variableRateSlope1,
|
||||||
|
variableRateSlope2,
|
||||||
|
stableRateSlope1,
|
||||||
|
stableRateSlope2,
|
||||||
|
},
|
||||||
|
] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex];
|
||||||
|
console.log('- Deploy def reserve');
|
||||||
|
const rateStrategyContract = await deployDefaultReserveInterestRateStrategy(
|
||||||
|
[
|
||||||
|
lendingPoolAddressesProvider.address,
|
||||||
|
baseVariableBorrowRate,
|
||||||
|
variableRateSlope1,
|
||||||
|
variableRateSlope2,
|
||||||
|
stableRateSlope1,
|
||||||
|
stableRateSlope2,
|
||||||
|
],
|
||||||
|
verify
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('- Deploy stable deb totken ', assetSymbol);
|
||||||
|
const stableDebtToken = await deployStableDebtToken(
|
||||||
|
[
|
||||||
|
`Aave stable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
`stableDebt${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
tokenAddress,
|
||||||
|
lendingPool.address,
|
||||||
|
incentivesController,
|
||||||
|
],
|
||||||
|
verify
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('- Deploy var deb totken ', assetSymbol);
|
||||||
|
const variableDebtToken = await deployVariableDebtToken(
|
||||||
|
[
|
||||||
|
`Aave variable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
`variableDebt${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
tokenAddress,
|
||||||
|
lendingPool.address,
|
||||||
|
incentivesController,
|
||||||
|
],
|
||||||
|
verify
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log('- Deploy a token ', assetSymbol);
|
||||||
|
const aToken = await deployGenericAToken(
|
||||||
|
[
|
||||||
|
lendingPool.address,
|
||||||
|
tokenAddress,
|
||||||
|
`Aave interest bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
`a${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`,
|
||||||
|
incentivesController,
|
||||||
|
],
|
||||||
|
verify
|
||||||
|
);
|
||||||
|
|
||||||
|
if (process.env.POOL === AavePools.secondary) {
|
||||||
|
if (assetSymbol.search('UNI') === -1) {
|
||||||
|
assetSymbol = `Uni${assetSymbol}`;
|
||||||
|
} else {
|
||||||
|
assetSymbol = assetSymbol.replace(/_/g, '').replace('UNI', 'Uni');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('- init reserve currency ', assetSymbol);
|
||||||
|
await lendingPoolConfigurator.initReserve(
|
||||||
|
tokenAddress,
|
||||||
|
aToken.address,
|
||||||
|
stableDebtToken.address,
|
||||||
|
variableDebtToken.address,
|
||||||
|
reserveDecimals,
|
||||||
|
rateStrategyContract.address
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`Reserve initialization for ${assetSymbol} failed with error ${e}. Skipped.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -5,6 +5,8 @@ import FileSync from 'lowdb/adapters/FileSync';
|
||||||
import {WAD} from './constants';
|
import {WAD} from './constants';
|
||||||
import {Wallet, ContractTransaction} from 'ethers';
|
import {Wallet, ContractTransaction} from 'ethers';
|
||||||
import {BuidlerRuntimeEnvironment} from '@nomiclabs/buidler/types';
|
import {BuidlerRuntimeEnvironment} from '@nomiclabs/buidler/types';
|
||||||
|
import path from 'path';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
export const toWad = (value: string | number) => new BigNumber(value).times(WAD).toFixed();
|
export const toWad = (value: string | number) => new BigNumber(value).times(WAD).toFixed();
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,9 @@ export const setInitialAssetPricesInOracle = async (
|
||||||
const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[
|
const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[
|
||||||
assetAddressIndex
|
assetAddressIndex
|
||||||
];
|
];
|
||||||
|
console.log('PRIOR');
|
||||||
await waitForTx(await priceOracleInstance.setAssetPrice(assetAddress, price));
|
await waitForTx(await priceOracleInstance.setAssetPrice(assetAddress, price));
|
||||||
|
console.log('AFTA');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
||||||
|
|
||||||
const lendingPoolImpl = await deployLendingPool();
|
const lendingPoolImpl = await deployLendingPool();
|
||||||
|
|
||||||
console.log('Deployed lending pool, address:', lendingPoolImpl.address);
|
|
||||||
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
await waitForTx(await addressesProvider.setLendingPoolImpl(lendingPoolImpl.address));
|
||||||
|
|
||||||
console.log('Added pool to addresses provider');
|
console.log('Added pool to addresses provider');
|
||||||
|
@ -153,7 +152,10 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
||||||
fallbackOracle
|
fallbackOracle
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log('setted prices');
|
||||||
|
console.log('prior mocks');
|
||||||
const mockAggregators = await deployAllMockAggregators(MOCK_CHAINLINK_AGGREGATORS_PRICES);
|
const mockAggregators = await deployAllMockAggregators(MOCK_CHAINLINK_AGGREGATORS_PRICES);
|
||||||
|
console.log('aftahlocks');
|
||||||
|
|
||||||
const allTokenAddresses = Object.entries(mockTokens).reduce(
|
const allTokenAddresses = Object.entries(mockTokens).reduce(
|
||||||
(accum: {[tokenSymbol: string]: tEthereumAddress}, [tokenSymbol, tokenContract]) => ({
|
(accum: {[tokenSymbol: string]: tEthereumAddress}, [tokenSymbol, tokenContract]) => ({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {makeSuite, TestEnv} from './helpers/make-suite';
|
import {makeSuite, TestEnv} from './helpers/make-suite';
|
||||||
import {MockSwapAdapter} from '../types/MockSwapAdapter';
|
import {MockSwapAdapter} from '../types/MockSwapAdapter';
|
||||||
import {getMockSwapAdapter} from '../helpers/contracts-helpers';
|
import {getMockSwapAdapter} from '../helpers/contracts-getters';
|
||||||
import {ProtocolErrors} from '../helpers/types';
|
import {ProtocolErrors} from '../helpers/types';
|
||||||
import {ethers} from 'ethers';
|
import {ethers} from 'ethers';
|
||||||
import {APPROVAL_AMOUNT_LENDING_POOL} from '../helpers/constants';
|
import {APPROVAL_AMOUNT_LENDING_POOL} from '../helpers/constants';
|
||||||
|
|
|
@ -2,16 +2,13 @@ import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
import {TestEnv, makeSuite} from './helpers/make-suite';
|
import {TestEnv, makeSuite} from './helpers/make-suite';
|
||||||
import {APPROVAL_AMOUNT_LENDING_POOL, oneRay} from '../helpers/constants';
|
import {APPROVAL_AMOUNT_LENDING_POOL, oneRay} from '../helpers/constants';
|
||||||
import {
|
import {convertToCurrencyDecimals, getContract} from '../helpers/contracts-helpers';
|
||||||
convertToCurrencyDecimals,
|
|
||||||
getMockFlashLoanReceiver,
|
|
||||||
getContract,
|
|
||||||
} from '../helpers/contracts-helpers';
|
|
||||||
import {ethers} from 'ethers';
|
import {ethers} from 'ethers';
|
||||||
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
||||||
import {ProtocolErrors, eContractid} from '../helpers/types';
|
import {ProtocolErrors, eContractid} from '../helpers/types';
|
||||||
import {VariableDebtToken} from '../types/VariableDebtToken';
|
import {VariableDebtToken} from '../types/VariableDebtToken';
|
||||||
import {StableDebtToken} from '../types/StableDebtToken';
|
import {StableDebtToken} from '../types/StableDebtToken';
|
||||||
|
import {getMockFlashLoanReceiver} from '../helpers/contracts-getters';
|
||||||
|
|
||||||
const {expect} = require('chai');
|
const {expect} = require('chai');
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,8 @@ import {
|
||||||
} from './utils/calculations';
|
} from './utils/calculations';
|
||||||
import {getReserveAddressFromSymbol, getReserveData, getUserData} from './utils/helpers';
|
import {getReserveAddressFromSymbol, getReserveData, getUserData} from './utils/helpers';
|
||||||
|
|
||||||
import {
|
import {convertToCurrencyDecimals} from '../../helpers/contracts-helpers';
|
||||||
convertToCurrencyDecimals,
|
import {getAToken, getMintableErc20} from '../../helpers/contracts-getters';
|
||||||
getAToken,
|
|
||||||
getMintableErc20,
|
|
||||||
} from '../../helpers/contracts-helpers';
|
|
||||||
import {MAX_UINT_AMOUNT, ONE_YEAR} from '../../helpers/constants';
|
import {MAX_UINT_AMOUNT, ONE_YEAR} from '../../helpers/constants';
|
||||||
import {SignerWithAddress, TestEnv} from './make-suite';
|
import {SignerWithAddress, TestEnv} from './make-suite';
|
||||||
import {BRE, increaseTime, timeLatest, waitForTx} from '../../helpers/misc-utils';
|
import {BRE, increaseTime, timeLatest, waitForTx} from '../../helpers/misc-utils';
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {evmRevert, evmSnapshot, BRE} from '../../helpers/misc-utils';
|
import {evmRevert, evmSnapshot, BRE} from '../../helpers/misc-utils';
|
||||||
import {Signer} from 'ethers';
|
import {Signer} from 'ethers';
|
||||||
import {
|
import {
|
||||||
getEthersSigners,
|
|
||||||
getLendingPool,
|
getLendingPool,
|
||||||
getLendingPoolAddressesProvider,
|
getLendingPoolAddressesProvider,
|
||||||
getAaveProtocolTestHelpers,
|
getAaveProtocolTestHelpers,
|
||||||
|
@ -11,7 +10,7 @@ import {
|
||||||
getPriceOracle,
|
getPriceOracle,
|
||||||
getMockSwapAdapter,
|
getMockSwapAdapter,
|
||||||
getLendingPoolAddressesProviderRegistry,
|
getLendingPoolAddressesProviderRegistry,
|
||||||
} from '../../helpers/contracts-helpers';
|
} from '../../helpers/contracts-getters';
|
||||||
import {tEthereumAddress} from '../../helpers/types';
|
import {tEthereumAddress} from '../../helpers/types';
|
||||||
import {LendingPool} from '../../types/LendingPool';
|
import {LendingPool} from '../../types/LendingPool';
|
||||||
import {AaveProtocolTestHelpers} from '../../types/AaveProtocolTestHelpers';
|
import {AaveProtocolTestHelpers} from '../../types/AaveProtocolTestHelpers';
|
||||||
|
@ -27,6 +26,8 @@ import {PriceOracle} from '../../types/PriceOracle';
|
||||||
import {LendingPoolAddressesProvider} from '../../types/LendingPoolAddressesProvider';
|
import {LendingPoolAddressesProvider} from '../../types/LendingPoolAddressesProvider';
|
||||||
import {MockSwapAdapter} from '../../types/MockSwapAdapter';
|
import {MockSwapAdapter} from '../../types/MockSwapAdapter';
|
||||||
import {LendingPoolAddressesProviderRegistry} from '../../types/LendingPoolAddressesProviderRegistry';
|
import {LendingPoolAddressesProviderRegistry} from '../../types/LendingPoolAddressesProviderRegistry';
|
||||||
|
import {getEthersSigners} from '../../helpers/contracts-helpers';
|
||||||
|
import {AaveProtocolTestHelpersFactory} from '../../types';
|
||||||
chai.use(bignumberChai());
|
chai.use(bignumberChai());
|
||||||
chai.use(almostEqual());
|
chai.use(almostEqual());
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
getAToken,
|
getAToken,
|
||||||
getStableDebtToken,
|
getStableDebtToken,
|
||||||
getVariableDebtToken,
|
getVariableDebtToken,
|
||||||
} from '../../../helpers/contracts-helpers';
|
} from '../../../helpers/contracts-getters';
|
||||||
import {tEthereumAddress} from '../../../helpers/types';
|
import {tEthereumAddress} from '../../../helpers/types';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import {getDb, BRE} from '../../../helpers/misc-utils';
|
import {getDb, BRE} from '../../../helpers/misc-utils';
|
||||||
|
@ -27,7 +27,7 @@ export const getReserveData = async (
|
||||||
const stableDebtToken = await getStableDebtToken(tokenAddresses.stableDebtTokenAddress);
|
const stableDebtToken = await getStableDebtToken(tokenAddresses.stableDebtTokenAddress);
|
||||||
const variableDebtToken = await getVariableDebtToken(tokenAddresses.variableDebtTokenAddress);
|
const variableDebtToken = await getVariableDebtToken(tokenAddresses.variableDebtTokenAddress);
|
||||||
|
|
||||||
const [principalStableDebt] = await stableDebtToken.getSupplyData();
|
const {0: principalStableDebt} = await stableDebtToken.getSupplyData();
|
||||||
const totalStableDebtLastUpdated = await stableDebtToken.getTotalSupplyLastUpdated();
|
const totalStableDebtLastUpdated = await stableDebtToken.getTotalSupplyLastUpdated();
|
||||||
|
|
||||||
const scaledVariableDebt = await variableDebtToken.scaledTotalSupply();
|
const scaledVariableDebt = await variableDebtToken.scaledTotalSupply();
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import {makeSuite, TestEnv} from './helpers/make-suite';
|
import {makeSuite, TestEnv} from './helpers/make-suite';
|
||||||
import {ProtocolErrors, RateMode} from '../helpers/types';
|
import {ProtocolErrors, RateMode} from '../helpers/types';
|
||||||
import {APPROVAL_AMOUNT_LENDING_POOL, oneEther} from '../helpers/constants';
|
import {APPROVAL_AMOUNT_LENDING_POOL, oneEther} from '../helpers/constants';
|
||||||
import {convertToCurrencyDecimals, getMockFlashLoanReceiver} from '../helpers/contracts-helpers';
|
import {convertToCurrencyDecimals} from '../helpers/contracts-helpers';
|
||||||
import {parseEther, parseUnits} from 'ethers/lib/utils';
|
import {parseEther, parseUnits} from 'ethers/lib/utils';
|
||||||
import {BigNumber} from 'bignumber.js';
|
import {BigNumber} from 'bignumber.js';
|
||||||
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
import {MockFlashLoanReceiver} from '../types/MockFlashLoanReceiver';
|
||||||
|
import {getMockFlashLoanReceiver} from '../helpers/contracts-getters';
|
||||||
|
|
||||||
const {expect} = require('chai');
|
const {expect} = require('chai');
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
import {expect} from 'chai';
|
import {expect} from 'chai';
|
||||||
import {makeSuite, TestEnv} from './helpers/make-suite';
|
import {makeSuite, TestEnv} from './helpers/make-suite';
|
||||||
import {ProtocolErrors, eContractid} from '../helpers/types';
|
import {ProtocolErrors, eContractid} from '../helpers/types';
|
||||||
import {
|
import {deployContract, getContract} from '../helpers/contracts-helpers';
|
||||||
deployGenericAToken,
|
|
||||||
getAToken,
|
|
||||||
deployContract,
|
|
||||||
getContract,
|
|
||||||
} from '../helpers/contracts-helpers';
|
|
||||||
import {MockAToken} from '../types/MockAToken';
|
import {MockAToken} from '../types/MockAToken';
|
||||||
import {MockStableDebtToken} from '../types/MockStableDebtToken';
|
import {MockStableDebtToken} from '../types/MockStableDebtToken';
|
||||||
import {MockVariableDebtToken} from '../types/MockVariableDebtToken';
|
import {MockVariableDebtToken} from '../types/MockVariableDebtToken';
|
||||||
import {ZERO_ADDRESS} from '../helpers/constants';
|
import {ZERO_ADDRESS} from '../helpers/constants';
|
||||||
|
import {getAToken} from '../helpers/contracts-getters';
|
||||||
|
|
||||||
makeSuite('Upgradeability', (testEnv: TestEnv) => {
|
makeSuite('Upgradeability', (testEnv: TestEnv) => {
|
||||||
const {CALLER_NOT_AAVE_ADMIN} = ProtocolErrors;
|
const {CALLER_NOT_AAVE_ADMIN} = ProtocolErrors;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user