Home

Awesome

Optik

Optik is a set of symbolic execution tools that assist smart contract fuzzers, letting them run in a hybrid mode. Optik couples Echidna, our smart contract fuzzer, with the Maat symbolic executor that replays the fuzzing corpus and extends it with new inputs that increase coverage.

Current limitations

Optik is a work in progress and should not be used for real audits yet. Current limitations include:

Hybrid Echidna

<p align="center" > <img width="80%" src=".resources/hybrid_echidna.png"/> <br> </p>

Optik allows to run the Echidna smart-contract fuzzer in hybrid mode. It basically couples Echidna with the Maat symbolic executor that replays the Echidna corpus and extends it with new inputs that increase coverage.

hybrid-echidna starts with several <i>incremental seeding</i> steps, where it seeds the corpus with short transactions sequences obtained by Slither's dataflow analysis, and uses symbolic execution more intensely to solve new inputs. The sequence length is incremented at each seeding step. Once it reaches a certain length threshold, hybrid-echidna falls back into its normal mode, starts to limit the number of symbolic inputs to solve, and stops using dataflow analysis for seeding the corpus.

Usage

Hybrid echidna can be used seamlessly in place of regular Echidna by replacing echidna-test with hybrid-echidna in your Echidna command line. For example:

hybrid-echidna MyContract.sol  --test-mode assertion --corpus-dir /tmp/test --contract MyContract

Additionnal options are available in hybrid mode to control hybrid-echidna's behaviour:

Debugging, logging and terminal display:

Installation

For a quick installation, run:

python3 -m pip install optik-tools

To keep up with the latest features and fixes, install Optik from its master branch:

git clone https://github.com/crytic/optik && cd optik
python3 -m pip install .

You can also run it from Docker:

git clone https://github.com/crytic/optik && cd optik
docker build -t crytic/optik .
docker run -it --rm --mount type=bind,source="$(pwd)",target=/workdir crytic/optik
# This runs the Docker container, mounting the local directory into /workdir