Cookbook
The Covenant Cookbook is a collection of ready-to-deploy contract patterns. Each recipe solves a specific, concrete problem with production-quality code.
Cookbook vs. Examples
| By Example | Cookbook | |
|---|---|---|
| Purpose | Learn Covenant step-by-step | Solve a specific problem |
| Reading order | Sequential (Chapter 1 -> 15) | Browse by category |
| Code | Pedagogical, introduces one concept | Complete, deployable |
| Context | ”How does X work?" | "I need to do X” |
Recipe Format
Every recipe follows this structure:
- Problem - one or two sentences describing the real need
- Solution - complete, deployable Covenant code
- Explanation - why this approach, not alternatives
- Gas estimate - cost for typical usage
- Common pitfalls - 3-5 mistakes to avoid
- Variations - 1-2 alternative approaches
- See also - related recipes, examples, reference pages
Categories
Tokens
Fungible tokens with mint, burn, and confidential transfers.
Auth
Admin patterns: multisig, time locks, post-quantum signatures.
Upgrades
UUPS and beacon proxy upgrade patterns with re-init protection.
Privacy
Sealed auctions, private voting, ZK airdrops.
Integration
Chainlink oracles and ERC-20 bridge patterns.
Code Quality Bar
Every recipe in this cookbook:
- Compiles on Covenant V0.7
- Is deployable to Sepolia without modification
- Has been checked against the 38 LSP lint detectors
- Does not contain placeholders or TODOs
If a feature requires V0.8+, it is flagged clearly at the top of the recipe.