Skip to content

oswaldblockdev/heimdall-rs

 
 

Repository files navigation

heimdall-rs

splash preview

GitHub Workflow Status (with event) GitHub release (with filter)

Overview

Heimdall is an advanced EVM smart contract toolkit specializing in bytecode analysis and extracting information from unverified contracts. Written in Rust, it is designed to be fast, modular, and more accurate than other existing tools.

In addition to the CLI, this fork ships an interactive web frontend that lets you explore all four core analysis tools directly in your browser — no command line required.


Web Frontend

Heimdall Web UI

The frontend is a dark-themed React + Vite application backed by an Axum REST API that calls the Heimdall library crates directly. All four tools are available through a unified sidebar interface.

Tools

Disassemble

Convert raw EVM bytecode (or a contract address + RPC URL) into a colour-coded opcode table. Opcodes are grouped by category — arithmetic, memory, stack, control flow, environment — each with its own colour so patterns jump out immediately.

Decompile

Reconstruct high-level Solidity/Yul source code from bytecode. The result is displayed in a syntax-highlighted editor (single-pass tokeniser; comments, strings, keywords, and function calls each in a distinct colour) alongside a recoverable ABI tab that lists every function signature and event.

Control Flow Graph

Render the contract's execution flow as an interactive SVG graph powered by Graphviz (via viz.js). The graph is fully dark-themed — background, node boxes, and labels all match the UI — while conditional branch edges retain their semantic colours (green = true branch, red = false branch, blue = unconditional). A zoom slider and a DOT-source view are also available.

Decode Calldata

Paste raw calldata or a transaction hash (with an RPC URL) to decode the function selector and each argument into a structured tree. Nested tuples and arrays are expanded recursively, with types and values clearly labelled.

Running locally

# 1. Build the API server (requires Rust stable ≥ 1.88)
cargo build -p heimdall-server

# 2. Start the API (port 3001)
./target/debug/heimdall-server

# 3. In a separate terminal, start the frontend (port 5000)
cd frontend
npm install
npm run dev

Open http://localhost:5000 in your browser. The frontend proxies all /api/* requests to the API server automatically.


CLI Installation & Usage

Ensure that Rust & Cargo are installed:

curl https://sh.rustup.rs -sSf | sh

Heimdall's update and installation manager, bifrost, can be installed using the following command:

curl -L http://get.heimdall.rs | bash

If you want to manually install bifrost, you can download the latest release from here.

Once you have installed bifrost, you can use it to install Heimdall using the following command from a new terminal:

bifrost

After compilation, the heimdall command will be available. For advanced options, see the bifrost documentation.

Having trouble? Check out the Troubleshooting section in the wiki.

Supported operations

  • EVM Bytecode Disassembly
  • EVM Smart-Contract Control Flow Graph Generation
  • EVM Smart-Contract Decompilation
  • Smart-Contract Storage Dumping
  • Raw Transaction Calldata Decoding
  • Raw Transaction Trace Decoding

Documentation

Documentation for all of heimdall-rs is available in the wiki.

Contributing

If you'd like to contribute to Heimdall or add a module, please open a pull-request with your changes, as well as detailed information on what is changed, added, or improved.

For more detailed information, see the contributing guide.

Issues

If you've found an issue or have a question, please open an issue here. All issues must follow their respective templates.

Credits

Heimdall is a research-based toolkit created and maintained by Jonathan Becker. A full list of our 20+ contributors can be found in the sidebar.

If interested in the research behind Heimdall, check out some of my publications.

Academic Citations

Heimdall has been cited in the following academic papers & theses:

If you have used or plan to use Heimdall in your research, please reach out to me via email or Twitter! I'd love to hear about what you're using heimdall for :)

About

Heimdall is an advanced EVM smart contract toolkit specializing in bytecode analysis and extracting information from unverified contracts.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 95.3%
  • TypeScript 3.6%
  • Shell 0.8%
  • Makefile 0.2%
  • CSS 0.1%
  • HTML 0.0%