Cartouche.Transaction.Call (Cartouche v0.2.0)

Copy Markdown View Source

Represents Ethereum eth_call parameters, not a signable or broadcastable transaction.

destination is required because generated contract calls always target a deployed contract. data is required because generated contract calls execute ABI-encoded calldata. from is optional because eth_call accepts a caller address but existing RPC callers pass it through options. gas is optional because eth_call can cap execution gas without creating a transaction gas limit. value is optional because eth_call can simulate payable execution without transferring funds. Fee, nonce, chain-id, access-list, and signature fields are excluded because calls are never signed or broadcast.

Summary

Functions

Builds an eth_call parameter struct.

Types

t()

@type t() :: %Cartouche.Transaction.Call{
  data: binary(),
  destination: <<_::160>>,
  from: <<_::160>> | nil,
  gas: non_neg_integer() | nil,
  value: non_neg_integer() | nil
}

Functions

new(destination, data, opts \\ [])

@spec new(<<_::160>>, binary(), Keyword.t()) :: t()

Builds an eth_call parameter struct.