Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

# Optik

Optik is a set of symbolic execution tools that assist smart contract fuzzers, letting them run in a _hybrid_ mode. Optik couples [Echidna](https://github.com/crytic/echidna), our smart contract fuzzer, with the [Maat](https://github.com/trailofbits/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:

  • Symbolic KECCAK hashes are not supported

  • CREATE2, CALLCODE, and DELEGATECALL are not yet supported

  • Gas is not taken into account

  • Some echidna options are not yet supported (see hybrid-echidna -h)

## Hybrid Echidna

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

Optik allows to run the [Echidna](https://github.com/crytic/echidna) smart-contract fuzzer in _hybrid_ mode. It basically couples Echidna with the [Maat](https://github.com/trailofbits/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](https://github.com/crytic/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:

  • –max-iters: maximum number of fuzzing iterations to perform (one iteration is one Echidna campaign + one symbolic executor run on the corpus)

  • –solver-timeout: maximum time in milliseconds to spend solving each possible new input

  • –incremental-threshold: number of initial incremental seeding steps to perform

  • –no-incremental: skip initial incremental seeding

  • –cov-mode: type of coverage to increase when solving new inputs. Most coverage modes are implemented for experimental purposes. Unless you are developing/hacking on Optik, we recommend to keep the default mode

Debugging, logging and terminal display:

  • –debug: add debugging information to the log output

  • –logs: write logs to a given file (or stdout)

  • –no-display: disable the graphical terminal display

## Installation

For a quick installation, run:

`console python3 -m pip install optik-tools `

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

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

You can also run it from Docker:

`console 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 `

Metadata

Release files for optik-tools 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optik-tools 0.0.2
File Size Uploaded
optik-tools-0.0.2.tar.gz 54.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for optik-tools 0.0.2
File Interpreter ABI Platform
optik_tools-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 115.1 kB

Release files / optik-tools-0.0.2.tar.gz

Download URL optik-tools-0.0.2.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
eda23d4b0d0c591d7e665ca9385f00ba6be70c1fba0a0d7c9531421cbfad065f
BLAKE2b-256 checksum
How to use checksums
89d04388de6881c6107ea8b1b5d7f04b55caabd1c360366a59cfd99e20475b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Release files / optik_tools-0.0.2-py3-none-any.whl

Download URL optik_tools-0.0.2-py3-none-any.whl
Size 60.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c245bfdfb4bb7c3f16a19e4b4e4c33ebeafbe5858f67f9c708e96c9c73d08a72
BLAKE2b-256 checksum
How to use checksums
884482354cf7cac740f51d018b5b478e94063dfb6058c824e0c447e33a7e501f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page