Protocols & testing · Free study companion
DeFi Security by Design: Vaults, Bridges, Hooks and Delegation
Study security trade-offs in vaults, bridges, hooks and delegation, with design questions to apply to a protocol of your own.
8 Whop lessons · 3 study checkpoints · 7 matching quizzes
Watch the course on Whop ↗
Checkpoint 1
Pricing, collateral and tokenized assets
A token balance is not a complete collateral model. Prices, redemption rights, external custodians and privileged controls can change the value or availability of assets. Identify the external fact being trusted and test the accounting against adverse prices, rounding and donated balances.
Watch the matching lessons (3)
Check your understanding
Spot the Bug: spot price from reserves →
3 questions · Worked answers · No sign-in needed
Spot the Bug: first-depositor share inflation →
3 questions · Worked answers · No sign-in needed
Invariant →
5 questions · Worked answers · No sign-in needed
Practical challenge
Map the trust assumptions of a toy collateralized vault.
Check your work
- Include price source, redemption and privileged roles.
- State an accounting property and an adverse scenario.
Further reading
Checkpoint 2
Cross-chain verification and hooks
Cross-chain verification and hook execution introduce boundaries beyond a simple local function call. A message needs the right identity and consumption rules. A shared hook needs explicit configuration, pool-specific state and safe external-dependency behavior. Test assumptions under repeated and cross-pool actions.
Watch the matching lessons (2)
Check your understanding
Spot the Bug: the bridge replay trap →
3 questions · Worked answers · No sign-in needed
DeFi Hooks: Configuration and Trust Boundaries →
5 questions · Worked answers · No sign-in needed
Practical challenge
Design a cross-pool or replay regression for a toy system.
Check your work
- Name the state that must remain separated or consumed once.
- Include repeated calls and a legitimate control case.
Further reading
Checkpoint 3
Account delegation
Account delegation changes what an account can do; it does not make every delegate safe. Identify the installed behavior, authorization and revocation assumptions, and distinguish account identity from trusted implementation. Trace a concrete permitted action before deciding which approval or limit constrains it.
Watch the matching lessons (1)
Check your understanding
Account Abstraction →
5 questions · Worked answers · No sign-in needed
Approval Bypass →
5 questions · Worked answers · No sign-in needed
Practical challenge
Review a hypothetical account delegate’s authority.
Check your work
- List permitted actions and revocation assumptions.
- Show one request that must fail and explain who enforces it.
Further reading
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 →