Protocols & testing · Free study companion
Fuzzing & Invariant Testing
Turn protocol properties into tests. Explore Foundry, Echidna and Medusa, then put the ideas to work in a practice project.
9 Whop lessons · 3 study checkpoints · 6 matching quizzes
Watch the course on Whop ↗
Checkpoint 1
Choose properties before tools
A fuzzer explores inputs; it does not decide what correctness means. State a property and its assumptions first. An invariant should describe intended behavior across a sequence of valid operations, with explicit handling for actions expected to revert.
Check your understanding
Invariant →
5 questions · Worked answers · No sign-in needed
Fuzzing →
5 questions · Worked answers · No sign-in needed
Practical challenge
Write two invariants for a toy vault before writing a test harness.
Check your work
- Name which balances and shares are included.
- Give one sequence that would violate each property.
Checkpoint 2
Build a meaningful harness
A test campaign can look busy while reaching very little useful state. Review allowed actors, handlers, input bounds and revert behavior. Combine automated exploration with code reading and targeted examples; different tools provide evidence under their configurations, not universal proof.
Check your understanding
Invariant Testing →
5 questions · Worked answers · No sign-in needed
Aderyn →
5 questions · Worked answers · No sign-in needed
Formal Verification →
5 questions · Worked answers · No sign-in needed
Practical challenge
Describe handlers for deposit, withdrawal and a donated balance.
Check your work
- Include multiple actors and nonzero operations.
- Explain which assumptions the harness intentionally excludes.
Checkpoint 3
Turn counterexamples into regressions
Treat a failing trace as evidence to investigate, not an automatic vulnerability. Reproduce the sequence, check the specification and distinguish a harness mistake from a reachable product failure. Preserve a minimal regression so a future change cannot quietly restore the same defect.
Check your understanding
Practical challenge
Reduce a failing sequence to the smallest useful reproduction.
Check your work
- Pin the setup and initial state.
- Show the failure before the fix and legitimate behavior after it.
Explain the decision, not just the answer.
After each checkpoint, write one assumption you changed and one test you would add. Bring a sanitized example or a specific question to the free Academy community.
Find your way around the community →