import { HardhatUserConfig, extendEnvironment } from "hardhat/config"; import {HardhatRuntimeEnvironment} from "hardhat/types"; import "@nomicfoundation/hardhat-toolbox"; import deployer from './.secret-config' import logger from './utils/logger' import debug from './utils/debug' const FTM_RPC = 'http://3.227.34.41:8545' const FTM_WS = 'ws://3.227.34.41:8546' const FTM_IPC = '/ethereum/data/opera.ipc' const config: HardhatUserConfig = { defaultNetwork: 'FTM', solidity: "0.7.6", networks: { FTM: { url: FTM_RPC, chainId: 250, 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 ${FTM_WS}`) hre.web3 = new Web3(FTM_WS); } else { const net = require('net'); logger.debug(`use ${FTM_IPC}`) hre.web3 = new Web3(FTM_IPC, net); } }) export default config;