Security considerations when building Hooks in Uniswap V4
summary
Uniswap v4 uses a single pool manager and transient storage so hooks can run across many pools in one transaction (enabling flash-loans across all pools). Hooks are set at pool init and expose external functions, so anyone can initialize or call them; common failures include cross-pool storage overrides (fix with a mapping per pool), missing access control (add an onlyPoolManager modifier), simple logic bugs (mint uses = instead of +=), unexpected reverts that lock liquidity, arbitrary external calls that drain funds, upgradeability and DoS risks. Slides use ChatGPT-generated code examples.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:05Uniswap v4 architecture
- 3:42Understanding hooks
- 6:24Managing pools in hooks
- 8:59Access control in hooks
- 10:32Logic and code issues
- 11:39Preventing unexpected reverts
- 13:22General security best practices








