wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

Named Accounts - Multi-Address Account #414

Open TheArhaam opened 1 year ago

TheArhaam commented 1 year ago

Is your feature request related to a problem? Please describe. There might be a scenario where multiple accounts need to be grouped under a single name, for example, a list of owners of a MultiSig wallet. Setting up owner1, owner2, owner3, and so on, can be troublesome.

Describe the solution you'd like The option in hardhat.config.ts to configure multiple addresses to one name. For example:

  namedAccounts: {
    owners: {
      default: [0,1,2,3],
      mainnet: ["some-address-1","some-address-2"]
    }
  }

Fetching those addresses:

    const accounts = await getNamedAccounts();
    console.log(accounts.owners); // ["some-address-1","some-address-2"]

Describe alternatives you've considered Just storing the addresses in a separate config file but doesn't seem very neat since all other addresses are managed in the hardhat config.