#Setup
-
Install the full version of solc via homebrew (not npm).
-
Clone the echidna repository by running:
git submodule add git@github.com:trailofbits/echidna.git
git submodule update --init --recursive
Make sure that theechidna
directory appears in your project root directory. (echidna is included in .gitignore) -
Install stack:
brew install haskell-stack
-
Run the following commands from inside the echidna directory. Ignore all warnings.
stack upgrade
stack setup
stack install
-
If this gives you errors involving 'readline' on MacOS, try running:
brew install readline
brew link readline --force
export LDFLAGS=-L/usr/local/opt/readline/lib
export CPPFLAGS=-I/usr/local/opt/readline/include
stack install readline --extra-include-dirs=/usr/local/opt/readline/include --extra-lib-dirs=/usr/local/opt/readline/lib
stack install
-
Add
/Users/$(whoami)/.local/bin
to yourPATH
variable:export PATH=$PATH:/Users/$(whoami)/.local/bin
-
Open
echidna_tests/config.yaml
in a text editor and replace the wordsREPLACE_WITH_PWD
with the path to the project root directory. To get this path, runecho $PWD
. -
The echidna_tests suite contains negative and positive test files.
- To run the positive tests, open
config.yaml
and set the fieldreturnType
toSuccess
. Then, run the following command from the project root directory:echidna-test echidna_tests/positive.sol Test --config="echidna_tests/config.yaml"
- To run the negative tests, open
config.yaml
and set the fieldreturnType
toFail or Throw
. Then, run the following command from the project root directory:echidna-test echidna_tests/negative.sol Test --config="echidna_tests/config.yaml"