import "@nomiclabs/hardhat-waffle" ; import "@typechain/hardhat" ; import { HardhatUserConfig , subtask , task } from "hardhat/config" ; import 'hardhat-deploy' ; import '@nomiclabs/hardhat-etherscan' ; import { TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD } from "hardhat/builtin-tasks/task-names" ; import path from 'path' ; import * as fs from "fs" ; subtask ( TASK_COMPILE_SOLIDITY_GET_SOLC_BUILD , async ( args , hre , runSuper ) => { const solcVersion = args . solcVersion ; if ( solcVersion . indexOf ( '0.8.8' ) < 0 ) return runSuper ( ) ; let ver = '0.8.7-nightly.2021.8.9+commit.74c804d8' ; const compilerPath = path . join ( __dirname , `./compilers/soljson-v${ ver }.js` ) ; if ( ! fs . existsSync ( compilerPath ) ) { throw `Unable to find: ${ compilerPath }` ; } return { compilerPath , isSolcJs : true , version : '0.8.7' , longVersion : '0.8.7+nightly' } ; } ) ; task ( "accounts" , "Prints the list of accounts" , async ( taskArgs , hre ) => { const accounts = await hre . ethers . getSigners ( ) ; for ( const account of accounts ) { console . log ( account . address ) ; } } ) ; let mnemonicFileName = process . env . MNEMONIC_FILE || process . env . HOME + '/.secret/testnet-mnemonic.txt' ; let mnemonic = 'test ' . repeat ( 11 ) + 'junk' ; if ( fs . existsSync ( mnemonicFileName ) ) mnemonic = fs . readFileSync ( mnemonicFileName ! , "ascii" ) ; function getNetwork1 ( url ) { return { url , accounts : { mnemonic } } ; } function getNetwork ( name ) { return getNetwork1 ( `https://${ name }.infura.io/v3/${ process . env . INFURA_ID }` ) ; } const config = { solidity : { version : "0.8.7" , settings : { optimizer : { enabled : true } } } , networks : { dev : { url : "http://localhost:8545" } , goerli : getNetwork ( 'goerli' ) , proxy : getNetwork1 ( 'http://localhost:8545' ) , kovan : getNetwork ( 'kovan' ) } , mocha : { timeout : 10000 } , etherscan : { apiKey : process . env . ETHERSCAN_API_KEY } } ; export default config ;