hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Expand ignition wipe

Open olehmisar opened this issue 3 months ago • 2 comments

Describe the feature

  • Wipe module

    • hardhat ignition wipe chain-1 MyModule - it should wipe all the deployments, calls etc in the module.
    • hardhat ignition wipe chain-1 MyModule --recursive should wipe the dependent modules of MyModule as well.
  • Wipe contract

    • Implement hardhat wipe chain-1 MyModule#MyContract --recursive.
    • this should wipe the dependencies of MyModule#MyContract (if any) and MyModule#MyContract itself.

Search terms

No response

olehmisar avatar Oct 05 '25 09:10 olehmisar

Hey @olehmisar, can you help me understand the use case here better?

The way I see it, we have two ways to remove deployments right now:

  • Using ignition wipe, which is meant for removing individual futures as a troubleshooting mechanism.
  • Just deleting the whole ignition/deployments/<chain>, which completely removes everything that you did with Ignition in that chain for the current project.

I understand that the first one is too fine-grained and the second one too coarse, and I can imagine us adding something more in-between. But I'm not sure that what you are proposing is the right thing to add. Describing your workflow (what you are doing and why you find yourself wanting to remove some parts of your deployments) would help us a lot to figure it out.

I also wonder if using explicit, different --deployment-ids would help, since that's a way to deploy a module "from scratch", which maybe is closer to what you want?

fvictorio avatar Oct 08 '25 07:10 fvictorio

It is possible to use the --reset option of the ignition deploy task for quick redeploys during development, reset cleans the deployment state before deploying without the need to manually delete files or folders. It is not very granular though.

pnpm hardhat ignition deploy ignition/modules/Counter.ts --reset

michalbrabec avatar Nov 25 '25 13:11 michalbrabec