import * as dotenv from "dotenv"; import { HardhatUserConfig, task } from "hardhat/config"; import "@nomiclabs/hardhat-etherscan"; import "@nomiclabs/hardhat-waffle"; import "@typechain/hardhat"; import "hardhat-gas-reporter"; import "solidity-coverage"; dotenv.config(); // This is a sample Hardhat task. To learn how to create your own go to // https://hardhat.org/guides/create-task.html 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); } }); const alchemyApiKey = process.env.ALCHEMY_API_KEY; if (!alchemyApiKey) { throw new Error("Please set your ALCHEMY_ETH_API_KEY in a .env file"); } // You need to export an object to set up your config // Go to https://hardhat.org/config/ to learn more const config: HardhatUserConfig = { solidity: { compilers: [ { version: "0.8.6", settings: { optimizer: { enabled: true, runs: 200, }, }, }, { version: "0.7.6", settings: { optimizer: { enabled: true, runs: 200, }, }, }, { version: "0.5.6", settings: { optimizer: { enabled: true, runs: 200, }, }, }, ], }, networks: { hardhat: { forking: { url: `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`, // blockNumber: 14501064 }, chainId: 1, gasPrice: 151101000000, }, mainnet: { url: `https://eth-mainnet.alchemyapi.io/v2/${alchemyApiKey}`, chainId: 1, gasPrice: 52101000000, accounts: [`0x${process.env.PRIVATE_KEY}`] }, }, gasReporter: { enabled: process.env.REPORT_GAS !== undefined, currency: "USD", }, etherscan: { apiKey: process.env.ETHERSCAN_API_KEY, }, mocha: { timeout: 10000 * 10000, } }; export default config;