2020-11-26 15:11:40 +00:00
|
|
|
import { task } from 'hardhat/config';
|
2020-08-20 15:35:05 +00:00
|
|
|
import {
|
|
|
|
deployLendingPoolAddressesProvider,
|
|
|
|
deployLendingPoolAddressesProviderRegistry,
|
2020-10-16 09:27:09 +00:00
|
|
|
} from '../../helpers/contracts-deployments';
|
2021-05-17 12:35:21 +00:00
|
|
|
import { getEthersSigners } from '../../helpers/contracts-helpers';
|
2020-11-26 15:11:40 +00:00
|
|
|
import { waitForTx } from '../../helpers/misc-utils';
|
|
|
|
import { AaveConfig } from '../../markets/aave';
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
task(
|
2020-08-31 10:10:40 +00:00
|
|
|
'dev:deploy-address-provider',
|
2020-08-20 15:35:05 +00:00
|
|
|
'Deploy address provider, registry and fee provider for dev enviroment'
|
|
|
|
)
|
2020-11-02 13:45:00 +00:00
|
|
|
.addFlag('verify', 'Verify contracts at Etherscan')
|
2020-11-26 15:11:40 +00:00
|
|
|
.setAction(async ({ verify }, localBRE) => {
|
2020-11-05 12:44:20 +00:00
|
|
|
await localBRE.run('set-DRE');
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2021-05-17 12:35:21 +00:00
|
|
|
const admin = await (await getEthersSigners())[0].getAddress();
|
2020-08-20 15:35:05 +00:00
|
|
|
|
2020-11-26 15:11:40 +00:00
|
|
|
const addressesProvider = await deployLendingPoolAddressesProvider(AaveConfig.MarketId, verify);
|
2020-11-05 11:35:50 +00:00
|
|
|
await waitForTx(await addressesProvider.setPoolAdmin(admin));
|
2021-05-10 08:47:24 +00:00
|
|
|
await waitForTx(await addressesProvider.setEmergencyAdmin(admin));
|
2020-08-20 15:35:05 +00:00
|
|
|
|
|
|
|
const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify);
|
|
|
|
await waitForTx(
|
2020-10-26 09:41:24 +00:00
|
|
|
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1)
|
2020-08-20 15:35:05 +00:00
|
|
|
);
|
|
|
|
});
|