testing
Installation
SKILL.md
Testing
When to use each approach
| Approach | Required when |
|---|---|
| Formal verification (Certora) | Contract includes a state machine or access-control rules complex enough that fuzzing won't cover the cases |
| Symbolic execution (Halmos) | A property is expressible as a Foundry test with symbolic inputs — fast, no external credentials |
| Fuzzing (Foundry) | Math-heavy code, data structures, complex invariants not suited for FV |
| Edge unit cases (Hardhat) | All contracts: golden path + pathological/border cases. This is the baseline. |
Default to Hardhat+Chai unit tests, add Halmos for invariants you can express symbolically, escalate to Certora when state-machine coverage requires it.
A bug fix must add a minimal test that reproduces the bug, committed alongside the fix. The objective is 100% branch coverage per PR.
Accessing internal functions: hardhat-exposed
$-prefixed wrapper contracts are auto-generated by hardhat-exposed. The plugin creates a $ContractName for every contract in contracts/, with every internal _function re-exposed as an external $_function. Output goes to contracts-exposed/ (gitignored). Use them directly: