forge-std icon indicating copy to clipboard operation
forge-std copied to clipboard

SthChains improvements

Open sakulstra opened this issue 11 months ago • 5 comments

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

sakulstra avatar Sep 06 '23 08:09 sakulstra