Class Undef<M>

This module is used to decode bytecode into Opcode.

Maps numeric opcodes (byte between 0 and 255) to decode configuration and string mnemonic. That is, for the given opcode, size indicates the size of the opcode's operand to consume from bytecode in bytes. halts indicates where the step associated with this opcode should halt the EVM State. mnemonic indicates the step the EVM should execute.

Type Parameters

  • M extends string

Hierarchy

Indexable

[opcode: number]: [size: number, halts: boolean, mnemonic: M]

Constructors

Properties

events: IEvents = {}
functionBranches: Map<string, {
    pc: number;
    state: State<Inst, Expr>;
}> = ...

Store selectors', i.e., public and external functions program counter entry.

Type declaration

mappings: {
    [location: string]: {
        keys: Expr[][];
        name: string | undefined;
        structs: bigint[];
        values: Expr[];
    };
} = {}

Type declaration

  • [location: string]: {
        keys: Expr[][];
        name: string | undefined;
        structs: bigint[];
        values: Expr[];
    }
    • keys: Expr[][]
    • name: string | undefined
    • structs: bigint[]
    • values: Expr[]
reverts: IReverts = {}
variables: Map<bigint, Variable> = ...

Methods

  • Decodes the input bytecode into Opcodes. bytecode may be a hexadecimal string, which may or may not begin with the hex prefix 0x.

    Example

    const opcodes = [...this.decode('0x6003600501')];
    

    Parameters

    • bytecode: string | Uint8Array | ArrayLike<number>

      hexadecimal string or array of numbers containing the bytecode to decode.

    • begin: number = 0

      the byte position where to start decoding the input bytecode, defaults to 0 if not provided.

    Returns Generator<Opcode<M>, void, unknown>

    a generator of the decoded Opcodes found in bytecode.

  • Parameters

    • selector: string

    Returns {
        sig?: string;
    }

    • Optional sig?: string
  • Retrieves the mnemonic of the steps which halts the EVM State.

    Returns M[]

  • Retrieves the opcodes by mnemonic.

    Returns {
        readonly [m in string]: number
    }

Generated using TypeDoc v0.25.2