Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 2.39 KB

File metadata and controls

40 lines (33 loc) · 2.39 KB

Repository Guidelines

This document is the single source of truth for contributing to the Status Pre‑Deposit Vaults (Solidity + Foundry).

Project Structure & Modules

  • src/ core contracts and interfaces/ (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/.

Build, Test, Dev

  • forge build --sizes – compile with solc ^0.8.22 (Cancun) and report sizes.
  • forge test -vvv – run unit/fuzz/invariant tests with traces; use --match-test/--match-contract to 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; run slither . for static analysis.
  • anvil – local chain; set MAINNET_RPC_URL in .env for forks.

Coding Style & Naming

  • 2‑space indent, line length 100, double quotes; enforced via foundry.toml [fmt].
  • Contracts PascalCase; interfaces I…; structs/enums PascalCase; constants/immutables ALL_CAPS.
  • Functions/vars mixedCase; internal functions in src/ begin with _.
  • Add NatSpec to all public/external functions; prefer readability over micro‑optimizations.

Testing Guidelines

  • Place tests in test/*.t.sol; use BaseTest helpers and labeled addresses.
  • Names: test_Function_Condition, test_RevertWhen_…, testFuzz_…, invariant_…, testFork_….
  • Don’t assert in setUp(); use vm.expectRevert, vm.assume, and bound(); add handler‑based invariants and fork tests for bridges/strategies.

Commit & PR Guidelines

  • Conventional Commits (feat:, fix:, chore:, etc.). Include rationale, linked issues, tests (or justification), and gas/bytecode notes.
  • Do not change foundry.toml without prior discussion; propose the change and reasoning in your PR.
  • CI must pass: build, tests, coverage 100%, Scopelint, Slither.

Security & Configuration

  • 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.