Skip to content

Commit 99b04d5

Browse files
committed
Improvements
1 parent 532d0eb commit 99b04d5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

program-analysis/echidna/advanced/using-all-contracts.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
**Table of contents:**
44

5-
- [Understanding and using `allContracts` in Echidna](#understanding-and-using-allcontracts-in-echidna)
5+
- [Understanding and using `allContracts` in Echidna](#understanding-and-using-allContracts-in-echidna)
66
- [Introduction](#introduction)
7-
- [What is `allContracts` testing?](#what-is-allcontracts-testing)
8-
- [When and how to use `allContracts`](#when-and-how-to-use-allcontracts)
7+
- [What is `allContracts` testing?](#what-is-allContracts-testing)
8+
- [When and how to use `allContracts`](#when-and-how-to-use-allContracts)
99
- [Run Echidna](#run-echidna)
10-
- [Example run with `allContracts` set to `false`](#example-run-with-allcontracts-set-to-false)
11-
- [Example run with `allContracts` set to `true`](#example-run-with-allcontracts-set-to-true)
10+
- [Example run with `allContracts` set to `false`](#example-run-with-allContracts-set-to-false)
11+
- [Example run with `allContracts` set to `true`](#example-run-with-allContracts-set-to-true)
1212
- [Use cases and conclusions](#use-cases-and-conclusions)
1313

1414
## Introduction
1515

1616
This tutorial is written as a hands-on guide to using `allContracts` testing in Echidna. You will learn what `allContracts` testing is, how to use it in your tests, and what to expect from its usage.
1717

18-
**Important note**: this feature used to be called `multi-abi` but it was later renamed to `allContracts` in Echidna 2.1.0. As expected, this version or later is required for this tutorial.
18+
> This feature used to be called `multi-abi` but it was later renamed to `allContracts` in Echidna 2.1.0. As expected, this version or later is required for this tutorial.
1919
2020
## What is `allContracts` testing?
2121

@@ -71,7 +71,7 @@ contract EchidnaTest {
7171
}
7272
```
7373

74-
Without using `allContracts` in a fuzzing campaign, Echidna is not able to break the invariant, because it only interacts with `EchidnaTest` functions. However, if we use the following configuration file, enabling `allContracts` testing, the invariant is broken. You can access [allContracts.yaml here](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/example/allContracts.yaml).
74+
In a non `allContracts` fuzzing campaign, Echidna is not able to break the invariant, because it only interacts with `EchidnaTest` functions. However, if we use the following configuration file, enabling `allContracts` testing, the invariant is broken. You can access [allContracts.yaml here](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/echidna/example/allContracts.yaml).
7575

7676
```yaml
7777
testMode: assertion
@@ -122,4 +122,4 @@ Testing with `allContracts` is a useful tool for complex systems that require th
122122
123123
A side-effect of using `allContracts` is that the search space grows with the number of functions that can be called. This, combined with high values of sequence lengths, can make the fuzzing test not so thorough, because the dimension of the search space is simply too big to reasonably explore. Finally, adding more functions as fuzzing candidates makes the campaigns to take up more execution time.
124124
125-
A final remark is that `allContracts` testing in assertion mode ignores all assert failures from the contracts not under test. This is shown in `Flag.test_fail()` function: even though it explicitly asserts false, the Echidna test ignores it.
125+
A final remark is that `allContracts` testing in assertion mode ignores all assert failures from the contracts not under test. This is shown in `Flag.test_fail()` function: even though it explicitly asserts false, the Echidna test ignores it.

0 commit comments

Comments
 (0)