githubEdit

debug_traceCall - Celo

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

This method traces a call without creating a transaction on the Celo network. This is useful for simulating and debugging contract calls before submitting transactions.

Parameters

Parameter
Type
Required
Description

callObject

object

Yes

Transaction call object

blockNumber

string

Yes

Block number or "latest"

options

object

No

Tracer configuration

Request Example

cURL
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "debug_traceCall",
  "params": [
    {
      "to": "0x765DE816845861e75A25fCA122bb6898B8B1282a",
      "data": "0x70a08231000000000000000000000000742d35cc6634c0532925a3b844bc9e7595f8bb45"
    },
    "latest",
    {"tracer": "callTracer"}
  ]
}'

Response Example

Response Definition

Field
Type
Description

result

object

Execution trace

Use Cases

  • Simulate contract calls

  • Debug before submitting transactions

  • Analyze gas usage

  • Test cUSD/cEUR interactions

Error Handling

Error Code
Description

-32602

Invalid params

-32603

Internal error

-32000

Execution error

Last updated

Was this helpful?