aave-protocol-v2/tasks/deployments/deploy-wethGateWay.ts
2021-02-22 14:26:05 +01:00

22 lines
730 B
TypeScript

import { task } from 'hardhat/config';
import { deployWETHGateway } from '../../helpers/contracts-deployments';
const CONTRACT_NAME = 'WETHGateway';
task(`deploy-${CONTRACT_NAME}`, `Deploys the ${CONTRACT_NAME} contract`)
.addParam('weth', 'Address of the weth token')
.addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`)
.setAction(async ({ weth, verify }, localBRE) => {
await localBRE.run('set-DRE');
if (!localBRE.network.config.chainId) {
throw new Error('INVALID_CHAIN_ID');
}
const wethGateWay = await deployWETHGateway([weth], verify);
console.log(`${CONTRACT_NAME}.address`, wethGateWay.address);
console.log(`\tFinished ${CONTRACT_NAME} deployment`);
});