-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Description
Issue:
Attempting to use mainnet hard fork of hardhat produces the error in title.
Reproduction:
- Set hardhat.config.ts
FORK_MAINNETtotrue - Run a script using
hardhat run --network hardhat <script> - Call
ethers.getSigners()
Error emitting line of script:
const Signer = (await ethers.getSigners())[0];Hack solution
I was able to get rid of the error by deleting / commenting out:
//chainId: !forkingData ? 43112 : undefined, //Only specify a chainId if we are not forkingin hardhat.config.ts
Output:
$ npx hardhat run --network hardhat scripts/<script>
Error: Missing required chain parameter: networkId
at Common.setChain (<base_path>/node_modules/@ethereumjs/common/src/index.ts:318:17)
at new Common (<base_path>/node_modules/@ethereumjs/common/src/index.ts:286:30)
at Function.forCustomChain (<base_path>/node_modules/@ethereumjs/common/src/index.ts:237:12)
at Object.makeForkCommon (<base_path>/node_modules/hardhat/src/internal/hardhat-network/provider/utils/makeForkCommon.ts:6:17)
at Function.create (<base_path>/node_modules/hardhat/src/internal/hardhat-network/provider/node.ts:157:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at HardhatNetworkProvider._init (<base_path>/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:232:28)
at HardhatNetworkProvider._send (<base_path>/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:180:5)
at HardhatNetworkProvider.request (<base_path>/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:106:18)
at EthersProviderWrapper.send (<base_path>/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Metadata
Metadata
Assignees
Labels
No labels