Skip to content

Commit 1d313b4

Browse files
authored
Merge branch 'master' into gas-per-second-text
2 parents 967ccf1 + b573408 commit 1d313b4

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Fix worker crashes when shrinking empty reproducers (#1378)
99
* Fix shrinking sometimes not progressing (#1399)
1010
* Fix gas accounting; it was not considering the intrinsic cost of transactions (#1392)
11+
* Fix issue collecting deployed contract addresses into the dictionary (#1400)
1112
* Improved UI responsiveness (#1387)
1213
* Update `hevm` to reduce memory usage on certain scenarios (#1346)
1314
* Update `hevm` to fix multiple deployments under `prank`ing cheatcodes (#1377)

lib/Echidna/Campaign.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ evalSeq vm0 execFunc = go vm0 [] where
481481
-- NOTE: we don't use the intermediate VMs, just the last one. If any of
482482
-- the intermediate VMs are needed, they can be put next to the result
483483
-- of each transaction - `m ([(Tx, result, VM)])`
484-
(remaining, _vm) <- go vm' (tx:executedSoFar) remainingTxs
485-
pure ((tx, result) : remaining, vm')
484+
(remaining, vm'') <- go vm' (tx:executedSoFar) remainingTxs
485+
pure ((tx, result) : remaining, vm'')
486486

487487
-- | Update tests based on the return value from the given function.
488488
-- Nothing skips the update.

src/test/Tests/Values.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@ valuesTests = testGroup "Value extraction tests"
4343
, testContract "values/darray.sol" Nothing
4444
[ ("echidna_darray passed", solved "echidna_darray")
4545
, ("echidna_darray didn't shrink optimally", solvedLen 1 "echidna_darray") ]
46+
, testContract' "values/contract.sol" (Just "Test") Nothing (Just "values/contract.yaml") False FuzzWorker
47+
[ ("verify_first passed", solved "verify_first")
48+
, ("verify_later passed", solved "verify_later") ]
4649

4750
]

tests/solidity/values/contract.sol

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
contract F {
2+
bool fail;
3+
function init(bool x) public {
4+
fail = x;
5+
}
6+
7+
function is_f() public returns (bool) {
8+
return true;
9+
}
10+
11+
function f() public returns (bool) {
12+
return fail;
13+
}
14+
}
15+
16+
contract Test {
17+
bool firstRun = true;
18+
bool tested = false;
19+
20+
function spawn() public {
21+
(new F()).init(firstRun);
22+
firstRun = false;
23+
}
24+
25+
function verify_first(F f) public {
26+
require(f.is_f());
27+
assert(f.f() == true);
28+
// writes state to make it non-pure and more likely for echidna to call
29+
tested = true;
30+
}
31+
32+
function verify_later(F f) public {
33+
require(f.is_f());
34+
assert(f.f() == false);
35+
// writes state to make it non-pure and more likely for echidna to call
36+
tested = true;
37+
}
38+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
testLimit: 5000
2+
shrinkLimit: 1
3+
seqLen: 20
4+
testMode: assertion

0 commit comments

Comments
 (0)