base-std is the Solidity source of truth for B20 interfaces, constants, factory encoders, and test mocks.
Install
foundry.toml
>=0.8.20 <0.9.0. Reference implementations and tests in base-std pin Solidity 0.8.30.
Use StdPrecompiles
StdPrecompiles.sol exposes fixed precompile addresses and typed handles.
Use canonical constants
UseB20Constants.sol instead of redefining role and scope hashes.
Where things live
What not to do
- Do not hardcode precompile addresses in application code when
StdPrecompilesis available. - Do not copy interface files into your repo; import them to avoid version skew.
- Do not assume explorer verification exists for B20 precompile token addresses.
- Do not use stock
forgealone when your test expects live precompile behavior.