-
-
Notifications
You must be signed in to change notification settings - Fork 239
fix: check for all native assetIds in isNativeAddress util #6076
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Address Matching Bug
The isNativeAddress
function incorrectly identifies non-native addresses as native assets. The condition address.includes(reference) || reference.endsWith(address)
is overly permissive. For example, an address like 'account60' would match a '60' SLIP44 reference, and '1' would match '501', leading to arbitrary strings being treated as native assets.
packages/bridge-controller/src/utils/bridge.ts#L162-L167
core/packages/bridge-controller/src/utils/bridge.ts
Lines 162 to 167 in 30608f3
!address || | |
(!isStrictHexString(address) && | |
Object.values(SYMBOL_TO_SLIP44_MAP).some( | |
// check if it matches any supported SLIP44 references | |
(reference) => address.includes(reference) || reference.endsWith(address), | |
)); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Explanation
This change updates the isNativeAddress
util so that it returns
true` when the address is a native EVM assetIdReferences
Related to https://consensyssoftware.atlassian.net/browse/SWAPS-2601
Changelog
Checklist