mirror of
https://github.com/crytic/echidna.git
synced 2026-10-12 02:12:32 +00:00
* feat: name the function that found new coverage ppWorkerEvent already receives the transaction sequence behind a NewCoverage event but only reported the aggregate counters. Append the last transaction's call to the log line so it is visible which function is making progress. Co-authored-by: gustavo-grieco <[email protected]> * feat: add generic log events Add a WorkerEvent Log constructor for free-form worker messages and a CampaignEvent ServerLog for messages that are not attributable to any worker, reported with a [Server] prefix in the text UI and as a server_log SSE event. All four exhaustive matches over these types (the ToJSON instances, the pretty printers and the SSE event names) land together so the compiler stays happy. Co-authored-by: gustavo-grieco <[email protected]> * fix(tests): return the flag from flags.sol set0/set1 Both functions are declared 'returns (bool)' but fall off the end, so solc warns and they silently return false. Co-authored-by: gustavo-grieco <[email protected]> * chore: gitignore Python artifacts Co-authored-by: gustavo-grieco <[email protected]> * fix(worker): avoid hlint false positive on record-dot access CI runs bare `hlint lib src`, which does not read echidna.cabal and so does not know OverloadedRecordDot is on. It parsed `(last txs).call` as function composition and flagged the parens as a redundant bracket. Taking that suggestion would have broken the build: under OverloadedRecordDot, `last txs.call` parses as `last (txs.call)`. Bind the last transaction first so the expression needs no parens and reads identically to hlint and to GHC. --------- Co-authored-by: gustavo-grieco <[email protected]>
34 lines
621 B
Solidity
34 lines
621 B
Solidity
contract Test {
|
|
event Flag(bool);
|
|
|
|
bool private flag0 = true;
|
|
bool private flag1 = true;
|
|
|
|
function set0(int val) public returns (bool){
|
|
if (val % 100 == 0)
|
|
flag0 = false;
|
|
return flag0;
|
|
}
|
|
|
|
function set1(int val) public returns (bool){
|
|
if (val % 10 == 0 && !flag0)
|
|
flag1 = false;
|
|
return flag1;
|
|
}
|
|
|
|
function echidna_alwaystrue() public returns (bool){
|
|
return(true);
|
|
}
|
|
|
|
function echidna_revert_always() public returns (bool){
|
|
revert();
|
|
}
|
|
|
|
function echidna_sometimesfalse() public returns (bool){
|
|
emit Flag(flag0);
|
|
emit Flag(flag1);
|
|
return(flag1);
|
|
}
|
|
|
|
}
|