Class State<S, E>

Represents the state of an EVM run with statements S and expressions E.

Type Parameters

Hierarchy

  • State

Constructors

Properties

Accessors

Methods

Constructors

Properties

_halted: boolean = false

Indicates whether this State has been halted.

id: undefined | number

The unique identifier of this State when it has been executed by the EVM. The id is undefined when this State has not been executed yet.

The ids are assigned incrementally by the EVM in the order they are executed.

memory: Memory<E> = ...
nlocals: number = 0
stack: Stack<E> = ...
stmts: S[] = []

The statements executed that lead to this State.

Accessors

  • get halted(): boolean
  • Indicates whether this State has been halted.

    When true, no more execution should be allowed against this State.

    Returns boolean

  • get last(): undefined | S
  • The last statement in this State.

    Returns undefined | S

Methods

  • Creates a detached clone from this State. The cloned state only shallow copies both stack and memory, while stmts will be empty and halted false.

    Note however the shallow copy means the structure of both stack and memory are cloned, not their contents. This means that any expression E in either the stack or memory will be shared across instances if they are references.

    Returns State<S, E>

    a new State detached from this one.

  • Halts this State. It adds last to stmts and sets halted to true.

    Parameters

    • last: S

      The S that halts this State.

    Returns void

Generated using TypeDoc v0.25.2