foundry-rs / foundry-rs/foundry

feat(`config`): add an address book section with aliases

Open
#10,726 2 comments 0 reactions 0 assignees View on GitHub
A-config T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### 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 `

` type parameter, it should:

1. check if it is a address
1. check if there is a `book..` defined in the config -- chain specific entry
1. if not, check if there is a `book.default.` defined in the config -- global entry
1. 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.