Skip to main content
Integrating a wallet? See Ethereum for Wallets. Building contracts that wallets render meaningfully? See Ethereum for dApp Builders. This page describes the parser’s capabilities for contributors adding new visualizations.
The Ethereum module handles transactions for Ethereum and EVM-compatible chains.

Architecture overview

Transaction model

  • Encoding: RLP (Recursive Length Prefix)
  • Account Model: Account-based with nonce tracking
  • Gas System: Dynamic pricing with base fee + priority fee (EIP-1559)

Key components

The Ethereum parser handles:
  • Native ETH transfers
  • ERC-20 and ERC-721 token standards
  • Uniswap Universal Router (V2 and V3 exact-in and exact-out swaps; V4 commands recognized but not yet decoded) and Permit2
  • Smart contract method calls via wallet-supplied ABIs

Transaction types

1. Simple transfer

Basic ETH transfer between addresses with gas calculation. Supported transaction envelopes: Legacy and EIP-1559. EIP-2930, EIP-4844, and EIP-7702 currently return a parse error with the message "Unsupported transaction type: eip-2930" (and so on for the other types).

2. Token operations

  • ERC-20: Transfer, Approve, TransferFrom are decoded automatically.
  • ERC-721: NFT transfers and approvals are not yet decoded; calls fall through to the raw-hex fallback. The visualizer is a stub pending implementation.
  • ERC-1155: Recognized as a token type, but multi-token calls require a wallet-supplied ABI to decode.

3. Smart contract calls

Decode function calls using a wallet-supplied ABI to show:
  • Method name and parameters
  • Token amounts as raw on-chain integers (the generic ABI decoder does not scale amounts or attach symbols; that happens only in protocol-specific decoders such as the Uniswap Universal Router handler)

4. Auto-decoded protocols

Built-in decoders ship for:
  • Uniswap Universal Router: V2 and V3 exact-in and exact-out swaps, wrap/unwrap, fee payments, and single Permit2 commands. V4 commands are recognized but not yet decoded.
  • Permit2: single allowance grants and single signature-based transfers.
The V4 PoolManager visualizer is currently a stub; direct calls fall through to the generic fallback decoder. Other DeFi protocols (Aave, Compound, OpenSea, and so on) are not decoded out of the box. They render through the generic ABI decoder when a wallet supplies the contract’s ABI via abi_mappings.

Visualization strategy

Primary information

For an annotated rendered example (a real Uniswap Universal Router swap with nested PreviewLayout commands), see Ethereum for Wallets.

Gas information

Always shown as expandable preview:
  • Condensed: Total fee in ETH and USD
  • Expanded: Gas price, limit, max fee breakdown

Risk indicators

The parser flags unlimited Permit2 allowances (max-u160) as "Unlimited Amount" so wallets can render an obvious warning. Other risk signals (first-time recipients, unverified contracts, high-value transfer thresholds) are wallet-side responsibilities and are not produced by the parser.

Name resolution

The module resolves known token addresses through a built-in ContractRegistry mapping (chain_id, address) → TokenMetadata. Wallets can supply additional token entries in their own metadata layer to extend that set. EthereumMetadata.abi_mappings is separate: it provides contract ABIs for calldata decoding and does not add entries to the token registry. The parser is calldata-only and does not make RPC calls, so on-chain resolution (ENS, off-chain token lists) happens at the wallet layer, not here.

Implementation details

Full source code available at:

Chain support

The parser recognizes a broad set of network_id values (Ethereum mainnet and testnets, BSC, Polygon, Avalanche, Gnosis, Celo, Fantom, Optimism, Arbitrum, Base, Blast, Mantle, World Chain, zkSync Era, Linea, Scroll, Zora, Unichain, and their testnet variants where applicable). The authoritative list is defined by network_id_to_chain_id in networks.rs. Of those, the built-in token metadata ships only for five chains:
  • ETHEREUM_MAINNET (chain ID 1)
  • POLYGON_MAINNET (chain ID 137)
  • ARBITRUM_MAINNET (chain ID 42161)
  • OPTIMISM_MAINNET (chain ID 10)
  • BASE_MAINNET (chain ID 8453)
On other recognized chains, the parser still labels the network and decodes calldata; token symbol and decimal resolution is limited to the built-in registry (wallet-supplied token metadata via chain_metadata is not yet supported). Pass the actual network_id for the chain you’re parsing; the metadata value overrides the transaction’s embedded chain ID, so reusing an unrelated network_id will mislabel the network and may affect protocol address matching.

Example outputs

  • ETH Transfer - Shows sender, recipient, amount, and gas fee in a clear layout
  • Token Swap - Displays input/output tokens, exchange rate, slippage, and protocol used
  • ERC-721 / NFT Transfer - Not yet decoded; renders as raw hex calldata until ERC-721 support lands

Resources