crytic / crytic/echidna

Stops fuzzing after first assertion failure (per function)?

Open
#682 5 comments 0 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
Haskell
Stars
3.2k
Forks
432
Avg merge
1d 20h
Merged PRs (30d)
5

Description

I have been trying to run Echidna on code that contrains multiple assertions per function. It seems like Echnida stops fuzzing a function after the first violation. Is this the case?

And if so, is there an option to keep fuzzing? I have already tried setting `stopOnFail: false` in the yaml configuration.

I have created the following simple contract to reproduce this:

```Solidity
pragma solidity 0.7.6;

contract EchidnaTest {
event AssertionFailed(string message);
function TestMe1(uint256 a1, uint256 a2, uint256 a3, uint256 a4) public returns (uint256) {
if (42 < a1) {
if (1337 < a2) {
emit AssertionFailed("2"); return 2;
}
emit AssertionFailed("1"); return 1;
}
return 0;
}
function TestMe2(uint256 a1, uint256 a2, uint256 a3, uint256 a4) public returns (uint256) {
if (42 < a1) {
if (1337 < a2) {
assert(false); return 2;
}
assert(false); return 1;
}
return 0;
}
}
```

I got the following output using Echidna 1.7.2:

```
assertion in TestMe2: failed!💥
Call sequence:
TestMe2(43,90099852,17965598210198,0)

assertion in TestMe1: failed!💥
Call sequence:
TestMe1(43,0,0,0)

Unique instructions: 329
Unique codehashes: 1
Corpus size: 1
Seed: 0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.