Skip to main content
Bytecode (BrandedBytecode) is a branded Uint8Array holding EVM deployment (initCode) or runtime bytecode, equipped with instruction scanning, JUMPDEST analysis, basic-block decomposition, static stack/gas analysis, Solidity CBOR metadata stripping, and selector-based ABI extraction.

Quick Start

Import from @tevm/voltaire or @tevm/voltaire/Bytecode.

API Reference

Construction, Formatting & Hashing

Instruction Parsing & Disassembly

Analysis & Metadata

Edge Cases

  • A 0x5b byte inside a PUSH1–PUSH32 immediate payload is not a valid JUMPDEST. Always use analyzeJumpDestinations or isValidJumpDest rather than scanning raw bytes for 0x5b.
  • Solidity appends a 2-byte big-endian length suffix for CBOR metadata (a26469706673...); stripMetadata validates that suffix before slicing.
  • Opcode — Individual EVM opcode constants, stack effects, and gas metadata
  • GasConstants — Fork-aware gas schedule
  • ABI — Contract interface extracted by toAbi