codex-contracts-eth/fuzzing/fuzz.sh

29 lines
602 B
Bash
Raw Normal View History

#!/bin/bash
set -e
2023-01-30 13:35:14 +00:00
root=$(cd $(dirname "$0")/.. && pwd)
2023-05-30 13:38:08 +00:00
if command -v echidna; then
2023-01-30 13:35:14 +00:00
fuzz () {
2023-05-30 13:38:08 +00:00
echidna ${root} \
--config ${root}/fuzzing/echidna.yaml \
--corpus-dir ${root}/fuzzing/corpus \
--crytic-args --ignore-compile \
2023-01-30 13:35:14 +00:00
--contract $1
}
else
fuzz () {
docker run \
--rm \
-v ${root}:/src ghcr.io/crytic/echidna/echidna \
2023-01-30 13:35:14 +00:00
bash -c \
2023-05-30 13:38:08 +00:00
"cd /src && echidna . \
2023-01-30 13:35:14 +00:00
--config fuzzing/echidna.yaml \
--corpus-dir fuzzing/corpus \
2023-01-30 13:35:14 +00:00
--crytic-args --ignore-compile \
--contract $1"
}
fi
fuzz FuzzMarketplace