This document is the single source of truth for contributing to the Status Pre‑Deposit Vaults (Solidity + Foundry).
src/core contracts andinterfaces/(e.g.,PreDepositVault.sol).test/Foundry tests:BaseTest.sol,mocks/,fork/.script/deploy/ops scripts (DeployL1.s.sol,DeployL2.s.sol).spec/protocol docs and testing plans.lib/dependencies (forge-std,openzeppelin-contracts).- Build artifacts:
out/,cache/.
forge build --sizes– compile withsolc ^0.8.22(Cancun) and report sizes.forge test -vvv– run unit/fuzz/invariant tests with traces; use--match-test/--match-contractto filter.FOUNDRY_PROFILE=lite forge test– fast dev loop (optimizer off).forge coverage --report summary --report lcov– coverage; CI requires 100%.scopelint check | scopelint fmt– enforce/auto‑fix formatting and conventions; runslither .for static analysis.anvil– local chain; setMAINNET_RPC_URLin.envfor forks.
- 2‑space indent, line length 100, double quotes; enforced via
foundry.toml [fmt]. - Contracts
PascalCase; interfacesI…; structs/enumsPascalCase; constants/immutablesALL_CAPS. - Functions/vars
mixedCase; internal functions insrc/begin with_. - Add NatSpec to all public/external functions; prefer readability over micro‑optimizations.
- Place tests in
test/*.t.sol; useBaseTesthelpers and labeled addresses. - Names:
test_Function_Condition,test_RevertWhen_…,testFuzz_…,invariant_…,testFork_…. - Don’t assert in
setUp(); usevm.expectRevert,vm.assume, andbound(); add handler‑based invariants and fork tests for bridges/strategies.
- Conventional Commits (
feat:,fix:,chore:, etc.). Include rationale, linked issues, tests (or justification), and gas/bytecode notes. - Do not change
foundry.tomlwithout prior discussion; propose the change and reasoning in your PR. - CI must pass: build, tests, coverage 100%, Scopelint, Slither.
- Apply CEI, validate external calls, add reentrancy guards where relevant, and consider MEV/front‑running.
- Keep secrets in
.env; never commit them. - Watch EIP‑170 size limits with
forge build --sizes; document any Slither suppressions.