import { HardhatUserConfig, extendEnvironment } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

import deployer from './.secret'
import {HardhatRuntimeEnvironment} from "hardhat/types";

// const ETH_RPC = '/ethereum/data/geth.ipc'
const ETH_RPC = 'http://3.227.34.41:8545'
const ETH_W_RPC = 'https://mainnet.ethereumpow.org'

const config: HardhatUserConfig = {
  defaultNetwork: 'eth_w',
  solidity: "0.7.6",
  networks: {
    eth: {
      url: ETH_RPC,
      chainId: 1,
      accounts: [deployer.private]
    },
    eth_w: {
      url: ETH_W_RPC,
      chainId: 10001,
      accounts: [deployer.private]
    }
  },
  paths: {
    sources: "./contracts",
    tests: "./test",
    cache: "./cache",
    artifacts: "./artifacts"
  },
  mocha: {
    timeout: 40000
  }
};

extendEnvironment((hre: HardhatRuntimeEnvironment) => {
  const Web3 = require("web3");
  hre.Web3 = Web3;

  hre.web3 = new Web3(hre.network.provider);
})

export default config;
