Skip to content

The evm_bytes CLI

Convert the given EVM bytes to EEST's python opcodes or assembly string.

The input can be either a hex string or a binary file containing EVM bytes.

evm_bytes hex-string <bytecode>

Process a hex string representing EVM bytes and convert it into EEST's Python opcodes.

Parameters:

Name Type Description Default
hex_string str

The hex string representing the EVM bytes.

required
assembly bool

Whether to print the output as assembly or Python opcodes.

required

Returns:

Type Description
str

The processed EVM opcodes in Python or assembly format.

Convert a hex string to EEST Python Opcodes
uv run evm_bytes hex-string 604260005260206000F3

Output:

Op.PUSH1[0x42] + Op.PUSH1[0x0] + Op.MSTORE + Op.PUSH1[0x20] + Op.PUSH1[0x0] + Op.RETURN
Convert a hex string to assembly
uv run evm_bytes hex-string --assembly 604260005260206000F3

Output:

push1 0x42
push1 0x00
mstore
push1 0x20
push1 0x00
return

evm_bytes binary-file <contract.bin>

Convert the given EVM bytes binary file.

Parameters:

Name Type Description Default
binary_file_path BinaryIO

A binary file containing EVM bytes to be processed or use - to read from stdin.

required
assembly bool

Whether to print the output as assembly or Python opcodes.

required
Convert the Withdrawal Request contract to assembly
uv run evm_bytes binary-file ./src/ethereum_test_forks/forks/contracts/withdrawal_request.bin --assembly

Output:

caller
push20 0xfffffffffffffffffffffffffffffffffffffffe
eq
push1 0x90
jumpi
...