trace_call

Executes the given call and returns a number of possible traces for it.

Parameters

  1. Object - Call options, same as eth_call.
    • from: Address - (optional) 20 Bytes - The address the transaction is sent from.
    • to: Address - (optional when creating new contract) 20 Bytes - The address the transaction is directed to.
    • gas: Quantity - (optional) Integer formatted as a hex string 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) Integer formatted as a hex string of the gas price used for each paid gas.
    • value: Quantity - (optional) Integer formatted as a hex string of the value sent with this transaction.
    • data: Data - (optional) 4 byte hash of the method signature followed by encoded parameters. For details see Ethereum Contract ABI.
  2. Array - Type of trace, one or more of: "trace", "stateDiff".
  3. Quantity or Tag - (optional) Integer formatted as a hex string that represents a block number, or the string earliest or latest.

Returns

  • Object - trace object


Request

curl https://eth-mainnet.g.alchemy.com/v2/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_call",
    "params":[{
      "from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
      "to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
      "value": "0x0",
      "data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"},
      ["trace"]],
    "id":1,
    "jsonrpc":"2.0"}'
URL: https://eth-mainnet.g.alchemy.com/v2/your-api-key
RequestType: POST
Body: 
{
    "jsonrpc":"2.0",
    "method":"trace_call",
    "params":[{
        "from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
        "to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
        "value": "0x0",
        "data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"},    
    },["trace"]],
    "id":1
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "output": "0x",
    "stateDiff": null,
    "trace": [
      {
        "action": {
          "callType": "call",
          "from": "0x6f1fb6efdf50f34bfa3f2bc0e5576edd71631638",
          "gas": "0x1dcd11f8",
          "input": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000",
          "to": "0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e",
          "value": "0x0"
        },
        "error": "Reverted",
        "subtraces": 0,
        "traceAddress": [],
        "type": "call"
      }
    ],
    "vmTrace": null
  },
  "id": 0
}

How to use the request builder tool below

To get the "try it" button to work on the right you'll need to select the parameter inputs below in their correct positions. You'll notice that there are three of each of the inputs below. Select the first input in the first box, second in the second box, and third in the third box. You should see the sample request update correspondingly on the right side.

Once you've built your request, click "try it" and you should be able to see results on the right!

Language
URL
ReadMe