debug_traceCall

Traces the execution of eth_call and provides detailed information about each step of the execution. This is similar to trace_call.

Parameters

  1. Object - The transaction call object with the following:

    • from(optional): the address the transaction is sent from.

    • to(required): the address the transaction is sent to.

    • gas(optional): Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.

    • gasPrice(optional): Integer of the gasPrice used for each paid gas.

    • value(optional): Integer of the value sent with this transaction.

    • data(optional): Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation.

  2. Quantity or tag - choose 1 of the following options:

    • A hexadecimal block number.

    • "earliest" - the earliest/genesis block.

    • "latest" - the latest mined block.

    • "finalized" - the latest finalized block.

    • "pending" - the pending state/transactions.

  3. Tracer - choose from one of these options:

    • 4byteTracer - Solidity contract functions are addressed using the first four byte of the Keccak-256 hash of their signature. This tracer monitors and analyzes the usage of specific function signatures within smart contracts by capturing their unique first four bytes.

    • callTracer - collects data about all call frames executed within a transaction, creating a hierarchical list of call frames structured mirroring the EVM's operations. This is useful for debugging and analytical purposes.

    • prestateTracer - captures and analyzes the state of the blockchain before the execution of a specific transaction. It helps in understanding the state changes and effects that a transaction will have on the blockchain's data and accounts before the transaction is actually executed.

    • noopTracer - returns empty results. This is used for testing purpose.

    • opcountTracer - count and track the number of operations (or opcodes) executed during a specific transaction.

    • unigramTracer - counts the frequency of occurrence of each opcode.

    • bigramTracer - a bigram refers to a sequence of two bytes or characters. This tracer is designed to observe and provide insights into the patterns and occurrences of these two-byte sequences as they appear within the data of executed transactions.

    • trigramTracer - a trigram refers to a sequence of three bytes or characters. This tracer is designed to observe and provide insights into the patterns and occurrences of these three-byte sequences as they appear within the data of executed transactions.

    • evmdisTracer - generates the bytecode disassembly of executed transactions, providing developers with insights into how smart contracts operate at a low-level bytecode level for debugging, security audits, and performance optimization purposes.

Sample Request

curl https://lb.nodies.app/v1/<INSERT URL> \
   -H "x-api-key: <API-KEY>" \
   -X POST \
   -H "Content-Type: application/json" \
   -d '{ 
  "id": 1,
  "jsonrpc": "2.0",
  "method": "debug_traceCall",
  "params": [
    {
      "from": "0xfa0b641678F5115ad8a8De5752016bD1359681b9",
      "to": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
      "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"
    },
    "latest",
    {
      "tracer": "callTracer"
    }
  ]
}
'

Sample Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0xfa0b641678f5115ad8a8de5752016bd1359681b9",
    "gas": "0x22457528",
    "gasUsed": "0x5898",
    "to": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
    "input": "0x70a082310000000000000000000000006e0d01a76c3cf4288372a29124a26d4353ee51be",
    "value": "0x0",
    "type": "CALL"
  }
}

Last updated