import { task } from "hardhat/config" ; import "@nomiclabs/hardhat-waffle" ; import { HardhatUserConfig } from "hardhat/config" ; import "@nomiclabs/hardhat-etherscan" ; import dotenv from "dotenv" ; dotenv . config ( ) ; function getEnv ( val ) { if ( val in process . env ) { return ( process . env as any ) [ val ] ; } throw `Missing env ${ val }` ; } task ( "accounts" , "Prints the list of accounts" , async ( args , hre ) => { const accounts = await hre . ethers . getSigners ( ) ; for ( const account of accounts ) { console . log ( account . address ) ; } } ) ; const config = { solidity : "0.7.3" , networks : { hardhat : { } , ropsten : { url : getEnv ( 'ROPSTEN_ETH_URL' ) , accounts : [ getEnv ( 'ROPSTEN_PRIVATE_KEY' ) ] , gas : parseInt ( getEnv ( 'ROPSTEN_GAS_LIMIT' ) ) , gasPrice : parseInt ( getEnv ( 'ROPSTEN_GAS_PRICE' ) ) , } , mainnet : { url : getEnv ( 'MAINNET_ETH_URL' ) , accounts : [ getEnv ( 'MAINNET_PRIVATE_KEY' ) ] , gas : parseInt ( getEnv ( 'MAINNET_GAS_LIMIT' ) ) , gasPrice : parseInt ( getEnv ( 'MAINNET_GAS_PRICE' ) ) , } } , etherscan : { apiKey : getEnv ( 'ETHERSCAN_KEY' ) } } ; export default config ;