Conversation
blurpesec
left a comment
There was a problem hiding this comment.
Can you add example txs for each tx type to the test-cases https://github.com/MetaMask/tx-categorize/blob/main/packages/tx-categorize/src/testCases.mock.ts
so that we maintain coverage in tests and can guarantee tx categorizations don't conflict?
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, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ce18731. Configure here.
| if (action === Action.WITHDRAW && receivedAssets.length > 1) return Action.WITHDRAW_MULTI | ||
| if (action === Action.COLLECT && receivedAssets.length > 1) return Action.COLLECT_MULTI | ||
| if (action === Action.MODIFY_LIQUIDITY && sentAssets.length >= 2) return Action.MODIFY_LIQUIDITY_MULTI_SENT | ||
| if (action === Action.MODIFY_LIQUIDITY && receivedAssets.length >= 2) return Action.MODIFY_LIQUIDITY_MULTI_RECV |
There was a problem hiding this comment.
Inconsistent threshold style in multi-asset refinement checks
Low Severity
The MODIFY_LIQUIDITY checks use >= 2 while every other multi-asset check in refineActionForMultiAssets uses > 1. Although logically equivalent for integer lengths, this breaks the consistent style established by EXCHANGE, DEPOSIT, WITHDRAW, and COLLECT checks — all of which use > 1. Using a different comparison form for the same semantic intent increases cognitive load when reading and maintaining this function.
Reviewed by Cursor Bugbot for commit ce18731. Configure here.


Note
Medium Risk
Touches core categorization heuristics and protocol labeling, which can change user-visible transaction types/readables across multiple DeFi protocols; tests/fixtures reduce risk but coverage changes may cause unexpected recategorization.
Overview
Improves DeFi coverage in
tx-categorizeby adding new actions (COLLECT,MODIFY_LIQUIDITY+ multi-asset variants) and wiring them into heuristic detection (new methodId/topicHash rules and additional contract determinants for Uniswap V3/V4, Curve pools, Convex reward/stake/claim, Aave staking, and MetaMask pooled staking).Normalizes protocol/version attribution and
toAddressNamemappings (e.g., collapsing*_Vxprotocols into a base protocol withversionmetadata for 0x/1inch/Paraswap/Uniswap/Aave/ENS/Tornado/MetaMask Bridge), updates/extends fixtures + test cases, and hardens snapshot tests (CI-defaultnocklockdown, skip empty hashes, and avoid circular AxiosError rethrows).Reviewed by Cursor Bugbot for commit ce18731. Bugbot is set up for automated code reviews on this repo. Configure here.