

EVMole is a powerful library that extracts information from Ethereum Virtual Machine (EVM) bytecode, including function selectors, arguments, state mutability, persistent and transient storage layouts, and CBOR metadata, even for unverified contracts.
Key Features
- Multi-language support: Available as JavaScript, Rust, Python, and Go libraries.
- High accuracy and performance: Outperforms existing tools.
- Broad compatibility: Tested with both Solidity and Vyper compiled contracts.
- Lightweight: Clean codebase with minimal external dependencies.
- Unverified contract analysis: Extracts information even from unverified bytecode.
- Selector dispatch classification: Distinguishes normal ABI dispatch from selectors handled by fallback logic.
- CBOR metadata: Extracts string-keyed values from a terminal, length-suffixed CBOR map without assuming a particular compiler.
Usage
JavaScript
API documentation and usage examples (Node.js, Vite, webpack, Parcel, esbuild)
import { contractInfo } from 'evmole'
const code = '0x6080604052348015600e575f80fd5b50600436106030575f3560e01c80632125b65b146034578063b69ef8a8146044575b5f80fd5b6044603f3660046046565b505050565b005b5f805f606084860312156057575f80fd5b833563ffffffff811681146069575f80fd5b925060208401356001600160a01b03811681146083575f80fd5b915060408401356001600160e01b0381168114609d575f80fd5b80915050925092509256'
console.log( contractInfo(code, {selectors:true, arguments:true, stateMutability:true}) )
// {
// functions: [
// {
// selector: '2125b65b',
// bytecodeOffset: 52,
// dispatch: 'abi',
// arguments: 'uint32,address,uint224',
// stateMutability: 'pure'
// },
// ...
Rust
Documentation is available on docs.rs
let code = hex::decode("6080604052348015600e575f80fd5b50600436106030575f3560e01c80632125b65b146034578063b69ef8a8146044575b5f80fd5b6044603f3660046046565b505050565b005b5f805f606084860312156057575f80fd5b833563ffffffff811681146069575f80fd5b925060208401356001600160a01b03811681146083575f80fd5b915060408401356001600160e01b0381168114609d575f80fd5b80915050925092509256").unwrap();
println!("{:?}", evmole::contract_info(
evmole::ContractInfoArgs::new(&code)
.with_selectors()
.with_arguments()
.with_state_mutability()
)
);
// Contract {
// functions: Some([
// Function {
// selector: [33, 37, 182, 91],
// bytecode_offset: 52,
// dispatch: Abi,
// arguments: Some([Uint(32), Address, Uint(224)]),
// state_mutability: Some(Pure)
// },
// ...
Python
API documentation
pip install evmole --upgrade
from evmole import contract_info
code = '0x6080604052348015600e575f80fd5b50600436106030575f3560e01c80632125b65b146034578063b69ef8a8146044575b5f80fd5b6044603f3660046046565b505050565b005b5f805f606084860312156057575f80fd5b833563ffffffff811681146069575f80fd5b925060208401356001600160a01b03811681146083575f80fd5b915060408401356001600160e01b0381168114609d575f80fd5b80915050925092509256'
print( contract_info(code, selectors=True, arguments=True, state_mutability=True) )
# Contract(
# functions=[
# Function(
# selector=2125b65b,
# bytecode_offset=52,
# dispatch="abi",
# arguments=uint32,address,uint224,
# state_mutability=pure),
# ...
Go
API documentation
go get github.com/cdump/evmole/go
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/cdump/evmole/go"
)
func main() {
code, _ := hex.DecodeString("6080604052348015600e575f80fd5b50600436106030575f3560e01c80632125b65b146034578063b69ef8a8146044575b5f80fd5b6044603f3660046046565b505050565b005b5f805f606084860312156057575f80fd5b833563ffffffff811681146069575f80fd5b925060208401356001600160a01b03811681146083575f80fd5b915060408401356001600160e01b0381168114609d575f80fd5b80915050925092509256")
info, _ := evmole.ContractInfo(context.Background(), code, evmole.Options{
Selectors: true,
Arguments: true,
StateMutability: true,
})
for _, fn := range info.Functions {
fmt.Printf("%s: %s @ %d\n", fn.Selector, *fn.Arguments, fn.BytecodeOffset)
}
// 2125b65b: uint32,address,uint224 @ 52
// b69ef8a8: @ 68
}
Foundry
Foundry's cast uses the Rust implementation of EVMole
$ cast selectors $(cast code 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
0x06fdde03 view
0x095ea7b3 address,uint256 nonpayable
0x18160ddd view
0x23b872dd address,address,uint256 nonpayable
...
$ cast selectors --resolve $(cast code 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
0x06fdde03 view name()
0x095ea7b3 address,uint256 nonpayable approve(address,uint256)
0x18160ddd view totalSupply()
0x23b872dd address,address,uint256 nonpayable transferFrom(address,address,uint256)
...
AI agents
For application code, use one of the language bindings above. For agent-driven
bytecode analysis, choose one integration.
JSON CLI
Use for one-off analysis and scripts:
npx -y evmole analyze --bytecode 0x...
Portable skill
Install routing and interpretation guidance for supported agents:
npx skills add cdump/evmole --skill evm-bytecode-analysis -g
Local MCP server
Expose EVMole as a typed local tool:
All integrations expect deployed/runtime bytecode and run locally without
sending bytecode to an EVMole-operated service. See the
agent integration guide for setup, schemas,
limitations, and privacy details.
Benchmark
function selectors
FP/FN - False Positive/False Negative errors; smaller is better
| Dataset | | evmole rs Β· js Β· py Β· go | whatsabi | sevm | evmhound | heimdall |
coverage2k solidity
2000 addresses
45650 functions | FP addrs | 0 π₯ | 4 | 1 | 56 | 3 |
| FN addrs | 0 π₯ | 11 | 0 π₯ | 224 | 166 |
| FP funcs | 0 π₯ | 10 | 10 | 616 | 27 |
| FN funcs | 0 π₯ | 145 | 0 π₯ | 821 | 342 |
| Time | 24ms Β· 0.3s Β· 31ms Β· 0.1s | 2.0s | 28s(*) | 86ms | 111s(*) |
|
random10k solidity
10000 addresses
223316 functions | FP addrs | 0 π₯ | 19 | 16 | 224 | 7 |
| FN addrs | 0 π₯ | 44 | 1 | 838 | 819 |
| FP funcs | 0 π₯ | 65 | 112 | 3157 | 260 |
| FN funcs | 0 π₯ | 173 | 7 | 4112 | 1021 |
| Time | 0.1s Β· 0.8s Β· 0.2s Β· 0.8s | 7.1s | 80s(*) | 0.4s | 533s(*) |
|
coverage1k vyper
1000 addresses
38759 functions | FP addrs | 0 π₯ | 560 | 0 π₯ | 2 | 0 π₯ |
| FN addrs | 0 π₯ | 998 | 788 | 525 | 998 |
| FP funcs | 0 π₯ | 560 | 0 π₯ | 5 | 0 π₯ |
| FN funcs | 0 π₯ | 38759 | 34077 | 16218 | 38759 |
| Time | 91ms Β· 0.4s Β· 0.1s Β· 0.3s | 1.9s | 5.4s(*) | 67ms | 12s(*) |