2020-11-12 13:41:08 +00:00
|
|
|
import {ExternalProvider} from '@ethersproject/providers';
|
|
|
|
|
2020-11-05 11:18:20 +00:00
|
|
|
import {task} from 'hardhat/config';
|
2020-11-05 12:44:20 +00:00
|
|
|
import {setDRE} from '../../helpers/misc-utils';
|
2020-05-29 14:55:31 +00:00
|
|
|
|
2020-11-05 12:44:20 +00:00
|
|
|
task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).setAction(
|
|
|
|
async (_, _DRE) => {
|
|
|
|
setDRE(_DRE);
|
2020-11-12 13:41:08 +00:00
|
|
|
const provider = new _DRE.ethers.providers.Web3Provider(_DRE.tenderlyRPC as ExternalProvider);
|
|
|
|
//Set the ethers provider to the one we initialized so it targets the correct backend
|
|
|
|
_DRE.ethers.provider = provider;
|
2020-11-05 12:44:20 +00:00
|
|
|
return _DRE;
|
2020-07-13 08:54:08 +00:00
|
|
|
}
|
|
|
|
);
|