mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
14e2ab47d9
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.
29 lines
1.1 KiB
TypeScript
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`);
|
|
});
|