This repository contains the core contracts for the CAP platform. Foundry is used as the development framework.
Required:
git: https://git-scm.com/downloadsyarn: https://yarnpkg.com/getting-startedfoundry: https://getfoundry.sh/
Optional:
# pull foundry's deps
git pull --recurse-submodules
# install deps
yarn installDefine sepolia chain in your ~/.foundry/foundry.toml
[rpc_endpoints]
sepolia = "https://sepolia.gateway.tenderly.co"
...
[etherscan]
sepolia = { key = "...", url = "https://api-sepolia.etherscan.io/api" }The following scripts are available to run with yarn:
yarn compile: Build the project using Forgeyarn build: Build the project using Forge (skips test files)yarn test:build: Build contracts, tests, and scripts with IR optimization
yarn test: Run unit testsyarn test:unit: Run unit tests (excluding slow tests)yarn test:invariants: Run invariant tests onlyyarn test:slither: Run Slither static analysis tool
yarn gas:flamegraph: Generate a flamegraph of gas usageyarn gas:snapshot: Create a gas snapshot in isolationyarn gas:diff: Compare gas usage against the last snapshotyarn gas:report: Generate a gas usage report
yarn coverage:forge: Generate a summary coverage reportyarn coverage:forge:report: Generate a detailed LCOV coverage report with branch coverage