Skip to content

Echidna 2.0.1

Compare
Choose a tag to compare
@ggrieco-tob ggrieco-tob released this 04 Apr 10:04
· 328 commits to master since this release
a31a9c2

This release adds support for dapp/foundry properties, improves the input generation and fixes multiple minor bugs.

Echidna supports writing properties/invariants using three different APIs:

function echidna_property() public returns (bool) { // A specially named function with no arguments is required
    // The following statement can trigger a failure depending on the returned value. Reverts will force a failure
    return ..;
} // side effects are *not* preserved

function checkInvariant(..) public { // A function with any number of arguments is supported using "--testMode assertion"
    assert(..); 
    // The following statement will always trigger a failure
    emits AssertionFailure(..);    
} // side effects are preserved

function checkDappTest(..) public { // A function with one or more arguments are required using "--testMode dapptest"
    // Any revert will cause a failure, otherwise it passes
    ...
} // side effects are preserved (but usually this runs in stateless mode)

Every testing mode can be stateful (by default) or stateless (using --seqLen 1). Review our documentation for more details on how to use these APIs and the difference between stateful and stateless fuzzing.

Added

  • New testing mode: "dapptest" to run foundry and dapptool fuzz tests (#733, #745) (see an example here)
  • Generate more values closer to the maximum (#736)

Fixed

  • Expanded and improved command-line help (#741)
  • Fixed TERMINFO path for Nix release builds (#731)
  • Mitigated large memory consumption when replaying corpus (#725)
  • Fixed --shrink-limit to change shrink limit instead of test limit (#728)
  • Correctly show lines with multiple types of coverage
  • Restored nix support (#717, #743)

Removed

  • Optimized stateless fuzzing removing some specific mutators (#747)