Fuzzing
  • 👋Welcome!
  • Getting Started
    • 🏃‍♀️Quickstart
    • 🛠️Fuzzing Foundry Projects
    • 🍎Fuzzing Non-Foundry Projects
  • 📖Other guides
    • 🏎️Example Project
    • ✍️Writing Properties
    • 🌱Seed Deployment
    • 💻Using the CLI
    • ❓FAQ
  • Advanced Topics
    • 📄Campaign Reports
      • 📊Statistics
    • 🌊Incremental Fuzzing
    • 👩‍🏫Fuzzing Lessons
Powered by GitBook
On this page
  • Scribble
  • Other formats
  • Assertions
  • Property-Based Testing

Was this helpful?

  1. Other guides

Writing Properties

Everything you need to know about writing properties

PreviousExample ProjectNextSeed Deployment

Last updated 1 year ago

Was this helpful?

With fuzzing you can automatically test properties (also called property-based testing). So, you'll first need to write some properties.

Diligence Fuzzing supports multiple property formats, but our preferred option is Scribble.

Scribble

Scribble is a specification language for smart contracts where you write properties as annotations in your code. These annotations can be translated into runtime checks that trigger whenever a specified property is violated. This way Diligence Fuzzing can tell you exactly which property was violated.

Example Scribble property:

// #if_succeeds balance(_to) == old(balance(_to)) + amount;
function transfer(address _to, uint amount) public { ... }

Learn more about Scribble over at .

Other formats

Assertions

We don't just find property violations of Scribble properties, but we also detect regular assertion failures.

Property-Based Testing

We realise that you might already have test-cases for property-based testing tools. For this reason we've implemented a utility which converts such tests to Scribble-annotations!

📖
✍️
docs.scribble.codes