foundry-rs / foundry-rs/forge-std

feat(StdChains): add chain enum, block explorer URLs, and sync with alloy-chains

Open
#452 8 comments 0 reactions 0 assignees View on GitHub
enhancement improvement
Dominant language
Solidity
Stars
1.1k
Forks
520
Avg merge
3d 13h
Merged PRs (30d)
9

Description

Hey first time I noticed `StdChains` https://twitter.com/msolomon44/status/1699116841753534877 and checked if we can replace with our internal tooling for this.

Two things that would be quite useful for us is:
- explicit constant getters for the chains defined (aka `StdChains.Arbitrum`)

This is quite handy for when you want to e.g. ensure a script is run on a specific network.

- in `viem` the chain struct also contains the blockexplorer

This is quite handy as you can easily log addresses as blockexplorer link, making them directly clickable.

perhaps could make sense to somehow sync https://github.com/foundry-rs/forge-std/blob/master/src/StdChains.sol#L180 automatically with viem? It's a bit sad that support of chains is so different between:
- StdChains: https://github.com/foundry-rs/forge-std/blob/master/src/StdChains.sol#L180
- viem chains: https://github.com/wagmi-dev/viem/tree/main/src/chains/definitions
- ethers-rs: https://github.com/gakonst/ethers-rs/blob/master/ethers-core/src/types/chain.rs

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.