Skip to content

Implement an address book in the config #10726

Open
@0xferrous

Description

@0xferrous

Component

Cast

Describe the feature you would like

It is a common that someone sending txs with cast are likely to send them to a set of same contracts and they can give human readable names to those addresses. It is not needed for things that already have an ENS, but it is not available for a wide set of contract addresses. A simple local config mapping in foundry.toml can provide the same convenience of ENS names used as addresses. So wherever in the CLI it accepts a <address> type parameter, it should:

  1. check if it is a address
  2. check if there is a book.<chain-id>.<label> defined in the config -- chain specific entry
  3. if not, check if there is a book.default.<label> defined in the config -- global entry
  4. if it isn't an address, try to resolve it as ENS name

Use this resolution in:

  1. cast send
  2. cast call
  3. cast balance
  4. --from arg in all of the above

and some more places i might have missed?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-featureType: featureT-needs-triageType: this issue needs to be labelled

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions