Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export-all json output format #325

Open
drortirosh opened this issue May 25, 2022 · 2 comments
Open

export-all json output format #325

drortirosh opened this issue May 25, 2022 · 2 comments

Comments

@drortirosh
Copy link

in continuation of #248 ,
I'm still confused about the output of --export-all:

The current export format is:

{
  "5": [
    {
      "name": "goerli",
      "chainId": "5",
      "contracts": {}
    }
  ]
}

and I'm trying to understand the need for an array per chain.
The chain "name" is a unique key (both in hardhat.config file, and as a folder under deployments
so it seems the simpler format should be:

{
  "goerli": {
    "name": "goerli",
    "chainId": "5",
    "contracts": {}
  }
}

The only possible "downside" is that if you keep 2 configurations deployed on the same network (e.g. goerli-prod, goerli-stage), they would appear as separate "top-level" entries in the all-networks file, instead of lumped together as array elements under "chainId":5

@wighawag
Copy link
Owner

name is not the chain name but the network name, and in hardhat you can have multiple network name for the same chain.

I use a lot for having different deployment on testnet or even keep tracking of multiple version on one chain

@wighawag
Copy link
Owner

The rationale for the key being the chainId, is that for frontend that let you chose a specific network per chain.

You read it from the current chain and see you have an array with length > 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants