Reproduce the exploit in Foundry, patch it, then prove the patch holds with an invariant — the loop behind every real audit report.
You can read Solidity, but reading it is not the same as knowing where the money leaks out. Audit reports are full of findings that look obvious in hindsight — a missing check, an initialiser left callable, a price read from a pool an attacker can move — and none of them look obvious inside a live codebase. This course teaches the auditor’s loop, on contracts you are authorised to test. Every task runs the same three steps: reproduce the bug as a failing Foundry test, apply the canonical fix, then write an invariant test that stops it coming back. You work through the families behind most real losses — reentrancy, broken access control and initialisation, arithmetic and rounding, untrusted external calls, oracle manipulation funded by flash loans, maximal extractable value (MEV) and transaction ordering, cross-chain bridges, and gas exhaustion. The last module assembles it into a workflow you can repeat on any codebase: manual review, Slither static analysis, Echidna and Foundry fuzzing, Halmos symbolic execution, then a written report with severity, reproduction, and recommendation. Five capstones ship with the course; pick one and produce a report a protocol team would act on.
Built by Lakshya Kumar
Paste this into any AI chat. Fill in the bracketed parts with your context — you'll get back a straight answer on whether this belongs on your plate.
We grant free access case-by-case — students, career-switchers, builders on a tight budget. Sign in to send us a note.
Sign in to applyFinished the tasks? Take the prompt to your AI and get tested on it. We copy the prompt and open the app — just paste it in.
The DAO and Cream lost funds to one idea wearing four disguises; you reproduce each, patch it, and prove the patch with an invariant.
Two Parity wallets froze or emptied because an initialiser stayed callable — learn to spot the ones still shipping that way today.
A rounding error is not cosmetic — it is a slow drain that lets the first depositor quietly tax everyone who arrives after them.
One external call hands control to a stranger mid-transaction; learn which return values and balances to check before you continue.
A price read from a single pool can be bought for the length of one transaction and repaid before the block closes. Design around it.
Your transaction is public before it settles, so learn what a searcher can profitably do with it while it waits in the mempool.
Bridges custody both sides of a trade, which is why the largest single losses live here — and why signature checks are the whole game.
A payout loop that grows without bound eventually costs more gas than a block allows, and every withdrawal stops working at once.
Turn instinct into a repeatable pass — static analysis, fuzzing, symbolic checks, and findings written so a team can act on them.
Complete all modules, then submit the required number of capstone projects. Each must earn a passing rating from an admin reviewer.
Complete the 14+ challenges in Damn Vulnerable DeFi end-to-end. For each: produce the exploit transaction in Foundry, the canonical fix, and an invariant test that proves the fix holds across 100k fuzz rounds. Submit the Foundry repo with all challenges passing.
In Foundry, build a toy lending pool that prices collateral via a single Uniswap V2 pool. Build an attacker that uses an Aave flash loan + single-swap manipulation to over-borrow + exit profitably. Apply the canonical fix (TWAP + Chainlink fallback). Add invariants proving the patched version is safe against any flash-loan-funded transaction sequence.
I am learning smart contract security and pentesting — threat modeling for smart contracts, reentrancy (single, cross-function, read-only, cross-contract), access control and initialization, arithmetic and rounding errors, external calls and DeFi composability, oracle manipulation and flash-loan attacks, MEV (frontrunning, sandwich, JIT), cross-chain bridge attacks, gas and DOS attacks, and audit methodology with Slither / Echidna / Foundry / Halmos. Every concept I learn is paired with: how to reproduce the bug in Foundry, how to apply the canonical fix, and how to write an invariant test that catches regression. Help me work through the actual mechanics with reference to real CVEs (The DAO, Cream, Parity, Wormhole, Nomad, Ronin, Curve, Mango, Euler), real audit reports (Trail of Bits, OpenZeppelin, Spearbit), and real tooling.
Write Echidna invariants for three vulnerable contracts (each demonstrating: overflow, reentrancy, access-control bug). Tune Echidna config to find each bug in <10 minutes. Apply fixes; verify invariants pass on patched versions. Deliverable: the contracts + invariant suites + a 1-page note on Echidna's strengths vs Foundry invariant tests.
Pick an open-source DeFi protocol (e.g., a smaller-TVL Uniswap V2 fork, a lending market, a vault). Conduct the full audit workflow: protocol understanding, manual review, Slither + Echidna + Foundry invariants. Produce a professional audit report (~10-20 pages) following the Trail of Bits / Spearbit format. Findings should include severity, reproduction, impact, recommendation, and references.
Design and build a price-feed contract that combines: Chainlink primary + Pyth secondary + Uniswap V3 TWAP tertiary; cross-source divergence detection with circuit breaker; staleness checks; governance-pause + emergency-override. Prove safety against flash-loan-funded manipulation with invariant tests. Deliverable: the contract, test suite, and a design document explaining the threat model + defences.
Searchable index of every public audit finding across major firms.