hardhat-ignition icon indicating copy to clipboard operation
hardhat-ignition copied to clipboard

Module-level dependencies

Open SebastienGllmt opened this issue 1 year ago • 2 comments
trafficstars

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

SebastienGllmt avatar Jan 15 '24 11:01 SebastienGllmt

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:

  1. Modules depending on Modules
  2. Futures depending on Modules
  3. 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.

kanej avatar Jan 15 '24 23:01 kanej

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.

Norfolks avatar Jan 04 '25 12:01 Norfolks