Registry / blockchain / evmdasm

evmdasm

JSON →
library0.1.10pypypi✓ verified 79d ago

A lightweight Ethereum EVM bytecode assembler/disassembler and instruction registry library. Version 0.1.10 is the latest release; the project appears to be in maintenance mode with no recent updates.

pip install evmdasm
INSTALL
IMPORT
SIG · EVMDASM
E
evmdasm
blockchainpythonv0.1.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EvmBytecode
from evmdasm import EvmBytecode
from evmdasm import EvmCode
EvmDisassembler
from evmdasm import EvmDisassembler
EvmInstructions
from evmdasm import EvmInstructions

Disassemble an EVM bytecode string and print the instruction names and operands.

from evmdasm import EvmCode bytecode = "0x60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680600357" codes = EvmCode(bytecode) codes.disassemble() for instruction in codes.instructions: print(instruction.name, instruction.operand)
Debug
Known issues
gotchaEvmCode expects a hex string without '0x' prefix. If you include '0x', it may silently fail or raise an exception.
fix
Strip the '0x' prefix before passing to EvmCode: EvmCode(bytecode[2:])
affects: all
gotchaThe 'disassemble()' method returns nothing; it populates the 'instructions' attribute. A common mistake is to assign the return value, which is None.
fix
Call codes.disassemble() and then access codes.instructions.
affects: all
Upgrade
Version history
0.1.10latest on PyPI · released Mar 11, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
evmdasm — pip install evmdasm · libregistry