-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Hardhat ethers does not correctly instantiate a provider with the OVM #935
Copy link
Copy link
Closed
Labels
Description
Describe the bug
Using Hardhat's built-in ethers object does not correctly instantiate a provider using the OVM. Because of this, you cannot perform tasks like deploying a contract.
This only happens when ovm: true is set in hardhat.config.js.
To Reproduce
- Clone this forked repo of the optimism-tutorial
- Follow the README instructions to run the deployment
- Observe that the deployment does not work and produces the following error
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.1.2) - In
deploy/ERC20.deploy.js, comment out lines 11-12 (Hardhat ethers instantiation) and comment in lines 6-8 (native ethers instantiation). - Run the deployment again and observe that the contract gets deployed.
Expected behavior
I would expect the Hardhat ethers implementation to work the same as the native ethers implementation when deploying a contract.
System Specs:
All relevant packages are in the forked repo.
Additional context
Another way to verify that the provider is not working correctly is by inserting await ethers.provider.ready and observing that the script execution never passes that line.
Reactions are currently unavailable