Skip to content

Conversation

@prasanna-anchorage
Copy link
Contributor

@prasanna-anchorage prasanna-anchorage commented Nov 30, 2025

This is extracted from the work I initially did in #95 and from what lives on in ethglobal/buenos-aires branch. The idea here is to showcase how far you can get to support a protocol and a specific transaction with just alloy-sol-types's sol! macro and the abstractions provided by visualsign-parser.

For instance this unsigned txn decodes as following in human-mode

cargo run --quiet -p parser_cli -- --chain ethereum -t 0x02f90536013c840cccef50840cccef508309de0c946566194141eefa99af43bb5aa71460ca2dc9024580b9050c374f435d00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4d505accf000000000000000000000000078473fc814d2581c0e9b06efb2443ea503421cb0000000000000000000000004a6c312ec70e8747a587ee860a0353cd42be0ae000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000068f67d97000000000000000000000000000000000000000000000000000000000000001b5c10d948b0e33626f5f196df389c9f8b95c85a66065bc16c5a23a5ba9dde396941a237ed342773264d7a1694bcce90bf5538ae75eab39edd0ebcb1077442df9f000000000000000000000000000000000000000000000000000000000000000000000000000000004a6c312ec70e8747a587ee860a0353cd42be0ae000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d96ca0b9000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000004a6c312ec70e8747a587ee860a0353cd42be0ae000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000000000000000000000004a6c312ec70e8747a587ee860a0353cd42be0ae000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000846ef5eeae000000000000000000000000beef01735c132ada46aa9aa4c54623caa92a64cb00000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000003ece3bf77e9a9000000000000000000000000078473fc814d2581c0e9b06efb2443ea503421cb0000000000000000000000000000000000000000000000000000000068f661a72222da44c0 --output human
┌─ Transaction: Ethereum Transaction
│  Version: 0
│  Type: EthereumTx
│
└─ Fields:
   ├─ Network: Ethereum Mainnet
   ├─ To: 0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245
   ├─ Value: 0 ETH
   ├─ Gas Limit: 646668
   ├─ Gas Price: 0.2147572 gwei
   ├─ Max Priority Fee Per Gas: 0.2147572 gwei
   ├─ Nonce: 60
   └─ Morpho Bundler
         Title: Morpho Bundler Multicall
         Detail: 3 operation(s)
         📖 Expanded View:
         ├─ Permit
         │     Title: ERC-2612 Permit
         │     Detail: Permit 1.000000 USDC to 0x4a6c312ec70e8747a587ee860a0353cd42be0ae0 (expires: 2025-10-20 18:21 UTC)
         │     📖 Expanded View:
         │     ├─ Token: USDC (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
         │     ├─ Owner: 0x078473fc814d2581c0e9b06efb2443ea503421cb
         │     ├─ Spender: 0x4a6c312ec70e8747a587ee860a0353cd42be0ae0
         │     ├─ Value: 1.000000 USDC (raw: 1000000)
         │     └─ Deadline: 1760984471 (2025-10-20 18:21 UTC)
         ├─ Morpho Transfer
         │     Title: ERC20 Transfer
         │     Detail: Transfer 1.000000 USDC to 0x4a6c312ec70e8747a587ee860a0353cd42be0ae0
         │     📖 Expanded View:
         │     ├─ Token: USDC (0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
         │     ├─ Receiver: 0x4a6c312ec70e8747a587ee860a0353cd42be0ae0
         │     └─ Amount: 1.000000 USDC (raw: 1000000)
         └─ Vault Deposit
               Title: ERC4626 Vault Deposit
               Detail: Deposit 1000000 assets into vault 0xbeef01735c132ada46aa9aa4c54623caa92a64cb (min 1104887844170153 shares) for 0x078473fc814d2581c0e9b06efb2443ea503421cb
               📖 Expanded View:
               ├─ Vault: 0xbeef01735c132ada46aa9aa4c54623caa92a64cb
               ├─ Assets: 1000000
               ├─ Min Shares: 1104887844170153
               └─ Receiver: 0x078473fc814d2581c0e9b06efb2443ea503421cb


Run with `--condensed-only` to see what users see on hardware wallets

Note that this doesn't cover any proxy calls or inner contract calls

prasanna-anchorage and others added 28 commits November 21, 2025 08:05
Updated the security policy to include guidelines for reporting vulnerabilities and our response policy.

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Enhance security policy with reporting guidelines
Clarified PR approval requirements for Core Team Members and Community/Public contributors, specifying the need for Anchorage employee involvement.

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
* chore: Add @guido-peirano-anchor to CLA signers list

Approved by: @prasanna-anchorage
Related PR: #113

add diego-rivas-anchor to .cla-signed-users too

* add the bot too

---------

Co-authored-by: Prasanna Gautam <prasanna@anchorlabs.com>
* feat: Add VisualizerContext for Ethereum transaction visualization

  Add VisualizerContext struct with nested call support and token formatting.
  Includes Clone implementation, for_nested_call() method, and unit tests.

Roadmap: Milestone 1-1, core datastructure

* refactor: Implement Builder pattern for EthereumVisualizerRegistry

  - Rename VisualizerRegistry to EthereumVisualizerRegistry to avoid naming conflicts
  - Split into immutable EthereumVisualizerRegistry and mutable EthereumVisualizerRegistryBuilder
  - Clarify lifecycle: setup phase (builder) vs. execution phase (registry)
  - Make register() return Option<Box<dyn ContractVisualizer>> to signal overwrites
  - Add with_default_protocols() for explicit protocol initialization
  - Improve maintainability by enforcing setup/runtime separation in type system

Roadmap: Milestone 1.1 - ContractVisualizer trait

* refactor: Code formatting and registry module enhancements

  - Format code for better readability (alignment, line breaks)
  - Replace custom token formatting with Alloy's format_units utility
  - Implement ContractRegistry module with token and contract type
  management
  - Add comprehensive token formatting with metadata lookup
  - Update test fixtures to use proper formatting conventions

Roadmap: Milestone 1.1 - Registry
Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Consolidate token metadata structures - Milestone 1.1

  - Create token_metadata module as canonical wallet format for chain
  and token data
  - Define TokenMetadata struct with symbol, name, erc_standard,
  contract_address, decimals
  - Define ChainMetadata struct for wallet token metadata (network_id:
   String, assets: HashMap<symbol, TokenMetadata>)
  - Implement parse_network_id() to map network identifiers to chain
  IDs
  - Implement compute_metadata_hash() for SHA256 hashing of protobuf
  bytes
  - Refactor ContractRegistry to use canonical TokenMetadata structure
  - Registry internally maps (chain_id, Address) -> TokenMetadata for
  efficient lookup
  - Consolidate duplicate TokenMetadata and AssetInfo definitions
  - Update load_chain_metadata() to transform wallet format to
  registry format
  - Add sha2 dependency for metadata hashing

Co-Authored-By: Claude <noreply@anthropic.com>
Roadmap: Milestone 1.1 - Token and Contract registry

* docs: Add CLAUDE.md guidelines for visualsign-ethereum module

  - Document field builder functions from visualsign crate
  - Include token metadata and registry usage patterns
  - Add supported networks and chain ID mappings
  - Provide best practices and common code examples
  - Reference Milestone 1.1 token and contract registry work

Co-Authored-By: Claude <noreply@anthropic.com>
Roadmap: Milestone 1.1 - code complete, starting on Uniswap using these

* feat: Add registry architecture documentation and debug tracing

  - Document proposed registry refactor with provenance tracking
  - Add debug trace for contract/token lookups in transaction
  visualization
  - TODO marks for future registry layer implementation

Roadmap: This marks reaching Stage1,we can start on contracts

* fix: Address Copilot PR review comments and clippy warnings

- Fix CLAUDE.md example to handle Result from register_token
- Use inline format strings in token_metadata.rs (clippy)
- Use .values() iterator in registry.rs (clippy)
- Mark design doc code block as ignore to fix doc test

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
* Adding mintToChecked and burnChecked methods

* Refactor fixture tests to use a common test function for mintToChecked and burnChecked transactions, improving code reuse and readability.

* cargo fmt

* Update error handling and layout generation to use more concise syntax.

* Improve error message formatting for unsupported Token 2022 instructions

* Adding test for non-happy path

* Enhance security policy with reporting guidelines

Updated the security policy to include guidelines for reporting vulnerabilities and our response policy.

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* Governance and Contribution docs

* Update contribution workflow and approval requirements

Clarified PR approval requirements for Core Team Members and Community/Public contributors, specifying the need for Anchorage employee involvement.

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* Update GOVERNANCE.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* Update CONTRIBUTING.md

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>

* chore: Add CLA signers batch (#114)

* chore: Add @guido-peirano-anchor to CLA signers list

Approved by: @prasanna-anchorage
Related PR: #113

add diego-rivas-anchor to .cla-signed-users too

* add the bot too

---------

Co-authored-by: Prasanna Gautam <prasanna@anchorlabs.com>

* [BabyPR:ETHGlobal 1/6] Core Infrastructure Update (#102)

* feat: Add VisualizerContext for Ethereum transaction visualization

  Add VisualizerContext struct with nested call support and token formatting.
  Includes Clone implementation, for_nested_call() method, and unit tests.

Roadmap: Milestone 1-1, core datastructure

* refactor: Implement Builder pattern for EthereumVisualizerRegistry

  - Rename VisualizerRegistry to EthereumVisualizerRegistry to avoid naming conflicts
  - Split into immutable EthereumVisualizerRegistry and mutable EthereumVisualizerRegistryBuilder
  - Clarify lifecycle: setup phase (builder) vs. execution phase (registry)
  - Make register() return Option<Box<dyn ContractVisualizer>> to signal overwrites
  - Add with_default_protocols() for explicit protocol initialization
  - Improve maintainability by enforcing setup/runtime separation in type system

Roadmap: Milestone 1.1 - ContractVisualizer trait

* refactor: Code formatting and registry module enhancements

  - Format code for better readability (alignment, line breaks)
  - Replace custom token formatting with Alloy's format_units utility
  - Implement ContractRegistry module with token and contract type
  management
  - Add comprehensive token formatting with metadata lookup
  - Update test fixtures to use proper formatting conventions

Roadmap: Milestone 1.1 - Registry
Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Consolidate token metadata structures - Milestone 1.1

  - Create token_metadata module as canonical wallet format for chain
  and token data
  - Define TokenMetadata struct with symbol, name, erc_standard,
  contract_address, decimals
  - Define ChainMetadata struct for wallet token metadata (network_id:
   String, assets: HashMap<symbol, TokenMetadata>)
  - Implement parse_network_id() to map network identifiers to chain
  IDs
  - Implement compute_metadata_hash() for SHA256 hashing of protobuf
  bytes
  - Refactor ContractRegistry to use canonical TokenMetadata structure
  - Registry internally maps (chain_id, Address) -> TokenMetadata for
  efficient lookup
  - Consolidate duplicate TokenMetadata and AssetInfo definitions
  - Update load_chain_metadata() to transform wallet format to
  registry format
  - Add sha2 dependency for metadata hashing

Co-Authored-By: Claude <noreply@anthropic.com>
Roadmap: Milestone 1.1 - Token and Contract registry

* docs: Add CLAUDE.md guidelines for visualsign-ethereum module

  - Document field builder functions from visualsign crate
  - Include token metadata and registry usage patterns
  - Add supported networks and chain ID mappings
  - Provide best practices and common code examples
  - Reference Milestone 1.1 token and contract registry work

Co-Authored-By: Claude <noreply@anthropic.com>
Roadmap: Milestone 1.1 - code complete, starting on Uniswap using these

* feat: Add registry architecture documentation and debug tracing

  - Document proposed registry refactor with provenance tracking
  - Add debug trace for contract/token lookups in transaction
  visualization
  - TODO marks for future registry layer implementation

Roadmap: This marks reaching Stage1,we can start on contracts

* fix: Address Copilot PR review comments and clippy warnings

- Fix CLAUDE.md example to handle Result from register_token
- Use inline format strings in token_metadata.rs (clippy)
- Use .values() iterator in registry.rs (clippy)
- Mark design doc code block as ignore to fix doc test

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>

* Add spl-token-2022-interface dependency and refactor Token 2022 instruction parsing to utilize the new interface for improved clarity and error handling.

* cargo fmt

* fix lint

---------

Signed-off-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Co-authored-by: Diego Rivas <diego.rivas@anchorlabs.com>
Co-authored-by: prasanna-anchorage <48452975+prasanna-anchorage@users.noreply.github.com>
Co-authored-by: Prasanna Gautam <prasanna@anchorlabs.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
…caffolding (#103)

* feat: Add VisualizerContext for Ethereum transaction visualization

  Add VisualizerContext struct with nested call support and token formatting.
  Includes Clone implementation, for_nested_call() method, and unit tests.

Roadmap: Milestone 1-1, core datastructure

* refactor: Code formatting and registry module enhancements

  - Format code for better readability (alignment, line breaks)
  - Replace custom token formatting with Alloy's format_units utility
  - Implement ContractRegistry module with token and contract type
  management
  - Add comprehensive token formatting with metadata lookup
  - Update test fixtures to use proper formatting conventions

Roadmap: Milestone 1.1 - Registry
Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Consolidate token metadata structures - Milestone 1.1

  - Create token_metadata module as canonical wallet format for chain
  and token data
  - Define TokenMetadata struct with symbol, name, erc_standard,
  contract_address, decimals
  - Define ChainMetadata struct for wallet token metadata (network_id:
   String, assets: HashMap<symbol, TokenMetadata>)
  - Implement parse_network_id() to map network identifiers to chain
  IDs
  - Implement compute_metadata_hash() for SHA256 hashing of protobuf
  bytes
  - Refactor ContractRegistry to use canonical TokenMetadata structure
  - Registry internally maps (chain_id, Address) -> TokenMetadata for
  efficient lookup
  - Consolidate duplicate TokenMetadata and AssetInfo definitions
  - Update load_chain_metadata() to transform wallet format to
  registry format
  - Add sha2 dependency for metadata hashing

Co-Authored-By: Claude <noreply@anthropic.com>
Roadmap: Milestone 1.1 - Token and Contract registry

* feat: Add registry architecture documentation and debug tracing

  - Document proposed registry refactor with provenance tracking
  - Add debug trace for contract/token lookups in transaction
  visualization
  - TODO marks for future registry layer implementation

Roadmap: This marks reaching Stage1,we can start on contracts

* fix: Address Copilot PR review comments and clippy warnings

- Fix CLAUDE.md example to handle Result from register_token
- Use inline format strings in token_metadata.rs (clippy)
- Use .values() iterator in registry.rs (clippy)
- Mark design doc code block as ignore to fix doc test

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Add type-safe protocol architecture for Ethereum contracts

- Implement ContractType trait with compile-time uniqueness guarantees
- Restructure: contracts/core/ for standards, protocols/ for DeFi protocols
- Create protocols/uniswap module with config, contracts/, and register()
- Add register_contract_typed<T>() for type-safe contract registration
- Implement FallbackVisualizer for unknown contract calls
- Document Uniswap versions (V1, V1.2, V2) and V4 PoolManager for future

Impact: Prevents duplicate type identifiers at compile-time, enables
scalable addition of protocols (Aave, Compound, etc.), and provides
clear architectural patterns for contract organization.

Roadmap: Milestone 2

* feat(ethereum): Type-safe protocol architecture with Uniswap scaffolding

- Add ContractType trait for compile-time unique contract identifiers
- Restructure: contracts/core/ (standards) vs protocols/ (DeFi protocols)
- Implement protocols/uniswap module with config-driven registration
- Rename UniswapV4Visualizer → UniversalRouterVisualizer (matches IUniversalRouter)
- Stub ERC721, Permit2, and V4 PoolManager for future Etherscan decoding
- Add FallbackVisualizer for unknown contracts
- Document Uniswap versions (V1, V1.2, V2) and V4 PoolManager

Impact: Prevents duplicate type identifiers at compile-time, enables scalable
addition of protocols with clear separation of concerns.

Roadmap: Uniswap transaction decoding

* docs(ethereum): Add comprehensive ARCHITECTURE.md with scope and limitations

Incorporate "Scope and Limitations" section from ethglobal/buenos-aires to
clarify architectural boundaries between calldata decoding (in-scope) and
transaction simulation (out-of-scope). This sets the final vision through PR 6.

- Add detailed "Scope and Limitations" section explaining what module decodes
  vs what requires simulation (actual amounts, pool resolution, state changes)
- Remove redundant "Benefits" checklists and testing scaffolding
- Keep focused on essential architecture without implementation details
- Include example output and rationale for scope boundaries

* fix(ethereum): Resolve clippy warnings and apply formatting

  - Prefix unused parameters with underscore in visualize_tx_commands
  - Replace expect(&format!(...)) with unwrap_or_else(|| panic!(...))
  - Use inline format string for chain_id in panic message
  - Apply cargo fmt formatting across modified files

Co-Authored-By: Claude <noreply@anthropic.com>

* change back to Input Data

---------

Co-authored-by: Claude <noreply@anthropic.com>
Shows fee more correctly
  WRAP_ETH was missing recipient field in struct definition, causing
  address bytes to be interpreted as amount (showing "2 ETH" instead
  of "0.0032 ETH").

  SWEEP had incorrect field order (token, amount, recipient) instead
  of (token, recipient, amount), causing recipient bytes to be read
  as amount (showing astronomically large numbers).

  Added unit tests for both decoders to verify correct parameter
  order and amount formatting.
  - Add `pub mod id` to chains.rs with constants grouped by chain type
  - Update match statement to use named constants instead of magic numbers
  - Replace local chains module in uniswap/config.rs with re-export
  - Add DefiLlama chainlist attribution for future additions

  Supported chains: Ethereum, BSC, Polygon, Avalanche, Fantom, Gnosis,
  Celo (L1); Optimism, Arbitrum, Base, Blast, Mantle, Worldchain (L2-OP);
  zkSync, Linea, Scroll (L2-ZK); Zora, Unichain (App-Specific)

Co-Authored-By: Claude <noreply@anthropic.com>
  - use LayeredRegistry for AbiRegistry
  - Update VisualizerContextParams and VisualizerContext to use
    LayeredRegistry<AbiRegistry> for wallet-first ABI lookups
  - Add Clone derive to LayeredRegistry in visualsign crate
  - Fix test in abi_decoder.rs (incorrect visualize args)
  - Fix tests in context.rs (missing abi_registry field)
  - Fix clippy warnings (op_ref, uninlined_format_args)

ABIs must be embedded at compile-time using include_str!() for security and
determinism. Supports per-chain address mapping and fallback visualization.

Co-Authored-By: Claude <noreply@anthropic.com>
Add minimal example demonstrating compile-time ABI embedding pattern:
- SimpleToken.sol: Example smart contract with mint/burn functions
- SimpleToken.abi.json: Generated ABI for static embedding
- README.md: Complete guide for dapp developers on using embedded ABIs

Demonstrates best practices for compile-time embedding via include_str!()
macro and AbiRegistry configuration.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Implement phase 2-4 of ABI embedding feature:

Phase 2: Create embedded_abis.rs helper module
- register_embedded_abi() for compile-time embedded ABIs
- map_abi_address() for chain-specific address mapping
- parse_abi_address_mapping() for CLI argument parsing ("AbiName:0xAddress")
- Proper error handling with AbiEmbeddingError type
- 8 comprehensive tests including integration tests

Phase 3: Extend CLI with --abi flag support
- Add --abi argument to parser CLI (Vec<String> for multiple mappings)
- Implement validate_abi_mappings() helper for format validation
- Enhanced user feedback with mapping details and summaries
- Seamlessly integrated into existing parse_and_display pipeline

Phase 4: Fix infrastructure issues
- Update test cases with missing abi_registry field in context
- Add embedded_abis to module exports
- Enable visualsign-ethereum dependency in CLI Cargo.toml

Updated documentation:
- Enhanced README.md with CLI integration section
- Added multiple mapping examples
- Updated Rust code example with register_embedded_abi()
- Clarified compilation/embedding requirements

Testing:
- All 120 ethereum parser tests pass
- 8 new embedded_abis tests validate registration, mapping, and parsing
- CLI builds successfully with new ABI support

Pending: Phase 5 (gRPC metadata integration) requires converter interface
refactor to accept AbiRegistry through VisualizerContext.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Create TESTING.md guide for ABI embedding with:

1. Prerequisites & Installation
   - Foundry/cast installation instructions
   - Version verification commands

2. Getting Real ABIs (3 methods)
   - Etherscan API (recommended) with curl examples
   - cast commands for available versions
   - Online ABI repositories (OpenZeppelin, etc.)
   - Real contract examples (USDC, WETH, Uniswap)

3. Local Testing Instructions
   - Step-by-step: fetch ABIs → create test binary → run example
   - Complete working Rust example with SimpleToken
   - Multi-ABI registry setup and verification

4. CLI Integration Examples
   - Generate calldata with `cast calldata`
   - Get function selectors with `cast sig`
   - Working test commands
   - SimpleToken reference example

5. Real Contract Examples
   - USDC, WETH, Uniswap V3 with addresses
   - How to inspect function signatures with jq
   - Selector matching examples

6. Troubleshooting
   - PATH issues with Foundry
   - Etherscan API key validation
   - ABI verification and inspection
   - Function selector mismatches
   - Address format handling

7. Testing Script
   - Complete bash script for fetching multiple ABIs
   - Error handling and verification
   - Quick test commands without API key

Tested locally:
- cast sig "transfer(address,uint256)" → 0xa9059cbb ✓
- cast calldata generates valid Ethereum calldata ✓
- All examples are executable and verified

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
  Introduces extract_abi_from_metadata for wallet-provided ABIs with optional secp256k1 signature validation support.
  Wires up complete end-to-end support for loading custom ABI JSON files at runtime and decoding transaction parameters:

  Core changes:
  - Add `abi_registry` field to `VisualSignOptions` for passing registries through both CLI and gRPC pipelines
  - Implement parameter decoding in AbiDecoder for common Solidity types:
    * uint256 and other uint types (decoded as decimal)
    * address (decoded as checksummed hex)
    * address[] (dynamic arrays decoded with proper offset handling)
  - Update Ethereum converter to extract AbiRegistry from options and use DynamicAbiVisualizer for unknown contracts
  - Add `load_and_map_abi()` helper to combine file loading and address mapping

  CLI changes:
  - Rename `--abi` to `--abi-json-mappings` with format: `AbiName:/path/to/file.json:0xAddress`
  - Build AbiRegistry from file-based mappings and pass through options to visualizer

  Verified with SushiSwapRouter example - all parameters decode correctly matching Etherscan.
- Add Morpho protocol module with Bundler3 contract visualization
- Implement type-safe decoding for multicall operations (permit, transfer, vault deposit)
- Add IERC2612 interface for standard ERC-2612 permit parsing
- Fix permit parameter decoding with proper token amount formatting
- Add utility functions for unlimited value detection (is_unlimited_u256/u128)
- Register Morpho contracts across mainnet, Optimism, Base, and Arbitrum
- Support detailed parameter breakdown in expanded transaction views

Fixes permit decoding that was previously failing with "Failed to decode permit parameters"
error by using correct ABI interface for standard ERC-2612 permits vs bundler-specific variants.
@prasanna-anchorage prasanna-anchorage changed the base branch from main to feat/ethereum-ethglobal-e2e November 30, 2025 10:23
@prasanna-anchorage prasanna-anchorage force-pushed the feat/ethereum-ethglobal-e2e branch 2 times, most recently from fa0577a to 7e672cc Compare December 2, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants