Skip to content

Fix Foundry Cast Transaction Lookup Errors

DodaTech Updated 2026-06-26 1 min read

You will learn how to look up transaction details using Cast.

The Problem

The foundry cast tx pattern is frequently misapplied in smart contract and dapp development, leading to vulnerabilities, gas inefficiencies, or logic errors. This guide shows the correct implementation and common pitfalls to avoid.

Quick Fix

Wrong

cast tx 0xTxHash  # Basic transaction info

Raw transaction data. No decoded function call or events.

cast tx 0xTxHash --decode --to 0xToken --sig "transfer(address,uint256)"
Decoded transaction with function name, arguments, and parsed values.

Prevention

  • Use --decode flag for human-readable output
  • Specify the target contract and function signature
  • Use cast receipt for transaction receipt details
  • Use DodaTech's transaction explorer
  • Check transaction status with cast receipt status

DodaTech Tools

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Doda Browser's developer tools include a Solidity debugger and transaction inspector. DodaZIP archives secure contract templates for team collaboration. Durga Antivirus Pro scans deployed contracts for known vulnerability signatures.

FAQ

### What is the difference between cast tx and cast receipt?

cast tx shows transaction data (input, value, gas). cast receipt shows execution result (status, gas used, logs).

Can Cast decode internal transactions?

No. Cast only decodes top-level transactions, not internal calls.

How do I get event logs from a transaction?

Use cast receipt --logs to see raw logs, or cast logs --from-block for filtered logs.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro