mirror of
https://github.com/status-im/dagger-contracts.git
synced 2025-01-31 00:36:08 +00:00
42d4778dcc
Ensures that `npm run fuzz` will succeed whether or not the contracts were compiled beforehand.
29 lines
617 B
Bash
Executable File
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
|