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

feat: add vm.getChain cheatcodes to get chain info #10198

Open
grandizzy opened this issue Mar 28, 2025 · 3 comments · May be fixed by #10226
Open

feat: add vm.getChain cheatcodes to get chain info #10198

grandizzy opened this issue Mar 28, 2025 · 3 comments · May be fixed by #10226
Assignees
Labels
C-forge Command: forge first issue A good way to start contributing T-feature Type: feature

Comments

@grandizzy
Copy link
Collaborator

Component

Forge

Describe the feature you would like

forge-std's StdChains provides a way to retrieve chain info for a chain id or chain alias: https://github.com/foundry-rs/forge-std/blob/6853b9ec7df5dc0c213b05ae67785ad4f4baa0ea/src/StdChains.sol#L69

However this can get easily out of sync when support for new chains is added. We can fix this by providing native cheatcodes vm.getChain(alias) and vm.getChain(chainId) that returns a Chain struct as https://github.com/foundry-rs/forge-std/blob/6853b9ec7df5dc0c213b05ae67785ad4f4baa0ea/src/StdChains.sol#L45

Additional context

No response

@grandizzy grandizzy added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Mar 28, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 28, 2025
@grandizzy grandizzy changed the title feat: add chain info cheatcodes feat: add vm.getChain cheatcodes to get chain info Mar 28, 2025
@grandizzy grandizzy added C-forge Command: forge and removed T-needs-triage Type: this issue needs to be labelled labels Mar 28, 2025
@mattsse mattsse added the first issue A good way to start contributing label Mar 28, 2025
@redtrama
Copy link

can i get assigned to this one?

@mattsse
Copy link
Member

mattsse commented Mar 29, 2025

assigned, lmk if you need some pointers, feel free to open a draft pr early

@Pratham1812
Copy link

If nobody has started working on this can I try this one? @mattsse

@redtrama redtrama linked a pull request Apr 1, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge first issue A good way to start contributing T-feature Type: feature
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

4 participants