POST
/
2fc1de7f08c0465f6a28e3c355e0cb14
curl --request POST \
  --url https://base-mainnet.core.chainstack.com/2fc1de7f08c0465f6a28e3c355e0cb14 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "trace_call",
  "id": 1,
  "params": [
    {
      "from": null,
      "to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "data": "0x70a082310000000000000000000000001985ea6e9c68e1c272d8209f3b478ac2fdb25c87"
    },
    [
      "trace",
      "vmTrace"
    ],
    "latest"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}

Base API method trace_call allows for the execution of a call transaction and returns a number of possible traces for it. This method is useful for simulating transactions without broadcasting them to the network, allowing developers to test and debug their transactions in a controlled environment.

Parameters

  • transaction — The transaction to be executed, specified as an object. This includes fields such as from, to, gas, gasPrice, value, and data.
  • traceTypes — An array of strings specifying the types of traces to return. Common trace types include "vmTrace", "trace", and "stateDiff".
  • blockNumber — The block number against which the transaction should be executed. This can be a specific block number, "earliest", "latest", or "pending".

Response

  • result — Depending on the requested traceTypes, the result may include various forms of trace data such as VM operation trace, state changes, and executed transaction trace. This data is crucial for understanding how a transaction interacts with the EVM and alters the blockchain state.

Use case

A possible use case for the trace_call method in Base is for smart contract developers who need to debug complex interactions with the Ethereum Virtual Machine (EVM). By simulating transactions, developers can identify and fix issues before deploying contracts or sending transactions on the live network. Additionally, it can be used to estimate gas usage more accurately or to verify that a transaction will behave as expected without actually making a state change on the blockchain.

Body

application/json

Response

200 - application/json
The result of the call

The response is of type object.