eth_call - Ethereum

eth_call. Executes a new message call immediately without creating a transaction on the block chain

eth_call - ethereum [Value: 21CU]
Executes a new message call immediately without creating a transaction on the block chain.
Use cases

Use cases

  • Simulate contract function execution without blockchain state change
  • Retrieve return values from smart contract functions
  • Estimate gas usage for contract function calls
Constraints

Constraints

  • Starting from Geth 1.9.13, eth_call checks the sender's balance to ensure sufficient gas for execution if either: The gas_price parameter is populated, the contract function modifies the blockchain state.
  • In these cases, the from address must have enough gas as ifexecuting a write transaction, even though eth_call itself doesn't consume gas.
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url https://eth.drpc.org \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [
    "0x61A80",
    {
      "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "gas": "0x0",
      "gasPrice": "0x9184e72a000",
      "value": "0x0",
      "data": "0x"
    }
  ]
}
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xb1770efb14906e509893b6190359658208ae64d0c56e22f748a1b0869885559e"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray of objects
array of objects
transactionobject
The transaction call object which contains the following fields.
array of objects
fromstring
The address from which the transaction is sent.
tostring
The address to which the transaction is addressed.
gasinteger
The integer of gas provided for the transaction execution.
gasPriceinteger
The integer of gasPrice used for each paid gas encoded as hexadecimal.
valueinteger
The integer of value sent with this transaction encoded as hexadecimal.
datastring
The hash of the method signature and encoded parameters.
blockNumberstring
The hex value of a block number, hash or tags:
  • latest [default] - the blockchain's most recent block
  • earliest - the first or genesis block
  • pending - transactions broadcasted but not yet included in a block

Response

200
The result of the call.

Response params

object
idinteger
jsonrpcstring
resultstring