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

Parameters

Object - An object with the following fields (required):
  • from(hex string, optional) - the address the transaction is send from.
  • to(hex string, optional when creating new contract) - the address the transaction is directed to.
  • gas(integer number, 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(integer number, optional) - integer formatted as a hex string of the gas price used for each paid gas.
  • value(hex string, optional) - integer formatted as a hex string of the value sent with this transaction.
  • data(hex string, optional) - 4 byte hash of the method signature followed by encoded parameters. For details see Ethereum Contract ABI.
  • Array. type of trace - one or more of: "vmTrace", "trace", "stateDiff".
  • blockNumber(integer number or string, optional) - integer of a block number, or the string 'earliest' or 'latest'.

Returns

Object - An object with the following fields:
  • id(integer number) - json-rpc id.
  • jsonrpc(string) - json-rpc version.
  • result(object) - an object with the following fields:
    • output(hex string) - output.
    • stateDiff(object) - state diff.
    • trace(array of object) - an array of object with the following fields:
      • action(object) - an object with the following fields:
        • callType(string) - call type, for example "call".
        • from(hex string) - from address.
        • gas(hex string) - gas hex string.
        • input(hex string) - input.
        • to(hex string) - to address.
        • value(hex string) - value.
      • error(string) - error string eg. "Reverted".
      • result(object) - result object.
      • subtraces(integer number) - subtraces.
      • traceAddress(array of integer number) - trace address.
      • type(string) - type, eg. "call".
    • vmTrace(object) - vm trace.

Example

Request

1
curl https://api.blockvision.org/v1/<api key> \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{
5
"method": "trace_call",
6
"params": [
7
{
8
"from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
9
"to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
10
"value": "0x0",
11
"data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"
12
},
13
[
14
"trace"
15
]
16
],
17
"id": 1,
18
"jsonrpc": "2.0"
19
}'
Copied!

Result

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