import '@nomiclabs/hardhat-waffle' ; import '@typechain/hardhat' ; import 'hardhat-gas-reporter' ; import 'solidity-coverage' ; import './tasks/accounts' ; import './tasks/clean' ; import { resolve } from 'path' ; import { config as dotenvConfig } from 'dotenv' ; import { HardhatUserConfig } from 'hardhat/config' ; import { NetworkUserConfig } from 'hardhat/types' ; dotenvConfig ( { path : resolve ( __dirname , '../.env' ) } ) ; const chainIds = { ganache : 1337 , goerli : 5 , hardhat : 31337 , kovan : 42 , mainnet : 1 , rinkeby : 4 , ropsten : 3 , } ; let mnemonic = process . env . MNEMONIC as string ; if ( ! mnemonic ) { console . warn ( 'Please set your MNEMONIC in a .env file' ) ; mnemonic = 'taxi taxi taxi taxi taxi taxi taxi taxi taxi taxi taxi taxi' ; } let infuraApiKey = process . env . INFURA_ID as string ; if ( ! infuraApiKey ) { console . warn ( 'Please set your INFURA_ID in a .env file' ) ; infuraApiKey = '00000000000000000000000000000000' ; } function createTestnetConfig ( network ) { const url = 'https://' + network + '.infura.io/v3/' + infuraApiKey ; return { accounts : { count : 10 , initialIndex : 0 , mnemonic , path : "m/44'/60'/0'/0" , } , chainId : chainIds [ network ] , url , } ; } const config = { defaultNetwork : 'hardhat' , gasReporter : { currency : 'USD' , enabled : process . env . REPORT_GAS ? true : false , excludeContracts : [ ] , src : './contracts' , } , networks : { hardhat : { accounts : { mnemonic , } , chainId : chainIds . hardhat , gasPrice : 0 , } , goerli : createTestnetConfig ( 'goerli' ) , kovan : createTestnetConfig ( 'kovan' ) , rinkeby : createTestnetConfig ( 'rinkeby' ) , ropsten : createTestnetConfig ( 'ropsten' ) , } , paths : { artifacts : './artifacts' , cache : './cache' , sources : './contracts' , tests : './test' , } , solidity : { version : '0.8.4' , settings : { metadata : { bytecodeHash : 'none' , } , optimizer : { enabled : true , runs : 99999 , } , } , } , typechain : { outDir : 'typechain' , target : 'ethers-v5' , } , } ; export default config ;