Skip to content

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 return true. Otherwise, if it returns false or reverts, the invariant fails. This is the default behavior, with the testing mode "property".
  • Solidity assertions/events: assert(..) and event AssertionFailure(..). An invariant fails if there is a call assert with a false parameter or there is an event with the AssertionFailure(..). 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.

Clone this wiki locally