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 ExampleCookbook
PurposeLearn Covenant step-by-stepSolve a specific problem
Reading orderSequential (Chapter 1 -> 15)Browse by category
CodePedagogical, introduces one conceptComplete, deployable
Context”How does X work?""I need to do X”

Recipe Format

Every recipe follows this structure:

  1. Problem - one or two sentences describing the real need
  2. Solution - complete, deployable Covenant code
  3. Explanation - why this approach, not alternatives
  4. Gas estimate - cost for typical usage
  5. Common pitfalls - 3-5 mistakes to avoid
  6. Variations - 1-2 alternative approaches
  7. 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.