aave-protocol-v2/tasks/deployments/deploy-ParaSwapLiquiditySwapAdapter.ts
Jason Raymond Bell 14e2ab47d9 Add task to deploy ParaSwapLiquiditySwapAdapter
Note that it didn't actually work as written since gasPrice was set too low
and also the verifyContract didn't work (so I had to verify it manually).

Deployed to mainnet at 0xC91864A5A1E2F52aDdfb69e31b89a3b7783733c3.
2021-03-29 17:19:26 +01:00

29 lines
1.1 KiB
TypeScript

import { task } from 'hardhat/config';
import { ParaSwapLiquiditySwapAdapterFactory } from '../../types';
import { verifyContract } from '../../helpers/etherscan-verification';
import { getFirstSigner } from '../../helpers/contracts-getters';
const CONTRACT_NAME = 'ParaSwapLiquiditySwapAdapter';
task(`deploy-${CONTRACT_NAME}`, `Deploys the ${CONTRACT_NAME} contract`)
.addParam('provider', 'Address of the LendingPoolAddressesProvider')
.addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`)
.setAction(async ({ provider, verify }, localBRE) => {
await localBRE.run('set-DRE');
if (!localBRE.network.config.chainId) {
throw new Error('INVALID_CHAIN_ID');
}
console.log(`\n- ${CONTRACT_NAME} deployment`);
const adapter = await new ParaSwapLiquiditySwapAdapterFactory(
await getFirstSigner()
).deploy(provider);
await adapter.deployTransaction.wait();
console.log(`${CONTRACT_NAME}.address`, adapter.address);
await verifyContract(adapter.address, [provider]);
console.log(`\tFinished ${CONTRACT_NAME} deployment`);
});