import { HardhatUserConfig, extendEnvironment } from "hardhat/config"; import {HardhatRuntimeEnvironment} from "hardhat/types"; import "@nomicfoundation/hardhat-toolbox"; import deployer from './.secret' import logger from './utils/logger' import debug from './utils/debug' const ETH_RPC = 'http://3.227.34.41:8545' const ETH_W_RPC = 'http://3.227.34.41:18545' const ETH_W_WS = 'ws://3.227.34.41:18546' const ETH_W_IPC = '/ethereum_pow_800/data/geth.ipc' 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; logger.debug(`is ${debug.isDev() ? 'dev' : 'pro'} model.`) if (debug.isDev()) { logger.debug(`use ${ETH_W_WS}`) hre.web3 = new Web3(ETH_W_WS); } else { const net = require('net'); logger.debug(`use ${ETH_W_IPC}`) hre.web3 = new Web3(ETH_W_IPC, net); } }) export default config;