2020-11-30 13:14:29 +00:00
|
|
|
import { task } from 'hardhat/config';
|
2020-10-30 10:16:21 +00:00
|
|
|
|
2020-11-30 13:14:29 +00:00
|
|
|
import { UiPoolDataProviderFactory } from '../../types';
|
2021-03-11 15:55:04 +00:00
|
|
|
import { verifyContract } from '../../helpers/contracts-helpers';
|
2020-11-30 13:14:29 +00:00
|
|
|
import { eContractid } from '../../helpers/types';
|
2020-10-30 10:16:21 +00:00
|
|
|
|
|
|
|
task(`deploy-${eContractid.UiPoolDataProvider}`, `Deploys the UiPoolDataProvider contract`)
|
|
|
|
.addFlag('verify', 'Verify UiPoolDataProvider contract via Etherscan API.')
|
2020-11-30 13:14:29 +00:00
|
|
|
.setAction(async ({ verify }, localBRE) => {
|
|
|
|
await localBRE.run('set-DRE');
|
2020-10-30 10:16:21 +00:00
|
|
|
|
|
|
|
if (!localBRE.network.config.chainId) {
|
|
|
|
throw new Error('INVALID_CHAIN_ID');
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(`\n- UiPoolDataProvider deployment`);
|
|
|
|
|
|
|
|
console.log(`\tDeploying UiPoolDataProvider implementation ...`);
|
|
|
|
const uiPoolDataProvider = await new UiPoolDataProviderFactory(
|
|
|
|
await localBRE.ethers.provider.getSigner()
|
|
|
|
).deploy();
|
|
|
|
await uiPoolDataProvider.deployTransaction.wait();
|
|
|
|
console.log('uiPoolDataProvider.address', uiPoolDataProvider.address);
|
2021-03-11 15:55:04 +00:00
|
|
|
if (verify) {
|
|
|
|
await verifyContract(eContractid.UiPoolDataProvider, uiPoolDataProvider, []);
|
|
|
|
}
|
2020-10-30 10:16:21 +00:00
|
|
|
|
|
|
|
console.log(`\tFinished UiPoolDataProvider proxy and implementation deployment`);
|
|
|
|
});
|