Skip to main content

# EVM CFG BUILDER [![Build Status](https://travis-ci.org/crytic/evm_cfg_builder.svg?branch=master)](https://travis-ci.org/crytic/evm_cfg_builder) [![Slack Status](https://empireslacking.herokuapp.com/badge.svg)](https://empireslacking.herokuapp.com) [![PyPI version](https://badge.fury.io/py/evm-cfg-builder.svg)](https://badge.fury.io/py/evm-cfg-builder)

evm-cfg-builder is used to extract a control flow graph (CFG) from EVM bytecode. It is used by Ethersplay, Manticore, and other tools from Trail of Bits. It is a reliable foundation to build program analysis tools for EVM.

We encourage contributions that address any known [issues](https://github.com/trailofbits/evm_cfg_builder/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and will pay out bounties for accepted PRs. Join us on the [Empire Hacking Slack](https://empireslacking.herokuapp.com) to discuss using or extending evm-cfg-builder.

## Features

  • Reliably recovers a Control Flow Graph (CFG) from EVM bytecode using a dedicated Value Set Analysis

  • Recovers functions names

  • Recovers attributes (e.g., payable, view, pure)

  • Outputs the CFG to a dot file

  • Library API

## Usage

### Command line

To export basic dissassembly information, run: ` evm-cfg-builder mycontract.evm `

To export the CFG of each function (dot format), run: ` evm-cfg-builder mycontract.evm --export-dot my_dir `

dot files can be read using xdot.

### Library See [examples/explore_cfg.py](examples/explore_cfg.py) and [examples/explore_functions.py](examples/explore_functions.py) for library examples.

## How to install

### Using Pip ` $ pip install evm-cfg-builder `

### Using Git ` git clone https://github.com/trailofbits/evm_cfg_builder pip install . `

## Requirements

## Getting Help

Feel free to stop by our [Slack channel](https://empireslacking.herokuapp.com) (#ethereum) for help using or extending evm-cfg-builder.

## License

evm-cfg-builder is licensed and distributed under the AGPLv3. [Contact us](mailto:opensource@trailofbits.com) if you’re looking for an exception to the terms.

Metadata

Release files for evm-cfg-builder 0.3.1

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

Source distribution (sdist)

Source distribution for evm-cfg-builder 0.3.1
File Size Uploaded
evm-cfg-builder-0.3.1.tar.gz 1.3 MB Details

Release files / evm-cfg-builder-0.3.1.tar.gz

Download URL evm-cfg-builder-0.3.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
eb9e8c268f0c678348bc022a40ab028c4a15211a2b2ab3d2fccf3b7874f6f926
BLAKE2b-256 checksum
How to use checksums
0b2e0d80d22647c485dc48d76a7d10730432acfd98314fcdcff5353a61225583
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file

0.3.0

1 release file

0.2.0

2 release files

0.1.0

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