Template repo for solidity projects
This repo uses Foundry for development and testing. To get started:
- Fork the project
- Install Foundry
- To install dependencies, run
forge install
- To compile the contracts, run
forge build
- To test, run
forge test
This repo also supports contracts compiled via IR. Since compiling all contracts via IR would slow down testing workflows, we only want to do this for our target contract(s), not anything in this test
or script
stack. We accomplish this by pre-compiled the target contract(s) and then loading the pre-compiled artifacts in the test suite.
First, we compile the target contract(s) via IR by runningFOUNDRY_PROFILE=optimized forge build
(ensuring that FOUNDRY_PROFILE is not in our .env file)
Next, ensure that tests are using the DeployOptimized
script, and run forge test
as normal.
See the wonderful Seaport repo for more details and options for this approach.