hardhat.config.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { HardhatUserConfig, extendEnvironment } from "hardhat/config";
  2. import "@nomicfoundation/hardhat-toolbox";
  3. import deployer from './.secret'
  4. import {HardhatRuntimeEnvironment} from "hardhat/types";
  5. // const ETH_RPC = '/ethereum/data/geth.ipc'
  6. // const ETH_RPC = 'http://3.227.34.41:8545'
  7. // const ETH_W_RPC = 'http://3.227.34.41:18545'
  8. const ETH_RPC = 'ws://127.0.0.1:8546'
  9. const ETH_W_RPC = 'ws://127.0.0.1:18546'
  10. const config: HardhatUserConfig = {
  11. defaultNetwork: 'eth_w',
  12. solidity: "0.7.6",
  13. networks: {
  14. eth: {
  15. url: ETH_RPC,
  16. chainId: 1,
  17. accounts: [deployer.private]
  18. },
  19. eth_w: {
  20. url: ETH_W_RPC,
  21. chainId: 10001,
  22. accounts: [deployer.private]
  23. }
  24. },
  25. paths: {
  26. sources: "./contracts",
  27. tests: "./test",
  28. cache: "./cache",
  29. artifacts: "./artifacts"
  30. },
  31. mocha: {
  32. timeout: 40000
  33. }
  34. };
  35. extendEnvironment((hre: HardhatRuntimeEnvironment) => {
  36. const Web3 = require("web3");
  37. hre.Web3 = Web3;
  38. hre.web3 = new Web3(hre.network.provider);
  39. })
  40. export default config;