Echidna 2.0.0 (beta 1)
Pre-releaseEchidna 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
andbenchmarkMode
were removed in favor oftestMode
[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]