✍️ Writing Properties
Everything you need to know about writing properties
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 is a specification language for smart contracts where you write properties as annotations in your code. These annotations can be translated into checks which raise log events at run-time whenever a specified property is violated. Fuzzing as a service can detect these log events and tell you exactly which property is 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 docs.scribble.codes.

Other formats


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 testcases for property-based testing tools. For this reason we've implemented a utility which leverages Scribble to make property-based tests compatible!