|
|
@@ -1,16 +1,15 @@
|
|
|
-import { HardhatUserConfig, extendEnvironment } from "hardhat/config";
|
|
|
-import {HardhatRuntimeEnvironment} from "hardhat/types";
|
|
|
-import "@nomicfoundation/hardhat-toolbox";
|
|
|
+const { extendEnvironment } = require('hardhat/config')
|
|
|
+require('@nomicfoundation/hardhat-toolbox')
|
|
|
|
|
|
-import deployer from './.secret-config'
|
|
|
-import logger from './utils/logger'
|
|
|
-import debug from './utils/debug'
|
|
|
+const deployer = require('./.secret-config')
|
|
|
+const logger = require('./utils/logger')
|
|
|
+const debug = require('./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 = {
|
|
|
+const config = {
|
|
|
defaultNetwork: 'FTM',
|
|
|
solidity: "0.7.6",
|
|
|
networks: {
|
|
|
@@ -29,21 +28,23 @@ const config: HardhatUserConfig = {
|
|
|
mocha: {
|
|
|
timeout: 40000
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
-extendEnvironment((hre: HardhatRuntimeEnvironment) => {
|
|
|
- const Web3 = require('web3');
|
|
|
- hre.Web3 = Web3;
|
|
|
+extendEnvironment(async (hre) => {
|
|
|
+ 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);
|
|
|
+
|
|
|
+ hre.web3 = new Web3(FTM_WS)
|
|
|
+ logger.debug(await hre.web3.eth.getBlockNumber())
|
|
|
} else {
|
|
|
- const net = require('net');
|
|
|
+ const net = require('net')
|
|
|
logger.debug(`use ${FTM_IPC}`)
|
|
|
- hre.web3 = new Web3(FTM_IPC, net);
|
|
|
+ hre.web3 = new Web3(FTM_IPC, net)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-export default config;
|
|
|
+module.exports=config
|