trace_call

Executes a new message call and returns a number of possible traces.

🚧

Note for trace_ methods

  1. trace_ namespace methods are only available on paid plans.
    1. developer plan, team plan, enterprise plan, custom plans. dedicated nodes
  2. trace_ namespace methods are only available on erigon client.

Parameters

  • Object - The transaction object
    • from: DATA, 20 Bytes - (optional) The address the transaction is sent from.
    • to: DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.
    • gas: QUANTITY - (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.
    • gasPrice: QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.
    • value: QUANTITY - (optional) Integer of the value sent with this transaction.
    • data: DATA - (Optional)The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
    • nonce: QUANTITY - (Optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
  • Array - Type of trace, one or more of:
    • "trace" - To get a full trace of the virtual machine's state during the execution of the given of given transaction, including for any subcells.
    • "stateDiff" - To get the basic trace of the given transaction
    • "vmTrace" - To get information on altered Ethereum state due to execution of the given transaction
  • quantity|tag - (Optional) Hex encoded integer block number, or the string "latest", "earliest" or "pending", see the default block parameter.
curl https://ethereum-mainnet-archive.allthatnode.com/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
--request POST \
--header "Content-Type: application/json" \
--data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "trace_call",
    "params": [
        {
            "from": "0xB54F8F44e8f2E6890C3463FE55E754Cd8fFC0726",
            "to": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
            "value": "0x0",
            "gas": "0x124F8",
            "gasPrice": "0xBA43B7400",
            "data": "0xa9059cbb000000000000000000000000f3c50ffe518859370f16019682273e8d6cf301f50000000000000000000000000000000000000000000007313f1019b7ae940000",
            "nonce": "0x33"
        },
        [
            "trace"
        ],
        "0x10F5EE0"
    ]
}'

Returns

  • output - The data which is returned as an output encoded in hexadecimal format
  • stateDiff - It returns the information on altered Ethereum state due to execution of the given transaction
  • block trace: A list of calls to other contracts containing one object per call, in transaction execution order.
    • action - The ParityTrace object, which has the following fields:
      • from - The address of the sender
      • callType - The type of method such as call, delegatecall
      • gas - The gas provided by the sender, encoded as hexadecimal
      • input - The data sent along with the transaction
      • to - The address of the receiver
      • value - The integer of the value sent with this transaction, encoded as hexadecimal
    • blockHash - The hash of the block where this transaction was in
    • blockNumber - An integer value representing the block number where this transaction was in
    • error - The error message, if any
    • result - The ParityTraceResult object which has the following fields:
      • gasUsed - The amount of gas used by this specific transaction alone
      • output - The value returned by the contract call, and it only contains the actual value sent by the RETURN method. If the RETURN method was not executed, the output is empty bytes
    • subtraces - The traces of contract calls made by the transaction
    • traceAddress - The list of addresses where the call executed, the address of the parents and the order of the current sub call
    • type - The value of the method such as call or create
  • vmTrace - It is used to get a full trace of the virtual machine's state during the execution of the given transaction, including for any sub-calls
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "output": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000",
        "stateDiff": null,
        "trace": [
            {
                "action": {
                    "from": "0xb54f8f44e8f2e6890c3463fe55e754cd8ffc0726",
                    "callType": "call",
                    "gas": "0xd060",
                    "input": "0xa9059cbb000000000000000000000000f3c50ffe518859370f16019682273e8d6cf301f50000000000000000000000000000000000000000000007313f1019b7ae940000",
                    "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
                    "value": "0x0"
                },
                "error": "Reverted",
                "result": {
                    "gasUsed": "0xa4f",
                    "output": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000184461692f696e73756666696369656e742d62616c616e63650000000000000000"
                },
                "subtraces": 0,
                "traceAddress": [],
                "type": "call"
            }
        ],
        "vmTrace": null
    }
}

Try Yourself

Language
Click Try It! to start a request and see the response here!