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

Parameters

  1. 1.
    Object - Call options, same as eth_call.
    • from: Address - (optional) 20 Bytes - The address the transaction is send 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. 2.
    Array - Type of trace, one or more of: "vmTrace", "trace", "stateDiff".
  3. 3.
    Quantity or Tag - (optional) Integer of a block number, or the string 'earliest' or 'latest'.

Returns

  • Array - Block traces

Example

Request

Curl
Postman
1
curl https://eth-mainnet.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"method":"trace_call",
5
"params":[{
6
"from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
7
"to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
8
"value": "0x0",
9
"data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"},
10
["trace"]],
11
"id":1,
12
"jsonrpc":"2.0"}'
Copied!
1
URL: https://eth-mainnet.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"trace_call",
7
"params":[{
8
"from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
9
"to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
10
"value": "0x0",
11
"data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"},
12
},["trace"]],
13
"id":1
14
}
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"output": "0x",
5
"stateDiff": null,
6
"trace": [
7
{
8
"action": {
9
"callType": "call",
10
"from": "0x6f1fb6efdf50f34bfa3f2bc0e5576edd71631638",
11
"gas": "0x1dcd11f8",
12
"input": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000",
13
"to": "0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e",
14
"value": "0x0"
15
},
16
"error": "Reverted",
17
"subtraces": 0,
18
"traceAddress": [],
19
"type": "call"
20
}
21
],
22
"vmTrace": null
23
},
24
"id": 0
25
}
Copied!