Skip to main content

trace_call

Traces a call without creating a transaction on MegaETH, returning the trace output.

Archive Node Required

This method requires an archive node. It is not available on full nodes.

Use Cases#

  • Call simulation - Preview internal calls before sending a transaction
  • Contract interaction analysis - Understand how contracts interact
  • Gas estimation - Analyze gas usage patterns for high-frequency trading, real-time gaming, instant payments, and latency-sensitive applications

Parameters#

ParameterTypeRequiredDescription
callObjectObjectYesTransaction call object (from, to, gas, value, data)
traceTypesArrayYesTrace types: ["trace"], ["vmTrace"], ["stateDiff"], or combinations
blockNumberQUANTITY|TAGNoBlock number or tag (default: latest)

Request#

{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"to": "0x0E0f4Dd25ae8AB20E1583D9E8EDFf319A88e1d3f",
"data": "0x70a082310000000000000000000000000E0f4Dd25ae8AB20E1583D9E8EDFf319A88e1d3f"
},
["trace"],
"latest"
],
"id": 1
}

Code Examples#

curl -X POST https://api-megaeth-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{"to": "0x0E0f4Dd25ae8AB20E1583D9E8EDFf319A88e1d3f", "data": "0x70a082310000000000000000000000000E0f4Dd25ae8AB20E1583D9E8EDFf319A88e1d3f"},
["trace"],
"latest"
],
"id": 1
}'