hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Ignition: sharing deployment folder across network prevent deploying multiple instance of same module on same chain

Open wighawag opened this issue 10 months ago • 1 comments

Describe the feature

ignition mix the deployments of different network (as specified in hardhat config) in the same deployment folder (chain-<id>) For most of my project I tend to often deploy multiple independent instance of contracts on the same chain With ignition, this is problematic as if I deploy via --network sepolia_1 and then via --network sepolia_2 the second execution will do nothing as it will find the previous deployment in chain-<id> would be great if ignition respected the network configured in hardhat config

I was then made aware by @fvictorio that I can use --deployment-id <network-name> to change the folder and it works but this require me to repeartmyself like the following:

npx hardhat ignition deploy --network  sepolia2 --deployment-id sepolia2 ignition/modules/Counter.ts

It seems to me that having the folder named after the network being used natural and should be the default.

But a configuration option could allow to have chain-<id> for those that prefers this behavior

Search terms

No response

wighawag avatar Feb 24 '25 17:02 wighawag

Brainstorming: what if we add a deploymentId field to network configs that Ignition can pick up and replaces the default chain-<id>?

fvictorio avatar Feb 25 '25 10:02 fvictorio