Class EVM<M>

Type Parameters

  • M extends string

Hierarchy

  • EVM

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • M extends string

    Parameters

    • bytecode: string | Uint8Array | ArrayLike<number>
    • step: Undef<M> & {
          readonly [m in string]: StepFn
      }

      The STEP function that updates the State after executing the opcode pointed by pc.

      Maps mnemonic keys of STEP to their corresponding opcode in the byte range, i.e., 0-255.

      For elements in the range 0-255 that do not have a corresponding mnemonic, INVALID is used instead.

    Returns EVM<M>

Properties

_ids: {
    _count: number;
    push(elem) => void;
} = ...

Type declaration

blocks: Map<number, Block<M>> = ...

Reacheable blocks found in this.bytecode.

bytecode: Uint8Array

The bytecode buffer that represents a Contract or Library.

errors: {
    err: Throw;
    state: State<Inst, Expr>;
}[] = []

Symbolic execution errors found during interpretation of this.bytecode.

Type declaration

  • err: Throw

    The statement that represents the error triggered during symbolic execution.

  • state: State<Inst, Expr>

    The state in which the error was triggered. Given this states ends up in error, this.last statement will be this.err.

step: Undef<M> & {
    readonly [m in string]: StepFn
}

The STEP function that updates the State after executing the opcode pointed by pc.

Maps mnemonic keys of STEP to their corresponding opcode in the byte range, i.e., 0-255.

For elements in the range 0-255 that do not have a corresponding mnemonic, INVALID is used instead.

Methods

  • Returns {
        content: Uint8Array | Opcode<M>[];
        pcbegin: number;
        pcend: number;
        states?: State<Inst, Expr>[];
    }[]

  • Returns the opcodes present in the reacheable blocks of this EVM's bytecode.

    NOTE. You must call either the start, run or exec methods first. This is to populate the bytecode's reacheable blocks.

    Returns Opcode<M>[]

  • Creates a new EVM with the latest defined execution fork.

    Parameters

    • bytecode: string | Uint8Array | ArrayLike<number>

    Returns EVM<"ADDMOD" | "MULMOD" | "SIGNEXTEND" | "EQ" | "ISZERO" | "NOT" | "BYTE" | "COINBASE" | "TIMESTAMP" | "NUMBER" | "DIFFICULTY" | "GASLIMIT" | "CALLER" | "CALLDATASIZE" | "ORIGIN" | "GASPRICE" | "ADDRESS" | "CODESIZE" | "RETURNDATASIZE" | "GAS" | "CALLVALUE" | "CALLDATALOAD" | "CALLDATACOPY" | "CODECOPY" | "EXTCODECOPY" | "RETURNDATACOPY" | "SLOAD" | "SSTORE" | "POP" | "PUSH2" | "PUSH1" | "PUSH16" | "PUSH3" | "PUSH8" | "PUSH9" | "PUSH11" | "PUSH20" | "PUSH21" | "PUSH25" | "PUSH26" | "PUSH5" | "PUSH32" | "PUSH4" | "PUSH6" | "PUSH7" | "PUSH10" | "PUSH12" | "PUSH13" | "PUSH14" | "PUSH15" | "PUSH24" | "PUSH17" | "PUSH18" | "PUSH19" | "PUSH22" | "PUSH23" | "PUSH27" | "PUSH28" | "PUSH29" | "PUSH30" | "PUSH31" | "DUP2" | "DUP1" | "DUP16" | "DUP3" | "DUP8" | "DUP9" | "DUP11" | "DUP5" | "DUP4" | "DUP6" | "DUP7" | "DUP10" | "DUP12" | "DUP13" | "DUP14" | "DUP15" | "SWAP2" | "SWAP1" | "SWAP16" | "SWAP3" | "SWAP8" | "SWAP9" | "SWAP11" | "SWAP5" | "SWAP4" | "SWAP6" | "SWAP7" | "SWAP10" | "SWAP12" | "SWAP13" | "SWAP14" | "SWAP15" | "ADD" | "MUL" | "SUB" | "DIV" | "SDIV" | "MOD" | "SMOD" | "EXP" | "LT" | "GT" | "SLT" | "SGT" | "AND" | "OR" | "XOR" | "PC" | "BALANCE" | "EXTCODESIZE" | "EXTCODEHASH" | "BLOCKHASH" | "MLOAD" | "MSTORE" | "MSTORE8" | "MSIZE" | "SHA3" | "STOP" | "CREATE" | "CALL" | "CALLCODE" | "RETURN" | "DELEGATECALL" | "STATICCALL" | "REVERT" | "SELFDESTRUCT" | "INVALID" | "LOG0" | "LOG2" | "LOG1" | "LOG3" | "LOG4" | "JUMPDEST" | "JUMP" | "JUMPI" | "SHL" | "SHR" | "SAR" | "CREATE2" | "CHAINID" | "SELFBALANCE" | "PREVRANDAO" | "BASEFEE" | "PUSH0">

Generated using TypeDoc v0.25.2