debug_tracecall - Worldchain

Example code for the debug_traceCall JSON-RPC method. Complete guide on how to use debug_traceCall JSON-RPC in GetBlock Web3 documentation.

Traces a call without creating a transaction on the World Chain network for debugging purposes.

Parameters

Parameter
Type
Description

transaction

object

Transaction call object

blockNumber

string

Block number in hex, or "latest", "earliest", "pending"

tracerConfig

object

(Optional) Tracer configuration options

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "debug_traceCall",
    "params": [{"to": "0x1234567890123456789012345678901234567890", "data": "0x..."}, "latest", {}],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "gas": 21000,
        "structLogs": [...]
    }
}

Response Parameters

Field
Type
Description

gas

number

Gas used by the call

structLogs

array

Array of structured logs from execution

Use Case

The debug_traceCall method on World Chain is typically used for:

  • Call simulation

  • Gas estimation debugging

  • Contract call analysis

  • Pre-execution verification

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

Web3 Integration

Last updated

Was this helpful?