foundry-rs / book

A book on all things Foundry, available at https://book.getfoundry.sh.
https://book.getfoundry.sh
Apache License 2.0
784 stars 619 forks source link

Guidance for address management when fork testing #872

Open PaulRBerg opened 1 year ago

PaulRBerg commented 1 year ago

If you want to fork test a single chain, hard coding your dependencies' addresses in the Solidity tests is a simple and effective approach. However, it doesn't scale well the more chains you want to support for fork testing.

It would be nice if users were given a few tips and tricks about this topic in the Fork Testing tutorial.

For instance, MakerDAO is using JSON configuration files (as per the discussion in https://github.com/foundry-rs/forge-std/pull/268).

wminshew commented 1 year ago

adding a link to Uniswap's universal router usage as well (base deploy script inherited by other scripts which define the params)

PaulRBerg commented 1 year ago

Sharing Matt Solomon's insights from the Foundry Support group:

Screenshot 2023-07-02 at 9 53 59 PM