mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Fix migration logic
This commit is contained in:
parent
729b642ea5
commit
51b3fb1669
|
@ -23,7 +23,6 @@ const MNEMONIC = process.env.MNEMONIC || '';
|
|||
|
||||
// Prevent to load scripts before compilation and typechain
|
||||
if (!SKIP_LOAD) {
|
||||
console.log('NOT SKPP');
|
||||
['misc', 'migrations', 'dev', 'full'].forEach((folder) => {
|
||||
const tasksPath = path.join(__dirname, 'tasks', folder);
|
||||
fs.readdirSync(tasksPath)
|
||||
|
|
|
@ -87,11 +87,13 @@ export const getWethAddress = async (config: ICommonConfiguration) => {
|
|||
const currentNetwork = DRE.network.name;
|
||||
const wethAddress = getParamPerNetwork(config.WETH, <eEthereumNetwork>currentNetwork);
|
||||
if (wethAddress) {
|
||||
console.log('here', wethAddress);
|
||||
return wethAddress;
|
||||
}
|
||||
if (currentNetwork.includes('main')) {
|
||||
throw new Error('WETH not set at mainnet configuration.');
|
||||
}
|
||||
const weth = await deployWETHMocked();
|
||||
console.log('here2');
|
||||
return weth.address;
|
||||
};
|
||||
|
|
|
@ -52,12 +52,13 @@ import {withSaveAndVerify, registerContractInJsonDb, linkBytecode} from './contr
|
|||
import {StableAndVariableTokensHelperFactory} from '../types/StableAndVariableTokensHelperFactory';
|
||||
import {MintableDelegationErc20} from '../types/MintableDelegationErc20';
|
||||
import {readArtifact as buidlerReadArtifact} from '@nomiclabs/buidler/plugins';
|
||||
import {HardhatRuntimeEnvironment} from 'hardhat/types';
|
||||
|
||||
const readArtifact = async (id: string) => {
|
||||
if (DRE.network.name === eEthereumNetwork.buidlerevm) {
|
||||
return buidlerReadArtifact(DRE.config.paths.artifacts, id);
|
||||
}
|
||||
return DRE.artifacts.readArtifact(id);
|
||||
return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id);
|
||||
};
|
||||
export const deployLendingPoolAddressesProvider = async (verify?: boolean) =>
|
||||
withSaveAndVerify(
|
||||
|
|
|
@ -125,14 +125,14 @@ export const getParamPerNetwork = <T>(
|
|||
return coverage;
|
||||
case eEthereumNetwork.buidlerevm:
|
||||
return buidlerevm;
|
||||
case eEthereumNetwork.hardhat:
|
||||
return buidlerevm;
|
||||
case eEthereumNetwork.kovan:
|
||||
return kovan;
|
||||
case eEthereumNetwork.ropsten:
|
||||
return ropsten;
|
||||
case eEthereumNetwork.main:
|
||||
return main;
|
||||
default:
|
||||
return main;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user