2023-01-30 10:32:30 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2023-01-30 14:35:14 +01:00
|
|
|
|
2023-01-30 17:44:34 +01:00
|
|
|
root=$(cd $(dirname "$0")/.. && pwd)
|
|
|
|
|
2023-01-30 14:35:14 +01:00
|
|
|
if command -v echidna-test; then
|
|
|
|
fuzz () {
|
2023-01-30 17:44:34 +01:00
|
|
|
echidna-test ${root} \
|
|
|
|
--config ${root}/fuzzing/echidna.yaml \
|
|
|
|
--corpus-dir ${root}/fuzzing/corpus \
|
2023-02-28 16:32:47 +01:00
|
|
|
--crytic-args --ignore-compile \
|
2023-01-30 14:35:14 +01:00
|
|
|
--contract $1
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fuzz () {
|
|
|
|
docker run \
|
|
|
|
--rm \
|
2023-01-30 17:44:34 +01:00
|
|
|
-v ${root}:/src ghcr.io/crytic/echidna/echidna \
|
2023-01-30 14:35:14 +01:00
|
|
|
bash -c \
|
|
|
|
"cd /src && echidna-test . \
|
|
|
|
--config fuzzing/echidna.yaml \
|
2023-01-30 17:44:34 +01:00
|
|
|
--corpus-dir fuzzing/corpus \
|
2023-01-30 14:35:14 +01:00
|
|
|
--crytic-args --ignore-compile \
|
|
|
|
--contract $1"
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
|
|
|
fuzz FuzzMarketplace
|