aave-protocol-v2/tasks/dev/2_address_provider_registry.ts

29 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-11-26 15:11:40 +00:00
import { task } from 'hardhat/config';
import {
deployLendingPoolAddressesProvider,
deployLendingPoolAddressesProviderRegistry,
} from '../../helpers/contracts-deployments';
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';
task(
'dev:deploy-address-provider',
'Deploy address provider, registry and fee provider for dev enviroment'
)
.addFlag('verify', 'Verify contracts at Etherscan')
2020-11-26 15:11:40 +00:00
.setAction(async ({ verify }, localBRE) => {
await localBRE.run('set-DRE');
const admin = await (await getEthersSigners())[0].getAddress();
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));
const addressesProviderRegistry = await deployLendingPoolAddressesProviderRegistry(verify);
await waitForTx(
2020-10-26 09:41:24 +00:00
await addressesProviderRegistry.registerAddressesProvider(addressesProvider.address, 1)
);
});