Skip to main content

Try it Live

Run Bytecode examples in the interactive playground
New to bytecode? Start with Fundamentals for guided examples and concepts.

Type Definition

Branded Uint8Array with utils for analyzing, validating, and iterating over EVM bytecode.

Native Uint8Array Methods

JavaScript builtins available on all Uint8Array instances:
  • setFromBase64() - Populate from base64 string
  • setFromHex() - Populate from hex string
  • toBase64() - Encode to base64 string
  • toHex() - Encode to hex string
MDN Reference
toHex() and setFromHex() are available as of 2025 (Node.js 22+, Chrome 131+). Use Tevm’s Hex.toHex() for broader compatibility.

Quick Reference

    Effect Schema

    API Methods

    Constructors

    Iteration

    Analysis

    Validation

    Metadata

    Formatting

    Conversions

    Utilities

    Reference

    Types

    Main branded type. Runtime is Uint8Array, TypeScript enforces type safety with symbol branding.

    Usage Patterns

    Analyzing Contract Bytecode

    Comparing Bytecode

    Extracting Runtime Code

    Tree-Shaking

    Import only what you need for optimal bundle size:

    Core Documentation

    Advanced Features

    • Opcode - EVM instruction definitions and gas costs
    • Keccak256 - Keccak256 hashing for bytecode verification
    • Hex - Hex string encoding and decoding

    Specification