feat: decode ICA calls and transaction routes#326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
6f16e5e to
c2e736a
Compare
428e5f4 to
40b58f9
Compare
c2e736a to
244d022
Compare
244d022 to
b1b5b9f
Compare
40b58f9 to
abff71b
Compare
b1b5b9f to
a9e7399
Compare
a9e7399 to
e9aace2
Compare
e9aace2 to
7ddda1e
Compare
7ddda1e to
42243f9
Compare
42243f9 to
d6f7874
Compare
d6f7874 to
7bb5c1c
Compare
43eee8b to
26d8e30
Compare
26d8e30 to
39e43d5
Compare
39e43d5 to
19f7c4e
Compare
19f7c4e to
f053cbe
Compare
f053cbe to
8ef0125
Compare
8ef0125 to
b2da04a
Compare
b2da04a to
4567d58
Compare
4567d58 to
5e0e2ab
Compare
|
@claude review |
|
Claude finished @Xaroz's task in 5m 57s —— View job Claude PR Review
Consolidated review posted: Review #4265119846. Headline findings (none blocking):
Minor:
All prior bugbot threads (V2 path reversal, command-mask, |
There was a problem hiding this comment.
Review Summary
Nice polish on top of #259. The Universal Router plan walker is the most subtle bit and the test suite covers the path/version/sub-plan permutations well. The new Transaction Overview panel is a clean addition; tests cover the decoding pipeline, and the conservative single-Withdrawal-log gate for native outputs is the right call after the earlier topics[1] mix-up.
A handful of remaining concerns below — none of them blocking. Most are edge-case correctness or maintainability nits, all in the diff. Prior bugbot threads (V2 reversal, command-mask, ?? vs ||, stale tokenOutType, withdrawal source mismatch) all look resolved.
Main things I'd want a second look at:
formatTokenAmount's 6-decimal fallback can misformat small 18-decimal amounts by 12 orders of magnitude (seeica.ts:526).- ERC20 actual-output summation in
fetchActualOutputAmountis not as conservative as the native path — when an intermediate swap recipient is the router itself it can double-count via router→user transfers (seeTransactionRouteSummaryCard.tsx:407). decodeUniversalRouterPlanis long enough (~95 lines, 5 command branches + sub-plan recursion + state overwrite per command) that extracting per-command handlers would help future maintenance, especially as more Universal Router commands get added.
Minor:
tokenOut = 'native'(ica.ts:736) is a magic string that downstream code has to special-case alongsidetokenOutType. A named sentinel or leavingtokenOutundefined + relying solely ontokenOutTypewould make the contract more explicit.useStoreis reached via both../../store(re-export) and../../metadataStoreacross the new files. Both resolve to the same store; pick one import path for consistency.
The acknowledged IcaCallDetails / NestedIcaCallDetails duplication is fine for this PR — agreed it's not worth the abstraction during final polish.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 877e316. Configure here.

Summary
Final polish PR after #259/#261 landed. Adds deeper ICA calldata parsing and a tx-level
Transaction Overviewpanel so superswap/metaswap txs read as one origin-token to destination-token route when that route can be decoded.Changes
approve,transfer,transferFromtransferRemoteexecuteroute summaries0x3f):EXECUTE_SUB_PLANcommand planssymbol,name,decimalsfallback for decoded token addressesWithdrawallogs for native outputs such as TRX unwrapsTransferlogs to decoded output recipients for token outputsmailbox.process(metadata, message)tx parsingICA Calls,ICA Commitment,ICA Reveal)Transaction Overviewpanel that combines:/tx/[txHash]visits, not only client navigationStack
mainafter feat: add ICA message decoding and visualization #259 and feat: add transaction page to view all messages in a tx #261 were mergedNotes
CALLSmessages decode from the Hyperlane message body without RPC fetchesmailbox.process(metadata, message)tx metadataValidation
pnpm run formatpnpm run typecheckpnpm run lintpnpm run test -- src/features/messages/ica.test.ts src/utils/useVisibleInterval.test.tspnpm run buildNote
Medium Risk
Adds new ICA calldata/multicall decoding and uses it to derive cross-chain swap routes and output amounts; correctness depends on on-chain log parsing and ABI decoding, so mis-decoding could lead to misleading UI summaries but does not change transaction execution.
Overview
Adds deeper ICA call decoding and surfaces it in the UI. ICA calls now attempt to decode common calldata (ERC20 actions,
transferRemote, and Universal Router swap plans), show a prominent decoded summary banner, and expand multicall/batch calls into nested call rows with per-target explorer links.Refactors ICA utilities into a modular
src/features/messages/ica/package (body, calldata, multicall, reveal parsing, routers, hooks, types) and adds a comprehensive Jest suite covering multicall decoding and Universal Router edge cases.Introduces a tx-level
Transaction Overviewpanel that combines warp-transfer inputs with decoded ICA swap outputs (token/native), optionally resolving token metadata (registry or on-chain) and best-effort actual output amounts from destination receipts. The/tx/[txHash]page layout is updated to load required metadata on direct visits, improve ICA row titles/summaries, and tweak styling/tooltip placement.Reviewed by Cursor Bugbot for commit 79628d9. Bugbot is set up for automated code reviews on this repo. Configure here.