EEVM.CallResult (eevm v0.1.0)

Copy Markdown View Source

The outcome of a message call: EEVM.run/2, EEVM.call/4, or EEVM.create/3.

FieldDescription
status:success, :revert, or {:halt, reason} (see status/0)
return_dataBytes from RETURN or REVERT (see EEVM.revert_reason/1); empty after a halt
gas_usedGas the code consumed, after the refund. A message call has no transaction, so unlike EEVM.TransactionResult.gas_used this excludes the intrinsic gas (21,000 plus calldata)
gas_leftGas remaining from the :gas limit
logsLogs emitted, in order; empty unless status is :success
dbThe EEVM.Database after the call, writes still in its overlay; unchanged unless status is :success
changesdb's pending writes as an EEVM.StateChanges; message calls never commit them
contract_addressThe new contract's address after a successful EEVM.create/3, else nil
traceThe EEVM.Tracer when run with tracer:, else nil
stackThe final stack, top first, when run with debug: true, else nil

Summary

Types

How execution ended: :success after STOP or RETURN, :revert after REVERT, or {:halt, reason} after an exceptional halt, which consumes all gas. reason is an EEVM.Error.halt_reason/0, such as :out_of_gas or :invalid_opcode.

t()

Types

status()

@type status() :: :success | :revert | {:halt, EEVM.Error.halt_reason()}

How execution ended: :success after STOP or RETURN, :revert after REVERT, or {:halt, reason} after an exceptional halt, which consumes all gas. reason is an EEVM.Error.halt_reason/0, such as :out_of_gas or :invalid_opcode.

t()

@type t() :: %EEVM.CallResult{
  changes: EEVM.StateChanges.t(),
  contract_address: non_neg_integer() | nil,
  db: EEVM.Database.t(),
  gas_left: non_neg_integer(),
  gas_used: non_neg_integer(),
  logs: [EEVM.Block.Bloom.log_entry()],
  return_data: binary(),
  stack: [non_neg_integer()] | nil,
  status: status(),
  trace: EEVM.Tracer.t() | nil
}