foundry-rs / foundry-rs/foundry

feat(`config`): add `[labels]` section to `foundry.toml`

Open
#8,843 1 comment 0 reactions 0 assignees View on GitHub
A-config T-feature T-post-V1 T-to-discuss
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Other (please describe)

### Describe the feature you would like

By giving alias to frequently interacted contracts in `foundry.toml`, say [labels], could facilitate development even more. Imagine this feature as a combination of two existing feature. The first is giving alias to rpc_endpoints by `[rpc_endpoint]` field in `foundry.toml`; the second is giving alias to addresses by `vm.label` in scripts and tests.

Being able to use the label in cast commands, say `cast send -r eth MAINNET_CONTRACT_I_CARE ...`, could already save some time copy and pasting. It also helps the readability.

A further step could be extending the configured labels to all the tests and scripts as if it's in `function setup()`, saving the time of repeatedly using of `vm.label`

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