Base
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Base
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
trace_call simulates a call against a chosen Base block state and returns an OpenEthereum-style call-tree trace, plus an optional opcode-level VM trace and an optional state diff — all without creating or broadcasting a transaction. Base is Coinbase's OP Stack optimistic rollup that pays gas in ETH and settles to Ethereum L1. Send the request to https://base.therpc.io/YOUR_API_KEY (chain ID 8453, hex 0x2105) with a call object, a traceTypes array selecting which outputs you want (trace, vmTrace, stateDiff), and a block parameter. You choose how much detail to pay for: trace alone gives the call tree, while adding stateDiff shows exactly which balances and storage slots the call would touch.
trace type on the call object.stateDiff, to confirm it touches only the slots you expect.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | transaction | object | Sim | Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`. |
| 2 | traceTypes | array | Sim | Array of trace types to include: `"trace"` (call tree), `"vmTrace"` (opcode-level), `"stateDiff"` (storage/balance diffs). |
| 3 | blockParameter | string | Não | Block state against which to simulate the call.Padrão: latest |
| Tipo | Descrição |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is a flat call-tree array, `stateDiff` maps each touched address to its balance/nonce/code/storage diffs, `vmTrace` provides opcode-level detail (Parity-format). |
Try it live in the Base playground.
| Código | Mensagem | Causa |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or client does not support trace_call. |
-32602 | Invalid params | Transaction object missing required fields, traceTypes array is empty or contains unrecognized values, or blockParameter is invalid. |
-32000 | execution reverted | Simulated call reverted; partial trace is still returned. |
trace + vmTrace + stateDiff) on a complex Base call can return a very large payload; ask only for the outputs you actually use.vmTrace output uses the Parity format and differs from Geth's debug_traceCall struct-log — do not feed one into tooling that expects the other.Parâmetros
Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`.
["trace"] | ["trace","vmTrace","stateDiff"] — at least one required
hex block number or "latest" | "earliest" | "pending"