hardhat-ignition
hardhat-ignition copied to clipboard
Module-level dependencies
hardhat-ignition tries to automatically deploy things in dependency order, but there are times where you need to specify dependencies explicitly
Current state
There is notation to make explicit dependencies on contracts (see here), but currently no way to make dependencies between modules
Possible implementation
Add a new options parameter to useModule with the same interface as the same feature for contracts
This is a current limitation we are aware of. Modules do exist as a concept separate from futures in Ignition, so in theory we could enhance the api to support:
- Modules depending on Modules
- Futures depending on Modules
- Modules depending on Futures
But more design work will be needed before we commit to supporting any of the above in the API.
If people do run into use cases where module level dependencies are needed, we would love to hear them in this ticket.
I’ve encountered this issue as well. In my case, I’m using one Ignition module to run Chai tests and another to set up a local deployment for UI testing. The second module depends on the first one and only performs some management transactions without deploying contracts. However, the transactions from the second module can sometimes interleave with those from the first module, causing contract addresses to change. This forces me to update the addresses in the UI code, which is quite a headache.