For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_call

Executes a new message call immediately without creating a transaction on the block chain. Often used for executing read-only smart contract functions, for example the balanceOf for an ERC-20 contract

Parameters

Object - The transaction call object:

  • from: DATA, 20 bytes - (optional) The address the transaction is sent from.

  • to: DATA, 20 bytes - The address the transaction is directed to.

  • gas: QUANTITY - (optional) Hexadecimal value of the gas provided for the transaction execution.

  • eth_call consumes zero gas, but this parameter may be needed by some executions.

  • gasPrice: QUANTITY - (optional) Hexadecimal value of the gasPrice used for each paid gas.

  • maxPriorityFeePerGas: QUANTITY - Hexadecimal maximum fee, in Wei, the sender is willing to pay per gas above the base fee.

  • maxFeePerGas: QUANTITY - Hexadecimal maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas.

  • value: QUANTITY - Hexadecimal of the value sent with this transaction.

  • data: DATA - (optional) Hash of the method signature and encoded parameters. See Ethereum contract ABI specification.

block parameter: QUANTITY|TAG [Required] - Hexadecimal block number, or one of the string tags latest, earliest, safe, or finalized. See the default block parameter.

Returns

DATA - The return value of the executed contract

Example

Request

Result

source

Last updated