Skip to main content
base-std is the Solidity source of truth for B20 interfaces, constants, factory encoders, and test mocks.

Install

Add remappings for source and test helpers:
foundry.toml
Interfaces target >=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

Use B20Constants.sol instead of redefining role and scope hashes.

Where things live

What not to do

  • Do not hardcode precompile addresses in application code when StdPrecompiles is 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 forge alone when your test expects live precompile behavior.

Testing against precompiles

Constants & addresses