Move echidna action to crytic/echidna-action (#701)

This removes the action from the echidna repository. The action will
now live on its own repository, where it can be versioned and published
independently.

Additionally, this updates the workflow to refer to the action on its
new location, as well as adds a few lines to the README pointing to the
new action location.
pull/711/head
Emilio López 3 years ago committed by GitHub
parent ff36688977
commit 8180d332c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/action.yml
  2. 7
      README.md
  3. 5
      action/Dockerfile
  4. 63
      action/action.yml
  5. 47
      action/entrypoint.sh

@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v2
- name: Assert test
uses: ./action
uses: crytic/echidna-action@v1
with:
files: "examples/solidity/basic/assert.sol"
contract: "TestAssert"
@ -26,7 +26,7 @@ jobs:
negate-exit-status: 1
- name: Multi-abi test
uses: ./action
uses: crytic/echidna-action@v1
with:
files: "examples/solidity/basic/multi-abi.sol"
contract: "B"

@ -152,6 +152,13 @@ subject to change to be slightly more user friendly at a later date. `testType`
will either be `property` or `assertion`, and `status` always takes on either
`fuzzing`, `shrinking`, `solved`, `passed`, or `error`.
### Using Echidna in a GitHub Actions workflow
There is an Echidna action which can be used to run `echidna-test` as part of a
GitHub Actions workflow. Please refer to the
[crytic/echidna-action](https://github.com/crytic/echidna-action) repository for
usage instructions and examples.
## Limitations and known issues
EVM emulation and testing is hard. Echidna has a number of limitations in the latest release. Some of these are inherited from [hevm](https://github.com/dapphub/dapptools/tree/master/src/hevm) while some are results from design/performance decisions or simply bugs in our code. We list them here including their corresponding issue and the status ("wont fix", "in review", "fixed"). Issues that are "fixed" are expected to be included in the next Echidna release.

@ -1,5 +0,0 @@
FROM trailofbits/echidna
RUN pip3 install solc-select
COPY entrypoint.sh /entrypoint.sh
RUN chmod ugo+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

@ -1,63 +0,0 @@
name: "Echidna"
description: "Run echidna-test"
inputs:
files:
description: "Solidity files to analyze"
required: true
contract:
description: "Contract to analyze"
required: false
config:
description: "Config file (CLI arguments override config options)"
required: false
format:
description: "Output format: json, text, none. Disables interactive UI"
required: false
corpus-dir:
description: "Directory to store corpus and coverage data"
required: false
check-asserts:
description: "Check asserts in the code"
required: false
multi-abi:
description: "Use multi-abi mode of testing"
required: false
test-limit:
description: "Number of sequences of transactions to generate during testing"
required: false
shrink-limit:
description: "Number of tries to attempt to shrink a failing sequence of transactions"
required: false
seq-len:
description: "Number of transactions to generate during testing"
required: false
contract-addr:
description: "Address to deploy the contract to test"
required: false
deployer:
description: "Address of the deployer of the contract to test"
required: false
sender:
description: "Addresses to use for the transactions sent during testing"
required: false
seed:
description: "Run with a specific seed"
required: false
crytic-args:
description: "Additional arguments to use in crytic-compile for the compilation of the contract to test"
required: false
solc-args:
description: "Additional arguments to use in solc for the compilation of the contract to test"
required: false
solc-version:
description: "Version of the Solidity compiler to use"
required: false
negate-exit-status:
description: "Apply logical NOT to echidna-test's exit status (for testing the action)"
required: false
runs:
using: "docker"
image: "Dockerfile"

@ -1,47 +0,0 @@
#! /bin/bash
set -eu
export PYTHONPATH=/root/.local/lib/python3.6/site-packages
OPTIONS="contract config format corpus-dir test-limit shrink-limit seq-len \
contract-addr deployer sender seed crytic-args solc-args"
SWITCHES="check-asserts multi-abi"
# smoelius: `get` works for non-standard variable names like `INPUT_CORPUS-DIR`.
get() {
env | sed -n "s/^$1=\(.*\)/\1/;T;p"
}
CMD=(echidna-test "$INPUT_FILES")
for OPTION in $OPTIONS; do
NAME=INPUT_"${OPTION^^}"
VALUE="$(get "$NAME")"
if [[ -n "$VALUE" ]]; then
CMD+=(--"$OPTION" "$VALUE")
fi
done
for SWITCH in $SWITCHES; do
NAME=INPUT_"${SWITCH^^}"
VALUE="$(get "$NAME")"
if [[ -n "$VALUE" ]]; then
CMD+=(--"$SWITCH")
fi
done
SOLC_VERSION="$(get 'INPUT_SOLC-VERSION')"
if [[ -n "$SOLC_VERSION" ]]; then
solc-select install "$SOLC_VERSION"
solc-select use "$SOLC_VERSION"
fi
echo "${CMD[@]}" >&2
if [[ -n "$(get 'INPUT_NEGATE-EXIT-STATUS')" ]]; then
! "${CMD[@]}"
else
"${CMD[@]}"
fi
Loading…
Cancel
Save