Modifying an existing module | Ethereum development environment for professionals by Nomic Foundation (original) (raw)
It's possible to make changes to modules after having deployed them.
For example, if we wanted to add a new Rocket
contract instance to the module we deployed in the Quick Start guide, this is what we would do:
ignition/modules/Apollo.ts
ignition/modules/Apollo.js
Then run it again. Hardhat Ignition will continue from where it left off, and execute the new parts of the module.
This is what the output would look like:
We can see two new batches that execute the new parts of the module, while keeping the previous already deployed parts intact.
# Incompatible modifications
There are certain modifications one can make to a Future
definition that would make the new version incompatible with the previous one if the previous one has already been partially or completely executed. This would lead to Hardhat Ignition being unable to continue your deployment from where it was left off. Read the Reconciliation guide to learn more about this.
# Clearing an existing deployment with reset
In the above case, or if you simply want to start over, you can use the --reset
option to clear the previous deployment and start from scratch:
TIP
When using --reset
on a network other than Hardhat Network (i.e. mainnet, testnets, etc.), Hardhat Ignition will ask you to confirm that you want to clear the previous deployment before proceeding.