Minimal world/account state used for external account lookups
(EXTCODESIZE, EXTCODECOPY, EXTCODEHASH).
Each account can include :balance, :nonce, :code, and :storage.
Missing accounts behave like non-existent EVM accounts: no code and
zero balance.
Summary
Functions
Removes an account entirely from the world state.
Types
@type account() :: %{ optional(:balance) => non_neg_integer(), optional(:nonce) => non_neg_integer(), optional(:code) => binary(), optional(:storage) => EEVM.Storage.t() }
@type t() :: %EEVM.WorldState{accounts: %{required(non_neg_integer()) => account()}}
Functions
@spec account_exists?(t(), non_neg_integer()) :: boolean()
@spec delete_account(t(), non_neg_integer()) :: t()
Removes an account entirely from the world state.
Used by SELFDESTRUCT under EIP-6780: when a contract is created and self-destructed within the same transaction, the account is fully deleted (balance, nonce, code, and storage are all removed).
@spec get_account(t(), non_neg_integer()) :: account() | nil
@spec get_balance(t(), non_neg_integer()) :: non_neg_integer()
@spec get_code(t(), non_neg_integer()) :: binary()
@spec get_nonce(t(), non_neg_integer()) :: non_neg_integer()
@spec increment_nonce(t(), non_neg_integer()) :: t()
@spec new() :: t()
@spec new(%{optional(non_neg_integer()) => account()}) :: t()
@spec put_account(t(), non_neg_integer(), account()) :: t()
@spec put_code(t(), non_neg_integer(), binary()) :: t()
@spec set_balance(t(), non_neg_integer(), non_neg_integer()) :: t()
@spec set_nonce(t(), non_neg_integer(), non_neg_integer()) :: t()
@spec transfer(t(), non_neg_integer(), non_neg_integer(), non_neg_integer()) :: {:ok, t()} | {:error, :insufficient_balance}
@spec update_account(t(), non_neg_integer(), (account() -> account())) :: t()