What Is Included in a Transaction?
If you've ever executed a transaction on Ethereum (or any smart contract-enabled blockchain), you may have looked it up on a block explorer like Etherscan and encountered a wealth of information:
Transaction Overview Tab
When reviewing logs or traces (internal transactions), you might see these confusing pages:
- Logs Tab (If they're well-decoded, you're lucky.)
- Traces Tab (Often appears as a jumble of seemingly nonsensical data.)
Learning to read transaction details on block explorers forms the foundation of all Ethereum data analysis. Let’s break down each component and how to use them in SQL.
This guide explains these concepts at a high level. To manually decode this data, familiarize yourself with:
- Data Encoding (Applies to transactions, traces, and logs.)
- Dune’s Bytearray/Hex Functions for type conversions.
By the end, you’ll understand how to query any contract’s data using this Transaction Table Lookup Tool.
How to Analyze Any Ethereum Protocol or Product in 5 Minutes
Andrew Hong
Dec 30, 2022
Read the Full Story
Transactions
Transactions are just the tip of the iceberg—all traces and logs stem from the initial input data triggering the top-level function. Key fields in a block explorer’s transaction page:
These mirror the fields in Dune’s ethereum.transactions table. The critical identifier is whether the "to" field is a contract. Contracts are usually labeled, and their "input data" contains the function call.
Key Concepts:
- EOA vs. Contract Addresses: Contracts are deployed by EOAs and called in the "to" field. Block explorers indicate if an address is a contract or account. On Dune, check
ethereum.creation_traits. - Raw Data vs. Frontend Additions: Blockchain data is hexadecimal (binary/bytes). For example, a 1inch swap call’s input data starts with a 4-byte "function signature" (the keccak hash of the function name and input types). Etherscan’s "Decode" button converts this to readable form.
ABI Specifications
- The Application Binary Interface (ABI) acts like an API for smart contracts. Most developers verify and upload ABIs for reference.
- In Dune, decoded tables (e.g.,
uniswap_v2_ethereum.Pair_evt_Swap) match logs/traces to contract ABIs.
Logs
Event logs are emitted during function calls, typically at the end of successful execution. For example, a Uniswap V3 swap event log includes:
- topic0: Similar to a function signature (32 bytes).
- topic1–topic3: Indexed fields for faster filtering.
- data: Encoded non-indexed fields.
Navigating Code:
- Use block explorers to search for
emitstatements in Solidity (e.g., "emit Swap" in Uniswap’s Pool contract). - The Dune table for this event:
uniswap_v3_ethereum.Pair_evt_Swap.
Traces (ethereum.traces)
Traces document nested calls between contracts. Types include:
- CREATE: Contract deployments (see
ethereum.creation_traces). - DELEGATECALL: Forwards requests without changing logic (used in proxies).
- CALL: Generic function calls or ETH transfers.
- STATICCALL: Read-only computations (e.g., price feeds).
Trace Addresses
- Represented as arrays (e.g.,
[0,1,1]) indicating call depth/order. - Tools like Phalcon BlockSec visualize traces clearly.
FAQ
Q1: How do I identify a contract address?
A: Block explorers label them, or join ethereum.creation_traces in Dune.
Q2: What’s the difference between logs and traces?
A: Logs are emitted events; traces are internal function calls.
Q3: Why is ABI important?
A: It decodes raw transaction data into human-readable formats.
Q4: Can I reconstruct call order in Dune?
A: Currently, no—connect data by transaction hash only.
Explore Ethereum’s Dark Forest Further
Mastering these concepts prepares you for advanced queries. Weekly, analysts use ~10 different explorers. For a comprehensive guide:
Disclaimer: