Skip to content

Commit 5b6b325

Browse files
authored
feat: bridge-controller bump + Arc USDC to slip44:5042 (#34389)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> <!-- mms-check directive vocabulary — read by .github/scripts/shared/pr-template-checks.ts at module load to build the validation plan. Directives are invisible in rendered markdown and must NOT be removed or edited without updating the validator registry. type=text Section must contain non-placeholder prose. type=changelog Section must have a valid CHANGELOG entry: line. type=issue-link Section must have a Fixes:/Closes:/Refs: line with a value. type=manual-testing Section must have real testing steps or an explicit N/A. type=screenshot Section must have evidence (image/URL) or an explicit N/A. type=checklist Section must have all checkboxes consciously checked. required=true|false Whether a missing/invalid section runs the validator at all. blocking=true|false Whether a failure of this check fails the CI workflow. Default: false — failures are shown as warnings in the sticky comment but do not block the PR. Sections without a directive are checked for structural presence only. --> ## **Description** <!-- mms-check: type=text required=true --> <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: switch Arc bridge asset id to slip44:5042 ## **Related issues** <!-- mms-check: type=issue-link required=true --> Fixes: https://consensyssoftware.atlassian.net/browse/WPN-1793?atlOrigin=eyJpIjoiZjVhNjc2YzFmNDUxNGQ4YzhiOTZhZWE5MjRhNDMyNzgiLCJwIjoiaiJ9 ## **Manual testing steps** <!-- mms-check: type=manual-testing required=true --> ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- mms-check: type=screenshot required=true --> <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** <!-- mms-check: type=checklist required=true --> <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [ ] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [ ] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches bridge token identity and dependency version for Arc USDC; wrong filtering or id mismatch could hide tokens or confuse bridge selection, but scope is limited to Arc duplicate suppression and a controller bump. > > **Overview** > Aligns Arc’s native USDC bridge identity with **`eip155:5042/slip44:5042`** (replacing the prior **`erc20:0x000…`** placeholder) and bumps **`@metamask/bridge-controller`** to **^79.1.0** so bridge APIs match. > > Bridge token lists (popular/search and watchlist) now hide both the new native id and **`ARC_NATIVE_ASSET_ID_LEGACY`** so upgraded wallets don’t see duplicate Arc USDC entries after the id change. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3880d14. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 7a35b10 commit 5b6b325

5 files changed

Lines changed: 26 additions & 8 deletions

File tree

app/components/UI/Bridge/components/BridgeTokenSelector/BridgeTokenSelector.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ import { useInitialBridgeTokens } from '../../hooks/useInitialBridgeTokens';
7373
import { selectRWAEnabledFlag } from '../../../../../selectors/featureFlagController/rwa';
7474
import { isStockRwaBridgeToken } from '../../utils/isStockRwaBridgeToken';
7575
import { useABTest } from '../../../../../hooks';
76-
import { ARC_NATIVE_ASSET_ID } from '../../../../hooks/useArcDefaultTokens';
76+
import {
77+
ARC_NATIVE_ASSET_ID,
78+
ARC_NATIVE_ASSET_ID_LEGACY,
79+
} from '../../../../hooks/useArcDefaultTokens';
7780
import { selectTokenWatchlistEnabled } from '../../../Assets/selectors/featureFlags';
7881
import { useTokenWatchlistQuery } from '../../../Assets/watchlist/hooks/useTokenWatchlistQuery';
7982
import WatchlistEmptyCTA from '../../../Assets/watchlist/components/WatchlistEmptyCTA';
@@ -475,7 +478,11 @@ export const BridgeTokenSelector: React.FC = () => {
475478
.map((token) =>
476479
applyWatchlistBridgeTokenFiatDisplay(token, currentCurrency),
477480
)
478-
.filter((token) => token.assetId !== ARC_NATIVE_ASSET_ID);
481+
.filter(
482+
(token) =>
483+
token.assetId !== ARC_NATIVE_ASSET_ID &&
484+
token.assetId !== ARC_NATIVE_ASSET_ID_LEGACY,
485+
);
479486

480487
return filterWatchlistBridgeTokens(mappedTokens, {
481488
selectedChainId,

app/components/UI/Bridge/hooks/useTokensWithBalances.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import type { BridgeToken, IncludeAsset, PopularToken } from '../types';
33
import { BalancesByAssetId } from './useBalancesByAssetId';
44
import { convertAPITokensToBridgeTokens } from '../utils/tokenUtils';
55
import { mergeBridgeTokensWithBalances } from '../utils/mergeBridgeTokensWithBalances';
6-
import { ARC_NATIVE_ASSET_ID } from '../../../hooks/useArcDefaultTokens';
6+
import {
7+
ARC_NATIVE_ASSET_ID,
8+
ARC_NATIVE_ASSET_ID_LEGACY,
9+
} from '../../../hooks/useArcDefaultTokens';
710

811
/**
912
* Merges API tokens with balance data from the selector
@@ -21,5 +24,9 @@ export const useTokensWithBalances = (
2124
return mergeBridgeTokensWithBalances(
2225
convertedTokens,
2326
balancesByAssetId,
24-
).filter((token) => token.assetId !== ARC_NATIVE_ASSET_ID);
27+
).filter(
28+
(token) =>
29+
token.assetId !== ARC_NATIVE_ASSET_ID &&
30+
token.assetId !== ARC_NATIVE_ASSET_ID_LEGACY,
31+
);
2532
}, [apiTokens, balancesByAssetId]);

app/components/hooks/useArcDefaultTokens/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import Engine from '../../../core/Engine';
1212
export const ARC_USDC_ASSET_ID: CaipAssetType =
1313
'eip155:5042/erc20:0x3600000000000000000000000000000000000000';
1414

15-
export const ARC_NATIVE_ASSET_ID: CaipAssetType =
15+
export const ARC_NATIVE_ASSET_ID: CaipAssetType = 'eip155:5042/slip44:5042';
16+
17+
// Pre-slip44 placeholder some accounts may still have cached; keep filtering
18+
// it out alongside ARC_NATIVE_ASSET_ID so upgraded users don't see a duplicate.
19+
export const ARC_NATIVE_ASSET_ID_LEGACY: CaipAssetType =
1620
'eip155:5042/erc20:0x0000000000000000000000000000000000000000';
1721

1822
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
"@metamask/base-data-service": "^0.1.3",
263263
"@metamask/bitcoin-wallet-snap": "^1.14.2",
264264
"@metamask/bitcoin-wallet-standard": "^1.0.0",
265-
"@metamask/bridge-controller": "^79.0.1",
265+
"@metamask/bridge-controller": "^79.1.0",
266266
"@metamask/bridge-status-controller": "^75.0.0",
267267
"@metamask/chain-agnostic-permission": "^1.7.0",
268268
"@metamask/chomp-api-service": "^4.0.0",

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7957,7 +7957,7 @@ __metadata:
79577957
languageName: node
79587958
linkType: hard
79597959

7960-
"@metamask/bridge-controller@npm:^79.0.0, @metamask/bridge-controller@npm:^79.0.1":
7960+
"@metamask/bridge-controller@npm:^79.0.0, @metamask/bridge-controller@npm:^79.1.0":
79617961
version: 79.1.0
79627962
resolution: "@metamask/bridge-controller@npm:79.1.0"
79637963
dependencies:
@@ -35603,7 +35603,7 @@ __metadata:
3560335603
"@metamask/base-data-service": "npm:^0.1.3"
3560435604
"@metamask/bitcoin-wallet-snap": "npm:^1.14.2"
3560535605
"@metamask/bitcoin-wallet-standard": "npm:^1.0.0"
35606-
"@metamask/bridge-controller": "npm:^79.0.1"
35606+
"@metamask/bridge-controller": "npm:^79.1.0"
3560735607
"@metamask/bridge-status-controller": "npm:^75.0.0"
3560835608
"@metamask/browser-passworder": "npm:^5.0.0"
3560935609
"@metamask/browser-playground": "npm:0.8.1"

0 commit comments

Comments
 (0)