Trace EVM Call
evm_trace_callTrace a read-only EVM call to see internal calls, gas costs, events, and revert reasons without submitting a transaction.
Instructions
Execute a read-only call with cast call --trace and return the structured call tree: every internal call, its gas cost, call type, return values, emitted events, and revert frames.
Use this to verify exploit reachability, inspect cross-contract call flows, or debug unexpected reverts. This tool does NOT submit a real transaction.
Args:
target (string): Target contract address (0x-prefixed, 42 chars)
signature (string): Function signature, e.g. "withdraw(uint256)"
args (string, optional): Space-separated arguments for the function call
rpcUrl (string): JSON-RPC endpoint URL (e.g. http://localhost:8545)
Returns: JSON object: { "reverted": boolean, // true if any frame reverted "gasUsed": number, // Total gas used (when reported) "events": [ { "depth": number, // Nesting depth in the call tree (0 = top frame) "kind": string, // "call" | "return" | "stop" | "revert" | "emit" "gas": number, // Gas for call frames "target": string, // Callee address or label "call": string, // Function + arguments "callType": string, // "staticcall" | "delegatecall" | undefined (regular call) "value": string // Return data, revert reason, or event payload } ] }
Examples:
"Why does withdraw() revert?" → trace it, read the deepest revert frame
"Does transfer() call an external contract?" → look for depth > 0 call events
Error Handling:
Returns isError=true if cast is not installed, the RPC is unreachable, or no trace was produced
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Space-separated arguments for the function call | |
| rpcUrl | Yes | JSON-RPC endpoint URL | |
| target | Yes | Target contract address (0x-prefixed, 42 chars) | |
| signature | Yes | Function signature, e.g. 'withdraw(uint256)' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| events | Yes | ||
| gasUsed | No | ||
| reverted | Yes |