Mark Spanbroek 42d4778dcc [fuzzing] compile contracts before invoking docker
Ensures that `npm run fuzz` will succeed whether or
not the contracts were compiled beforehand.
2023-06-19 14:58:47 +02:00

29 lines
617 B
Bash
Executable File

#!/bin/bash
set -e
root=$(cd $(dirname "$0")/.. && pwd)
if command -v echidna-test; then
fuzz () {
echidna-test ${root} \
--config ${root}/fuzzing/echidna.yaml \
--corpus-dir ${root}/fuzzing/corpus \
--crytic-args --ignore-compile \
--contract $1
}
else
fuzz () {
docker run \
--rm \
-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"
}
fi
fuzz FuzzMarketplace