Crate bytecode

Expand description

Crate that contains bytecode types and opcode constants.

EOF bytecode contains its verification logic and only valid EOF bytecode can be created.

Legacy bytecode will always contain a jump table.

While EIP-7702 bytecode must contains a Address.

Modules§

bitvec
bytecode
decode_errors
eip7702
eof
legacy
opcode
EVM opcode definitions and utilities. It contains opcode information and utilities to work with opcodes.
utils

Structs§

Eof
EVM Object Format (EOF) container
JumpTable
A table of valid jump destinations. Cheap to clone and memory efficient, one bit per opcode.
LegacyAnalyzedBytecode
Legacy analyzed bytecode represents the original bytecode format used in Ethereum.
LegacyRawBytecode
Used only as intermediate representation for legacy bytecode. Please check LegacyAnalyzedBytecode for the main structure that is used in Revm.

Enums§

Bytecode
Main bytecode structure with all variants.
BytecodeDecodeError
EOF decode errors
CodeType
Types of code sections in EOF container
EofValidationError
EOF Validation Error

Constants§

EOF_MAGIC
EOF Magic in u16 form
EOF_MAGIC_HASH
Hash of EF00 bytes that is used for EXTCODEHASH when called from legacy bytecode

Statics§

EOF_MAGIC_BYTES
EOF magic number in array form

Functions§

validate_eof
Fully validates an Eof container.
validate_eof_code
Validates that:
validate_eof_codes
Validates an Eof structure, without recursing into containers.
validate_eof_inner
validate_raw_eof
Decodes raw into an Eof container and validates it.
validate_raw_eof_inner
Decodes raw into an Eof container and validates it.