EEVM.Transaction (eevm v0.1.0)

Copy Markdown View Source

Ethereum transaction wire-format structs.

These structs represent signed transaction payloads as they appear on the network (legacy and typed transaction envelopes). They are intentionally separate from EEVM.TxEnv, which models execution context.

nonce, value, data, access_list, and authorization_list default to zero or empty. Build an unsigned struct and sign it with EEVM.Transaction.Signer.sign/3, which also fills in a missing chain_id.

Addresses are integers, as everywhere in eevm: to (nil creates a contract), access-list entries, and Authorization.address. Access-list storage keys are integers too; EEVM.Transaction.Envelope converts at the wire edge. A 20-byte binary address or 32-byte binary storage key is still accepted for one minor version, but is deprecated.

Fields

Each type's page lists the fields it has. Amounts are in wei.

FieldTypesDescription
chain_idtypedChain the transaction is valid on; Signer.sign/3 fills in a nil one from the config
nonceallThe sender's account nonce
gas_pricelegacy, access listPrice per unit of gas
max_fee_per_gasfee market, blob, set codeMost the sender pays per unit of gas, base fee included (EIP-1559)
max_priority_fee_per_gasfee market, blob, set codeMost of that the block producer receives as a tip (EIP-1559)
gas_limitallGas available to the transaction, intrinsic gas included
toallRecipient address; nil creates a contract (not allowed for blob and set-code transactions)
valueallWei sent to to or to the new contract
dataallCalldata, or initcode when to is nil
access_listtyped[{address, [storage_key]}] warmed before execution (EIP-2930)
max_fee_per_blob_gasblobMost the sender pays per unit of blob gas (EIP-4844)
blob_versioned_hashesblob32-byte versioned hashes of the blobs (EIP-4844)
authorization_listset codeEEVM.Transaction.Authorization tuples to apply (EIP-7702)
vlegacySignature recovery value: 27/28, or chain_id * 2 + 35/36 with EIP-155
y_paritytypedSignature recovery bit, 0 or 1
r, sallThe secp256k1 signature

Summary

Types

access_list()

@type access_list() :: [{address(), [storage_key()]}]

address()

@type address() :: non_neg_integer()

authorization_tuple()

@type authorization_tuple() :: EEVM.Transaction.Authorization.t()

hash32()

@type hash32() :: <<_::256>>

storage_key()

@type storage_key() :: non_neg_integer()

t()