[fuzzing] allow fuzz.sh to be called from any directory
This commit is contained in:
parent
25f52c72b1
commit
c1b412c589
|
@ -2,5 +2,4 @@
|
|||
|
||||
testMode: "assertion" # check that solidity asserts are never triggered
|
||||
multi-abi: true # allow calls to e.g. TestToken in test scenarios
|
||||
corpusDir: "fuzzing/corpus" # collect coverage maximizing corpus in this dir
|
||||
format: "text" # disable interactive ui
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
root=$(cd $(dirname "$0")/.. && pwd)
|
||||
|
||||
if command -v echidna-test; then
|
||||
fuzz () {
|
||||
echidna-test . \
|
||||
--config fuzzing/echidna.yaml \
|
||||
echidna-test ${root} \
|
||||
--config ${root}/fuzzing/echidna.yaml \
|
||||
--corpus-dir ${root}/fuzzing/corpus \
|
||||
--contract $1
|
||||
}
|
||||
else
|
||||
fuzz () {
|
||||
docker run \
|
||||
--rm \
|
||||
-v `pwd`:/src ghcr.io/crytic/echidna/echidna \
|
||||
-v ${root}:/src ghcr.io/crytic/echidna/echidna \
|
||||
bash -c \
|
||||
"cd /src && echidna-test . \
|
||||
--config fuzzing/echidna.yaml \
|
||||
--corpus-dir fuzzing/corpus \
|
||||
--crytic-args --ignore-compile \
|
||||
--contract $1"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue