“Understanding what the EVM is actually doing is the first step toward optimizing your gas usage.”
I’m thrilled to announce evm-lens v0.1.1, a lean, lightning-fast CLI and library that transforms raw EVM bytecode into a readable, color-coded opcode listing—all on your machine, in milliseconds.
🚀 TL;DR
-
v0.1.1 adds:
-
STDIN loader (
--stdin
) – pipe in hex from any source -
On-chain loader (
--address
) – fetch code viaeth_getCode
-
STDIN loader (
- Works with
.bin
files, raw hex, or live contracts - Pure Rust, zero external dependencies beyond
revm
- ✅ Fully tested, CI-friendly, no SaaS lock-in
cargo install evm-lens
🔍 The Pain Point
Smart-contract auditors, MEV researchers, and tooling engineers spend too much time:
- Copy-pasting hex into online disassemblers (often rate-limited or incomplete)
- Writing brittle scripts (
curl | jq | sed
) to fetch on-chain code - Context-switching between terminal, browser, and local files
By the time you’ve wrangled inputs, the actual opcode analysis feels like an afterthought.
🔧 How evm-lens Helps
1. Instant, Local Disassembly
evm-lens --file MyToken.bin | less -R
In under 10 ms, you get a line-numbered, color-coded opcode dump—no network round-trips, no web UI.
2. Flexible Input Sources
- Direct Hex
evm-lens 60FF61ABCD00
- File
evm-lens --file path/to/Token.bin
- Standard Input
echo "0x60FF61ABCD00" | evm-lens --stdin
- Blockchain Input
evm-lens --address 0xAbC… --rpc https://eth.llamarpc.com
👥 Who Should Care
- Security Auditors & Researchers Integrate evm-lens into your CI pipeline for reliable, local bytecode snapshots.
- Gas Optimizers Track opcode counts and static gas to measure PR impact instantly.
-
Tooling Authors
Import
evm-lens-core
into your Rust projects and build on a battle-tested foundation.
🔮 What’s Next
Release | Highlight |
---|---|
v0.2 |
--abi flag: resolve 4byte selectors & annotate CALL opcodes |
v0.3 |
storage-diff subcommand: slot layouts, collision grading, HTML |
v0.4 | gas-flame: offline SVG/CSV flamegraphs for gas hot-spot analysis |
v0.5 | tracing: trace live blockchain transactions locally - similar to Tenderly |
📥 Get Started
- Install or upgrade
cargo install evm-lens
- Run the CLI
# Direct hex input
evm-lens 60FF61ABCD00
# From file
evm-lens --file path/to/Token.bin
# From stdin
echo "0x60FF61ABCD00" | evm-lens --stdin
# On-chain
evm-lens --address 0xAbC… --rpc https://eth.llamarpc.com
- Explore the library
use lens_core::disassemble;
let bytecode = hex::decode("60FF61ABCD00")?;
let ops = disassemble(&bytecode)?;
for (position, opcode) in ops {
println!("{:04x}: {:?}", position, opcode);
}
Find the repo, file issues, and leave a star:
👉 https://github.com/andyrobert3/evm-lens
Thanks for reading! Your feedback drives this project—drop issues, PRs, or comments in Discussions. Let’s make EVM bytecode transparent and accessible to everyone.
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.