Join AWS, Dust Labs & OrangeDAO at QuickPitch. Win $80k — Apply Today.

Contents

trace_call RPC Method

The API credit value for this method is 6 . To learn more about API credits and each method's value, visit the API Credits page.

Please note that this RPC method requires the Trace Mode add-on enabled on your QuickNode endpoint. Also, it is supported only on OpenEthereum & Erigon.

Parameters:

  1. object - The transaction call object which contains the following fields:

    from - string - (optional) The string of the address the transaction is sent from

    to - string - The string of the address to the transaction is directed to

    gas - integer - (optional) The integer of the gas provided for the transaction execution

    gasPrice - integer - (optional) The integer of the gasPrice used for each paid gas encoded as hexadecimal

    value - integer - (optional) The integer of the value sent with this transaction encoded as hexadecimal

    data - string - (optional) The string of the hash of the method signature and encoded parameters, see the Ethereum Contract ABI

  2. array - The type of trace, one or more of:

    vmTrace - string - To get a full trace of the virtual machine's state during the execution of the given of given transaction, including for any subcells

    trace - string - To get the basic trace of the given transaction

    stateDiff - string - To get information on altered Ethereum state due to execution of the given transaction

  3. blockNumber - string - string - The block number as a string in hexadecimal format or tags. The supported tag values include earliest for the earliest/genesis block, latest for the latest mined block, pending for the pending state/transactions, safe for the most recent secure block, and finalized for the most recent secure block accepted by more than 2/3 of validators. safe and finalized are only supported on Ethereum and Gnosis

    Returns:

  1. array - The block traces, which have the following fields (please note that all return types are hexadecimal representations of their data type unless otherwise stated):

    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

    trace - It is used to retrieve the basic trace of the given information

    action - The action to be performed on the receiver id

    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

    result - The integer of the gas price used encoded as hexadecimal

    gasUsed - The total used gas by all transactions in this block encoded as hexadecimal

    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 was 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

Code Examples:

require "uri"
require "json"
require "net/http"

url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "method": "trace_call",
  "params": [
    {
      "from": nil,
      "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"
    },
    [
      "trace"
    ],
    "latest"
  ],
  "id": 1,
  "jsonrpc": "2.0"
})

response = https.request(request)
puts response.read_body
Ready to get started? Create a free account