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

Meta: missing contributor guide

Open PaulRBerg opened this issue 3 years ago • 1 comments

Description

It's not clear what commands should contributors run in order to:

  1. Build the contracts
  2. Test the contracts

It would be very useful to provide some basic guidance on this, especially since this code base uses a broad Solidity pragma (>=0.6.0 <0.9.0) and some contracts use very different pragmas (e.g. STDError which uses >=0.8.10 <0.9.0).

This is in part why contributors like @devanonon couldn't see any problem with using type().max in commit 914702ae - there's no guidance on how to backtest new features against older compiler versions.

Solution

Add a "Contributing" section in the README or a CONTRIBUTING.md file.

Side note: perhaps it would also be worth it to define a foundry.toml configuration file with the defaults that should be used when compiling and testing?

PaulRBerg avatar Jul 14 '22 10:07 PaulRBerg

Yeah, it's a good idea.

Contributors should check at least:

  • forge test (test with latest solc version)
  • forge build --contracts src/Test.sol --use solc:0.6.0 (compile Test with solc 0.6.0).

ZeroEkkusu avatar Jul 14 '22 16:07 ZeroEkkusu