NomicFoundation / hardhat-ignition

Hardhat Ignition is a declarative deployment system that enables you to deploy your smart contracts without navigating the mechanics of the deployment process.
https://hardhat.org
MIT License
97 stars 18 forks source link

Must manually update nonce if deployer address sent TX after last deployment (IGN405) #781

Open Stumble opened 3 weeks ago

Stumble commented 3 weeks ago

What happened?

IgnitionError: IGN405: The next nonce for "0x...." should be 6, but is 28. Please make sure not to send transactions from "0x..." while running this deployment and try again.

We sent out a few other transactions using the deployment address, and then ignition stuck here. We bypass this issue by manually update the journal.json, changing the last nonce to be 27.

Minimal reproduction steps

Assuming we use address "0xaaa" as deployer.

  1. Use hardhat ignition to deploy a contract A using create2.
  2. Send any transaction from "0xaaa" so that its nonce changed.
  3. Use ignition to deploy a contract B, using the same account.

Search terms

No response

kanej commented 3 weeks ago

Hey @Stumble, thanks for the feedback. Can I check I have understood. Contract A gets deployed, then the deployment account is used to send some transactions, then you use Ignition to deploy Contract B.

Are you deploying Contract B by adding it to the Module you used for deploying Contract A?