hardhat-deploy: hardhat node task bug deploys to ropsten defaultNetwork

For ref see: https://github.com/nomiclabs/hardhat/issues/1139#issue-775939991

EDIT: copying over the bits relevant to hardhat-deploy :

Now the more serious bugs:

  • defaultNetwork: “ropsten”
    • npx hardhat node

image

As you can see I am using hardhat-deploy which overrides the hardhat node task to run deploy scripts on start. I accidentally had my defaultNetwork: set to ropsten and somehow the hardhat node task did not fail and it deployed contracts to ropsten.

I would have expected hardhat node to fail with a Hardhat error similar to Error HH605: Unsupported network for JSON-RPC server.

This works when --network ropsten is passed as a flag:

image

But apparently not if the network is configured as defaultNetwork.

Either way the main issue:

When a defaultNetwork is configured hardhat-deploy seems to deploy all contracts to that network when invoking the hardhat node command in the terminal. Even worse, it bypassed all my deploy scripts skip functions for that defaultNetwork.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

I’m currently experiencing this issue while trying to deploy to a forked mainnet network, @gitpusha you mentioned the issue was fixed over at the nomiclabs issue tab you opened. How did you rectify this?