Skip to content

Releases: crytic/echidna

Echidna 2.0.3

09 Sep 14:19
Compare
Choose a tag to compare

This release focuses on getting enhanced coverage during a fuzzing campaign when handling non-utf8 strings, extreme signed integers and the fallback function. It also improved the scripts to build Docker containers.

Fixed

  • Avoid resetting accounts if there is a deployed contract (#795)
  • Fixed decoding non-utf8 strings from slither printer (#799)
  • Fixed generation and mutation of extreme signed integers (#791)
  • Removed fallback from signature map when it is not defined (#772)
  • Refactored Docker scripts and tests (#706)

Echidna 2.0.2

26 May 12:12
43591b1
Compare
Choose a tag to compare

This release eases the custom deployment of contracts at fixed addresses, improves the fuzzing's shrinking and fixes a crash the EVM emulation:

deployContracts: [["0x42", "ContractA"], ["0x43", "ContractB"]]
deployBytecodes: [["0x44", "60806.."]]

All the contracts are deployed using the deployer address and will produce an error if they fail.

Added

  • Added support for deployment of certain contracts or bytecode in specific addresses (#758)
  • Added support for detection and handling of ancient solc versions (#675)
  • Added explicit static flag and removed pthread one from ghc options (#768)

Fixed

  • Improved shrinking of dynamic arrays (#775)
  • Fixed git attribute to support building docker containers in Windows (#773)
  • Fixed crash when the EVM execution triggers more than one query (#760)

Echidna 2.0.1

04 Apr 10:04
a31a9c2
Compare
Choose a tag to compare

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)

Echidna 2.0.0

11 Feb 17:39
31034fb
Compare
Choose a tag to compare

Echidna 2.0.0 is a new major release of our fuzzing tool for smart contracts. All users of Echidna should move to version 2.0.0. We will not provide support for older releases.

Major new features

  • Detection of assertion failures in Solidity 0.8.x or greater, including automatic detection of integer overflows, zero division, invalid casts, and more

  • Automatic discovery of maximum values for functions that compute a value (e.g., int256) with --test-mode optimization

  • Automatic integer over- and underflow detection in Solidity 0.8.x or greater with --test-mode overflow. This mode detects integer issues across all functions of the tested contract. It shows inputs that cause under- or overflows without any additional configuration. For instance, it will detect an overflow in this code snippet without outside assistance:

    function f(uint x, uint y) public {
      uint z = x + y;
      ... 
    }
  • Automatic detection of contract destruction using testDestruction (which usually should trigger failures in other tests)

  • Assertion tests using events (e.g., AssertionFailure(...)) are improved to work even if the execution reverts

Enhanced user experience

Echidna now shares why a test failed and what state the contract was in when it failed. Echidna now displays:

  • The cause that triggers a failure in a property or assertion (e.g., a revert in a property test) to help quickly detect unexpected failures in properties
  • A list of events or custom errors collected during the transaction that triggers a failure, which lets users print any state variable or computation using only events

Simplified test configuration

Echidna 2.0.0 features a simplified interface, using a "test mode" to specify the type of tests performed. These are configured via --test-mode (CLI) or testMode (config file):

  • (Default for no arguments) Run user-defined property tests: echidna-test contract.sol --test-mode property
  • Detect integer overflows (Solidity 0.8.x+): echidna-test contract.sol --test-mode overflow
  • Find the maximum value for a function: echidna-test contract.sol --test-mode optimization
  • Execute every line of code without any testing target ("unconstrained execution"): echidna-test contract.sol --test-mode exploration
  • Detect assertion failures (previously checkAsserts): echidna-test contract.sol --test-mode assertion

checkAsserts and benchmarkMode options have been removed.

Changelog

Added

  • Complete support for assertion detection in Solidity 0.8 and greater
  • New testing modes: function optimization
  • New testing mode: Integer under and overflow detection in solc 0.8 and greater
  • Events and cause of failure are now displayed
  • Added a new self-destruction test to check if any contract was destroyed
  • Added a new config option to enable or disabled all self-destruction tests using testDestruction

Removed

  • checkAsserts and benchmarkMode were removed in favor of testMode [BREAKING CHANGE]

Fixed

  • Revert cleans all the events
  • Incorrect handling of negative constants (#636)
  • Incorrect filtering of functions when using assertion mode (#690)
  • Value generation can fail in multi-abi mode (#579)
  • psender and deployer address are changed to be 0x10000 and 0x30000 for readability [BREAKING CHANGE]
  • Upgraded to hevm 0.49

Refactored

  • Refactored campaign and test internal data structures and code
  • Refactored unit test code and moved the related files to the tests directory
  • Refactored UI code

Echidna 1.7.3

29 Nov 19:49
f748124
Compare
Choose a tag to compare

This is a small release with some minor bugfixes and quality of life improvements. User facing changes include:

  • removal of old compilation artifacts before starting another campaign
  • fixed incorrect function filtering in assertion mode
  • improved handling of negative constants
  • fixed source line printing within coverage

Some less important changes are a version bump to hevm 0.48.0 and some nix improvements regarding slither.

Echidna 2.0.0 (beta 2)

25 Oct 17:03
Compare
Choose a tag to compare
Pre-release

Echidna 2.0.0 (beta 2) is the second beta release of the new version of our fuzzing tool for smart contracts, which continues with the new features, fixes and breaking changes. This release brings the following new major features:

  • Automatic integer overflow or underflow detection for solc 0.8.x or greater using --test-mode overflow. This mode detects integer issues across all the functions of the tested contract to show inputs cause under or overflows without modifying or adding anything in your code. For instance, it will detect an overflow here:
    function f(uint x, uint y) public {
      uint z = x + y;
      ... 
    }
  • Self destruction tests include any contract destruction (and not just the testing one). Additionally, they are disabled by default, making the UI easier to read.

Additionally, the psender and deployer addresses were changed to 0x10000 and 0x30000 respectively to be more readable. Please double check your properties to see if they work as expected.

Added

  • New testing mode: Integer under and overflow detection in solc 0.8 and greater [UNSTABLE FEATURE]
  • Added a new self-destruction test to check if any contract was destroyed.
  • Added new config options to enable or disabled all self-destruction tests using testDestruction [BREAKING CHANGE]

Removed

  • Self-destruction tests are disabled by default. [BREAKING CHANGE]

Fixed

  • psender and deployer address are changed to be 0x10000 and 0x30000, to be more readable [BREAKING CHANGE]
  • Upgraded to hevm 0.48.

Echidna 2.0.0 (beta 1)

05 Oct 09:46
Compare
Choose a tag to compare
Pre-release

Echidna 2.0.0 (beta 1) is the first beta release of the new version of our fuzzing tool for smart contracts, which brings a number of new features and breaking changes. If you need a stable release right now, please use v1.7.2, otherwise, we encourage everyone to test this new beta.

Echidna 2.0 has the following new major features:

  • Full support for solc 0.8.x or greater to detect assertion failures, including automatic detection of integer overflows, zero division, invalid casts, and others.
  • Assertion tests using events (e.g. AssertionFailure(...)) are improved to work even if the execution reverts.
  • Value optimization tests, where there is a function that computes a value (int256) and Echidna tries to find a maximum.
  • Automatic detection of contract destruction (which usually should trigger failures in other tests).

On top of that, Echidna will show us valuable information regarding why the test is failing and what is the state of the contract when it failed:

  • The cause that triggers a failure in a property or assertion (e.g. a revert in a property test). This allows auditors to quickly detect unexpected failures in properties.
  • The list of events collected during the transaction that trigger a test failure (or that provides the maximum value of a certain function if optimization is used). This allows users to print any state variable or computation just using events.

This new release also features a simplified interface, using a "test mode" to specify what type of tests you want. This can be used directly in the command-line:

  • To test assertions and enable the automatic detection of integer overflows (if solc 0.8.x is used):
echidna-test contract.sol --test-mode assertion 
  • To run a value optimization and find the maximum value in some function:
echidna-test contract.sol --test-mode optimization
  • To run unconstrained exploration mode, where echidna will try to execute every line of code without any testing target:
echidna-test contract.sol --test-mode exploration

Finally, by default, --test-mode is assumed to be property. This new version also removes checkAssertion and benchmarkMode config options. Instead, users should specify testMode in the yaml file which can be one the values previously detailed.

Added

  • Complete support for assertion detection and other in solc 0.8 and greater
  • New testing modes: function optimization [UNSTABLE FEATURE]
  • Events and cause of failure is now displayed [UNSTABLE FEATURE]
  • Automatic detection of destructed contracts

Removed

  • checkAssertion and benchmarkMode were removed in favor of testMode [BREAKING CHANGE]

Fixed

  • Revert cleans all the events
  • Incorrect handling of negative constants (#636)
  • Incorrect filtering of functions when using assertion mode (#690)
  • Value generation can fail in multi-abi mode (#579)

Refactored

  • Refactored campaign and execution code (#615)
  • Refactored integration test code
  • Refactored UI code [UNSTABLE FEATURE]

Echidna 1.7.2

12 Jul 15:39
30e9e5e
Compare
Choose a tag to compare

Echidna 1.7.2 is a minor release that brings a variety of fixes and small improvements, including improved command-line options and fixes when using hardhat/brownie to test contracts. It relies on hevm 0.46 for the EVM emulation. This release requires to use crytic-compile 0.2.0 or later but otherwise contains no breaking changes.

Fixed

  • Fixed check-asserts and multi-abi cli switches (#665)
  • Support for loading multiple files with compiled contracts from hardhat/brownie (#659)

Refactored

  • Updated to hevm 0.4.6 (#660)

Echidna 1.7.1

07 May 15:48
89d9439
Compare
Choose a tag to compare

Echidna 1.7.1 is a minor release that brings a variety of fixes and small improvements, including better mutations, two new command-line options, --corpus-dir and --check-asserts, correct initialization of new addresses and extended notion of coverage to include EVM frames. This release contains no breaking changes.

Added

  • Documented known issues and limitations (#655)
  • Improved coverage to count number of EVM frames (#624)
  • Added two CLI options: --corpus-dir and --check-asserts (#640)

Fixed

  • Tweaked mutators and improved test stability (#628)
  • Automatically initialize addresses when used (#657)
  • Avoid mutations to generate inputs outside their expected ABI range (#650)
  • Various small fixes to run Vyper contracts (#645)
  • Fixed link to macOS binary in binaries.soliditylang.org (#629)
  • Fixed UI to fit long function calls (#635)
  • Fixed default.nix to use 1.7.0 as version (#623)

Refactored

  • Refactored shrinkSeq to improve readability (#639)
  • Refactored Test type (#622)
  • Refactored coverage types and added corpus size in UI (#627)

Echidna 1.7.0

26 Feb 20:39
34cf64d
Compare
Choose a tag to compare

Echidna 1.7.0 is a major release that brings a few major features:

This release also includes several internal refactorings, fixes in our CI tests and improved Nix support. The Echidna team would also like to thank @elopez for their fixes submitted as PRs.

Added

  • Enabled use of coverage by default (#605) [BREAKING CHANGE]
  • More corpus and array mutations implemented (#372)
  • Source coverage is printed after fuzzing campaign (#516)

Fixed

Refactored

  • Refactored and improved etheno support to be more useful (#615)
  • Refactored the mutator code (#618)
  • Run echidna tests in parallel (#571)
  • Simplified slither information parsing (#543)