


Cap
Everything you need to learn for the Cap contest: 33 comprehensive code tours, formulas presented in LaTeX, and a detailed glossary.
Click here to watch video preview
Sherlock, 10 Jul → 24 Jul 2025
Everything you need to learn for the Cap contest: 33 comprehensive code tours, formulas presented in LaTeX, and a detailed glossary.
Click here to watch video preview
Sherlock, 10 Jul → 24 Jul 2025
Everything you need to learn for the Cap contest: 33 comprehensive code tours, formulas presented in LaTeX, and a detailed glossary.
Click here to watch video preview
Sherlock, 10 Jul → 24 Jul 2025
Code Tours
1.1 High-Level Overview
2.1 Access Control: Overview
2.2 Deep Dive into AccessControl.sol
2.3 Protecting Contracts with Access.sol
3.1 Tokens: Overview
3.2 CapToken: The Protocol’s Vault Token
3.3 StakedCap: Yield-Bearing ERC-4626 Vault
3.4 Cross-Chain Tokens: LayerZero OFT Patterns
4.1 Oracle: Overview
4.2 Oracle: PriceOracle
4.3 Oracle: RateOracle
4.4 Oracle: Adapters
4.5 Oracle: Facade and Interfaces
5.1 Vault: Overview
5.2 Vault: Storage Layout
5.3 Vault: Minter Functionality
5.4 Vault: Fractional Reserve
5.5 Vault: Tying It All Together
6.1 Fees: Overview
6.2 Dutch Auction Fee System
6.3 Fee Distribution and Protocol Integration
7.1 Delegation: Overview
7.2 The Delegation Contract
7.3 Symbiotic Integration
8.1 Lending Pool: Overview
8.2 The Debt Token
8.3 Core Lending Logic
8.4 Liquidations
8.5 Supporting Logic and Configuration
9.1 Zap: Overview and LayerZero Context
9.2 Zap: Data Structures & Router Interface
9.3 Zap: SafeOFTLzComposer Safety and Security Mechanisms
9.4 Zap: ZapOFTComposer Implementation, Edge Cases & Security