Docs
Supported ChainsFlow EVM GatewayJSON-RPC APIDebug Methods

debug_traceTransaction - Flow EVM RPC Method

Trace a transaction execution on Flow EVM Gateway. Requires archive node for debugging consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications.

Traces a transaction execution on Flow EVM Gateway by transaction hash.

Archive Node Required

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

Use Cases

  • Transaction debugging - Understand exactly what happened
  • Failure analysis - Find where and why a transaction reverted
  • Gas optimization - Analyze gas usage for consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications

Request Parameters

Request
txHashDATA

32-byte transaction hash

tracerConfigObject

Tracer configuration

Response Body

Response

Tracer Options

  • {} - Default opcode tracer (verbose)
  • { tracer: "callTracer" } - Call tree tracer
  • { tracer: "prestateTracer" } - Pre-state tracer

Code Examples

Bash
curl -X POST https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "debug_traceTransaction",
    "params": ["0xac905cb8672fe39508dab7199529d77b32d459242ad9d3f6799e4e427d6003f8", {"tracer": "callTracer"}],
    "id": 1
  }'
JavaScript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY');

const txHash = '0xac905cb8672fe39508dab7199529d77b32d459242ad9d3f6799e4e427d6003f8';

// Call tracer - shows internal calls
const callTrace = await provider.send('debug_traceTransaction', [
  txHash,
  { tracer: 'callTracer' }
]);
console.log('Type:', callTrace.type);
console.log('From:', callTrace.from);
console.log('To:', callTrace.to);
console.log('Gas used:', parseInt(callTrace.gasUsed, 16));

// Prestate tracer - shows state before execution
const prestateTrace = await provider.send('debug_traceTransaction', [
  txHash,
  { tracer: 'prestateTracer' }
]);
Python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY'))

tx_hash = '0xac905cb8672fe39508dab7199529d77b32d459242ad9d3f6799e4e427d6003f8'

# Call tracer
trace = w3.provider.make_request('debug_traceTransaction', [
    tx_hash,
    {'tracer': 'callTracer'}
])
print(f'Trace type: {trace["result"]["type"]}')
print(f'Gas used: {int(trace["result"]["gasUsed"], 16)}')