You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-12
Original file line number
Diff line number
Diff line change
@@ -128,25 +128,18 @@ testMode: assertion
128
128
testLimit: 100000
129
129
deployer: "0x10000"
130
130
sender: ["0x10000", "0x20000", "0x30000"]
131
+
# Uncomment the following line for external testing
132
+
#allContracts: true
131
133
```
132
134
133
-
If you're using external testing, you will also need to specify:
134
-
135
-
```yaml
136
-
allContracts: true
137
-
```
138
-
139
-
To perform more than one test, save the files with a descriptive path, to identify what test each file or corpus belongs to. For these examples, we use `tests/crytic/erc20/echidna-internal.yaml` and `tests/crytic/erc20/echidna-external.yaml` for the Echidna tests for ERC20. We recommended to modify the `corpusDir` for external tests accordingly.
140
-
141
-
The above configuration will start Echidna in assertion mode. Contract will be deployed from address `0x10000`, and transactions will be sent from the owner and two different users (`0x20000` and `0x30000`). There is an initial limit of `100000` tests, but depending on the token code complexity, this can be increased. Finally, once Echidna finishes the fuzzing campaign, corpus and coverage results will be available in the `tests/crytic/erc20/echidna-corpus-internal` directory.
142
-
143
135
**Medusa**
144
136
145
137
Create the following Medusa config file:
146
138
147
139
```json
148
140
{
149
141
"fuzzing": {
142
+
"testLimit": 100000,
150
143
"corpusDirectory": "tests/medusa-corpus",
151
144
"deployerAddress": "0x10000",
152
145
"senderAddresses": [
@@ -164,6 +157,10 @@ Create the following Medusa config file:
164
157
"enabled": false,
165
158
},
166
159
},
160
+
// Uncomment the following lines for external testing
161
+
// "testing": {
162
+
// "testAllContracts": true
163
+
// },
167
164
"compilation": {
168
165
"platform": "crytic-compile",
169
166
"platformConfig": {
@@ -176,15 +173,17 @@ Create the following Medusa config file:
176
173
}
177
174
```
178
175
176
+
To perform more than one test, save the files with a descriptive path, to identify what test each file or corpus belongs to. For instace, for these examples, we use `tests/crytic/erc20/echidna-internal.yaml` and `tests/crytic/erc20/echidna-external.yaml` for the Echidna tests for ERC20. We recommended to modify the corpus directory config opction for external tests accordingly.
177
+
178
+
The above configuration will start Echidna or Medusa in assertion mode. The target contract(s) will be deployed from address `0x10000`, and transactions will be sent from the owner as well as two different users (`0x20000` and `0x30000`). There is an initial limit of `100000` tests, but depending on the token code complexity, this can be increased. Finally, once our fuzzing tools finish the fuzzing campaign, corpus and coverage results will be available in the specified corpus directory.
179
+
179
180
#### Run
180
181
181
182
**Echidna**
182
183
183
184
- For internal testing: `echidna . --contract CryticERC20InternalHarness --config tests/crytic/erc20/echidna-internal.yaml`
184
185
- For external testing: `echidna . --contract CryticERC20ExternalHarness --config tests/crytic/erc20/echidna-external.yaml`
185
186
186
-
Finally, inspect the coverage report in `tests/crytic/erc20/echidna-corpus-internal` or `tests/crytic/erc20/echidna-corpus-external` when it finishes.
0 commit comments