Ethers.Transaction.Eip7702 (Ethers v0.8.0)

Copy Markdown View Source

Transaction struct and protocol implementation for Ethereum Improvement Proposal (EIP) 7702 transactions. EIP-7702 introduced "set code transactions" which let externally-owned accounts designate contract code to execute in their place via signed authorizations (see Ethers.Authorization).

Two constraints set this type apart from EIP-1559 transactions:

  • to is required — contract creation is not allowed in type-4 transactions.
  • authorization_list must contain at least one Ethers.Authorization.Signed.

See: https://eips.ethereum.org/EIPS/eip-7702

Summary

Types

t()

A transaction type following EIP-7702 (Type-4) and incorporating the following fields

Types

t()

@type t() :: %Ethers.Transaction.Eip7702{
  access_list: [{binary(), [binary()]}],
  authorization_list: [Ethers.Authorization.Signed.t()],
  chain_id: non_neg_integer(),
  gas: non_neg_integer(),
  input: binary(),
  max_fee_per_gas: non_neg_integer(),
  max_priority_fee_per_gas: non_neg_integer(),
  nonce: non_neg_integer(),
  to: Ethers.Types.t_address(),
  value: non_neg_integer()
}

A transaction type following EIP-7702 (Type-4) and incorporating the following fields:

  • chain_id - chain ID of network where the transaction is to be executed
  • nonce - sequence number for the transaction from this sender
  • max_priority_fee_per_gas - maximum fee per gas (in wei) to give to validators as priority fee (introduced in EIP-1559)
  • max_fee_per_gas - maximum total fee per gas (in wei) willing to pay (introduced in EIP-1559)
  • gas - maximum amount of gas allowed for transaction execution
  • to - destination address for transaction. Required — type-4 transactions cannot create contracts
  • value - amount of ether (in wei) to transfer
  • input - data payload of the transaction
  • access_list - list of addresses and storage keys to warm up (introduced in EIP-2930)
  • authorization_list - list of signed authorizations setting code on their authorities (introduced in EIP-7702)