-
Notifications
You must be signed in to change notification settings - Fork 366
Testing modes
Gustavo Grieco edited this page Mar 18, 2022
·
1 revision
Echidna allows invariants to be written in different forms:
- Echidna properties:
function f() returns (bool)
: An invariant hold if this function returntrue
. Otherwise, if it returnsfalse
or reverts, the invariant fails. This is the default behavior, with the testing mode "property". - Solidity assertions/events:
assert(..)
andevent AssertionFailure(..)
. An invariant fails if there is a callassert
with a false parameter or there is an event with theAssertionFailure(..)
. This is enabled using the testing mode "assertion". - Dapp/Foundry fuzz tests:
function f(..)
: An invariant fails if the function reverts. Otherwise, the invariant holds. This is enabled using the testing mode "dappfoundry".
Additionally, echidna allows to specify the number of transactions before the EVM is resetted using seqLen
parameter. For instance, if it is equal to 1
, all the tests will be forced to be stateless.