mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
4fe36c8fa4
Set in constructor of BaseParaSwapSellAdapter and validates before swap. Created mock registry that only validates one address. Changed the test fixtures to accomodate registry and added two new tests. Updated deployment script. Registry address left as a placeholder in package.json since not known yet. Fixes MixBytes Warning 1.
30 lines
1.2 KiB
TypeScript
30 lines
1.2 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')
|
|
.addParam('augustusRegistry', 'Address of ParaSwap AugustusRegistry')
|
|
.addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`)
|
|
.setAction(async ({ provider, augustusRegistry, 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, augustusRegistry);
|
|
await adapter.deployTransaction.wait();
|
|
console.log(`${CONTRACT_NAME}.address`, adapter.address);
|
|
await verifyContract(adapter.address, [provider, augustusRegistry]);
|
|
|
|
console.log(`\tFinished ${CONTRACT_NAME} deployment`);
|
|
});
|