Skip to main content
The Use Cases Book has two jobs:
  • Reference: a catalog of reusable assertion patterns you can adapt to your own protocol
  • Explanation: case studies that explain how real exploits worked and why specific assertions would have blocked them
You can adapt these examples to write your own assertions. We highly recommend working with Phylax sales engineering to find the best policy fit; this support is included in your subscription. Custom policy development includes reviewing protocol assumptions, legitimate exceptions, and integration coverage; an example is not a ready-made production policy. Each entry shows code snippets of assertions accompanied by minimal interfaces for the protocols they protect. Full examples and mock protocol code are available in credible-std.

Ethereum Deployment Scope

The examples demonstrate assertion logic, not complete production integrations. On Ethereum, protection also requires activation at participating builders, an unavoidable guard on each protected path, and transaction routing. Exploit replays establish detection under their test conditions, not universal protection. See Ethereum Integration Planning. Historical examples retain the networks on which the incidents occurred. Sequencer infrastructure designs live separately in L2 and Sequencer Integrations.

How to Use This Book

Browse Assertion Patterns

Use the reference catalog when you already know the type of risk you want to cover.

Study Real Exploits

Use the case studies when you want to understand why an exploit worked and what assertion would have stopped it.

See Full Protocol Suites

Review deeper examples that show how assertion coverage can be shaped for a real protocol.

Run an Example Locally

Optionally inspect a working policy and its tests.
If you have questions or issues, please reach out on telegram @phylax_credible_layer. If you think an assertion is missing, please don’t hesitate to open a PR or reach out. We love digging into new hacks and use cases and writing assertions for them!

Book Structure

This book is organized into three sections:

Part 1: Protocol Case Studies

Explanation pages that show how comprehensive assertion coverage can be designed for real systems. View real world protocol suites →

Part 2: Previous Hacks

Explanation pages that analyze real-world DeFi hacks and show how assertions could have prevented them. View the previous hacks analysis →

Part 3: Assertion Patterns

Reference pages that catalog reusable assertion patterns by security category. View the complete use cases catalog → All sections include assertion code examples, explanations of the vulnerability or pattern being addressed, and minimal protocol interfaces for context.