Developer guide

    How to Decode ABI-Encoded Calldata and Event Logs

    Every EVM transaction carries ABI-encoded data. Here's how to turn raw hex into human-readable function calls and event parameters — without writing a single script.

    What Is ABI-Encoded Data?

    When you call a smart contract function, your wallet encodes the function name and arguments into a hex string called calldata. It starts with a 4-byte function selector followed by 32-byte encoded arguments.

    0xa9059cbb
      0000000000000000000000005B38Da6a701c568545dCfcB03FcB875f56beddC4
      0000000000000000000000000000000000000000000000000de0b6b3a7640000
    
    → transfer(address, uint256)
      to: 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4
      amount: 1000000000000000000

    Event logs work similarly — they contain indexed topics (used for filtering) and ABI-encoded data fields. Without the ABI, these are just opaque hex blobs.

    The Hard Way: Decoding by Hand

    The traditional approach to decoding calldata or event logs requires development tooling:

    • Extract the 4-byte selector and look it up in a signature database
    • Use ethers.js Interface.decodeFunctionData() or web3.js to parse the arguments
    • For events, match topic[0] against known event signatures and decode the data fields
    • Handle edge cases: proxy contracts, custom errors, packed encoding
    • Write and run a script every time you need to inspect a transaction

    The Easy Way: ABI Page Builder

    ABI Page Builder includes two built-in decoders that work instantly in your browser:

    Calldata Decoder (Overview tab)

    1. Paste your ABI and generate a contract page
    2. Open the Overview tab
    3. Paste raw calldata hex into the Calldata Decoder
    4. See the decoded function name, parameter names, types, and values

    If no matching function is found, a raw fallback mode extracts the 4-byte selector and splits data into 32-byte slots.

    Event Log Decoder (Events tab)

    1. Switch to the Events tab on your contract page
    2. Enter a transaction hash to fetch logs, or paste raw log JSON
    3. See decoded event names, indexed parameters, and data fields

    When Would You Use This?

    • Debugging a failed transaction — see exactly which function was called and with what arguments
    • Auditing contract interactions — verify that a multisig payload matches the intended action
    • Investigating on-chain activity — decode MEV bot transactions or suspicious contract calls
    • Verifying governance proposals — confirm that encoded execution data matches the proposal description
    • Inspecting event history — decode raw logs to understand what happened in a transaction

    Manual Decoding vs ABI Page Builder

    CriteriaManual (script)ABI Page Builder
    Setup time5–15 min30 seconds
    DependenciesNode.js, ethers.jsNone
    Error handlingWrite your ownBuilt-in fallback
    Event log supportExtra code neededBuilt-in
    ShareableNoYes (IPFS link)

    👉 Got calldata to decode?

    Try It Now

    Related Guides