Map of Content — Web3 Security Mastery
See Roadmap for the 16-week journey. See References for primary sources, audit reports, post-mortems, and academic papers organized by topic. This course trains auditors — not DeFi traders, not pure Solidity developers. Every lesson contains a lab that reproduces a real exploit, not just reads about one.
Phase 1: Foundations — Blockchain, EVM, Solidity
Before auditing a system, you must understand it at the byte and opcode level.
- Tuan-01-Web3-Blockchain-Crypto-Fundamentals — Distributed ledger, consensus, finality, hashes, signatures, Merkle trees, ZK overview
- Tuan-02-Ethereum-EVM-Deep-Dive — Account model, transaction lifecycle, gas, opcodes, storage layout, calldata, EIP roadmap
- Tuan-03-Solidity-Foundry-Workflow — Solidity idioms, types, modifiers, inheritance, custom errors, Foundry (forge/cast/anvil), fork testing
Phase 2: Smart Contract Security Core
80% of bugs auditors find belong to ~20 vulnerability classes. Master those before touching DeFi.
- Tuan-04-Security-Foundations-CEI-AC — Checks-Effects-Interactions, access control patterns, input validation, error handling, pull-over-push, storage layout hazards
- Tuan-05-Vulnerability-Classes-Part-1 — Reentrancy (single/cross-function/cross-contract/read-only), unsafe external calls, delegatecall, storage collision, uninitialized proxies, signature replay
- Tuan-06-Vulnerability-Classes-Part-2 — Oracle manipulation, MEV/front-running, insecure randomness, flash-loan attack flow, integer/rounding bugs, DoS patterns, gas griefing
- Tuan-07-Token-Standards-Integration-Risk — ERC20/721/1155/4626/777 quirks, permit (EIP-2612 + Permit2), fee-on-transfer, rebasing, deflationary tokens, callback hazards, approval risks
Phase 3: Protocol & Economic Security
The best auditors don’t find bugs in lines of code — they find them in economic models.
- Tuan-08-DeFi-Security-AMM-Lending-Vault — AMM math, lending invariants, liquidation flow, vault accounting, stablecoin design, staking/restaking, perps/derivatives
- Tuan-09-Oracle-MEV-Economic-Attack — Chainlink trust model, TWAP design, sandwich/back-running, priority-gas auctions, private mempools, flash-loan economic attack modeling
- Tuan-10-Bridge-Cross-Chain-Security — Lock-and-mint vs burn-and-mint vs liquidity network, light-client vs multisig bridges, message validation, finality assumptions, replay protection
- Tuan-11-L2-Rollup-Modular-Security — Optimistic vs ZK rollups, sequencer trust, fraud/validity proofs, data availability, escape hatches, L1↔L2 messaging hazards, shared sequencers
Phase 4: Adjacent Attack Surfaces
Smart contracts are one slice. Wallets, frontends, RPC nodes, and governance are equally attackable.
- Tuan-12-Wallet-AA-Key-Management — EOA vs smart wallet, multisig (Safe), MPC, hardware wallets, session keys, ERC-4337 stack, signature phishing, transaction simulation
- Tuan-13-Frontend-dApp-Infrastructure — Wallet connection flow, approval drainers, frontend supply-chain (npm/CDN/DNS), RPC trust, indexer/relayer/keeper risk, monitoring
- Tuan-14-Governance-DAO-Security — Token voting, delegation, timelocks, flash-loan governance attacks, multisig governance, emergency powers, parameter risk
Phase 5: Professional Practice
Knowing bugs is not enough. Auditing is a service — it needs methodology, reports, and communication.
- Tuan-15-Audit-Methodology-Tooling — Scoping, threat modeling, trust boundaries, invariant identification, Slither/Echidna/Medusa/Halmos/Certora, manual review checklist, severity classification
- Tuan-16-Report-Writing-Capstone — Audit report structure, finding template, severity matrix, remediation review, capstone audit project
Bonus Chapters — depth & emerging topics
Read when needed. Not required in order.
- Tuan-Bonus-Non-EVM-Solana — Account model, Anchor framework, signer checks, account confusion, CPI security, Solana-specific exploit patterns
- Tuan-Bonus-Non-EVM-CosmWasm-Move — CosmWasm message passing, Move resource model, Sui object model, Aptos formal verifier
- Tuan-Bonus-Formal-Verification-Deep — Certora CVL, Halmos SMT, K framework, hyper-properties, when formal beats fuzzing
- Tuan-Bonus-Fuzzing-Invariant-Advanced — Echidna config, Medusa, Foundry invariant patterns, handler-based fuzzing, stateful invariants
- Tuan-Bonus-ZK-Circuit-Security — Under-constrained bugs, soundness vs completeness, circom/halo2/noir, trusted setup risk, recursive proofs
- Tuan-Bonus-Stablecoin-Economic-Modeling — CDP, algorithmic, hybrid designs, depeg dynamics, liquidation cascades, oracle dependency
- Tuan-Bonus-Liquid-Staking-Restaking — LST design (Lido, Rocket Pool), EigenLayer restaking, AVS slashing, dependency-tree risk
- Tuan-Bonus-Audit-Competition-Playbook — Code4rena, Sherlock, Cantina strategy, time allocation, finding write-up style, leaderboard math
- Tuan-Bonus-Bug-Bounty-Immunefi — Severity scoring, PoC packaging, disclosure process, what protocols triage vs ignore
Case Studies — Real-World Exploit Reproduction
Every case study is a Foundry/Hardhat project that reproduces the exploit — not just a post-mortem read. Auditors are paid to recognize patterns, and patterns burn into the brain only when you write the PoC yourself.
Smart-contract era (2016–2020)
- Case-The-DAO-Reentrancy-2016 — The original reentrancy, hard fork → ETC, ~$60M
- Case-Parity-Multisig-2017 — Library self-destruct, ~$280M frozen
- Case-bZx-Price-Manipulation-2020 — Oracle manipulation + flash loans, first wave
DeFi-summer aftermath (2020–2022)
- Case-Harvest-Finance-2020 — Flash loan + Curve pool manipulation, ~$24M
- Case-Cream-Iron-Bank-2021 — Re-entry through ERC-777, ~$130M
- Case-Poly-Network-2021 — Cross-chain access control, ~$611M (mostly returned)
- Case-Compound-COMP-Distribution-2021 — Distribution bug, ~$80M
- Case-Wormhole-2022 — Signature verification bypass, ~$325M
- Case-Ronin-Bridge-2022 — Validator key compromise, ~$625M
- Case-Nomad-Bridge-2022 — Replay of init message, ~$190M
- Case-Beanstalk-Governance-2022 — Flash-loan governance attack, ~$182M
Modern era (2023–2025)
- Case-Euler-Finance-2023 — Donation attack on internal accounting, ~$197M (returned)
- Case-Curve-Vyper-Compiler-2023 — Compiler-level reentrancy-lock bug
- Case-KyberSwap-Elastic-2023 — Math edge case in concentrated liquidity
- Case-Atomic-Wallet-2023 — Wallet supply-chain compromise
- Case-Mixin-Network-2023 — Cloud key-storage compromise, ~$200M
- Case-Multichain-2023 — Operator key compromise
- Case-Galxe-Frontend-Hijack-2023 — DNS hijack of dApp frontend
- Case-BadgerDAO-Frontend-2021 — Cloudflare Worker injection
- Case-Radiant-Capital-2024 — Owner key compromise via malware
- Case-Penpie-Pendle-2024 — Reentrancy in reward accounting
- Case-DMM-Bittensor-2024 — Hot-wallet drain via key exfiltration
Attachments — Cheatsheets & Templates
- audit-checklist-master — Master audit checklist (300+ items grouped by category)
- severity-rubric-immunefi-c4 — Severity classification cheatsheet (Immunefi + Code4rena conventions)
- storage-layout-cheatsheet — Storage slot calculation, EIP-1967 slots, packed-struct hazards
- token-weirdness-cheatsheet — Weird ERC-20 behavior matrix (fee-on-transfer, rebasing, blacklist, etc.)
- oracle-design-decision-tree — When to use Chainlink, when TWAP, when a custom oracle
- invariant-test-templates — Foundry invariant test templates for AMM / lending / vault / stablecoin
- foundry-cheatsheet — forge/cast/anvil commands for audit workflow
- slither-detector-map — Detector → vulnerability class → false-positive rate mapping
- lab-dev-environment — Setup guide for Foundry + Slither + Echidna + Medusa + Halmos
- audit-report-template — Industry-standard markdown template (ToB / Spearbit / OZ style)
Maps & Index
- Roadmap — 16-week plan, bonus chapters, case studies, dependency map
- References — Primary-source library: official docs, audit firm publications, exploit post-mortems, academic papers, tooling docs
Tag System
#web3-security— Catch-all#solidity,#evm,#yul,#assembly#defi,#amm,#lending,#vault,#stablecoin,#perp,#staking#bridge,#l2,#rollup,#cross-chain#wallet,#aa,#erc4337,#multisig#oracle,#mev,#flash-loan,#economic-attack#governance,#dao,#timelock#frontend,#dapp,#supply-chain,#infrastructure#vulnerability— Specific:#reentrancy,#access-control,#delegatecall,#proxy,#signature,#rounding#tool—#foundry,#slither,#echidna,#medusa,#halmos,#certora,#tenderly#non-evm—#solana,#anchor,#cosmwasm,#move,#sui,#aptos#case-study— Real exploit reproduction#methodology— Audit process, threat modeling, reporting#anti-pattern— Code/design to avoid
Last updated: 2026-05-16