-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: MUSD-106: Support linea -> linea conversions #23704
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
base: main
Are you sure you want to change the base?
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…sion entry point. cleanup next.
0d0fa33 to
816f05d
Compare
| }); | ||
| return; | ||
| if (!paymentTokenChainId) { | ||
| throw new Error('[mUSD Conversion] payment token chainID missing'); |
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: Unhandled throw outside try-catch in handlePress
The throw new Error('[mUSD Conversion] payment token chainID missing') statement at line 66 is outside the try-catch block that starts at line 71. While this defensive check protects against missing paymentTokenChainId, if the condition ever triggers (e.g., due to race conditions or bugs in canConvert logic), the error will be unhandled and could crash the app. Compare with MusdConversionAssetOverviewCta/index.tsx where the similar check is properly wrapped inside the try-catch block starting at line 32.
| if (!asset.chainId) return null; | ||
|
|
||
| if (isLendingToken || isReceiptToken) { | ||
| if (isLendingToken || isReceiptToken || isConvertibleStablecoin) { |
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: mUSD CTA blocked when stablecoin lending disabled
The new condition || isConvertibleStablecoin routes convertible stablecoins to EarnLendingBalance, but that component has an early return if (!isStablecoinLendingEnabled) return null; on line 179. This means if isMusdConversionFlowEnabled is true but selectStablecoinLendingEnabledFlag is false (these are independent feature flags), convertible stablecoins will be routed to EarnLendingBalance which immediately returns null, preventing the mUSD conversion CTA from ever rendering.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes are focused exclusively on the Earn/Stake functionality, specifically around mUSD (Meta USD) conversion flows:
The changes are contained within the staking domain and include proper unit test updates, making SmokeStake the appropriate tag to validate these changes. |
|


Description
Removed hardcoded mainnet target when converting mUSD.
Changes
hasSeenEducationalScreenlogic and centralized intoinitiateConversion. This way callers don't need to worry about handling educational screen redirectsChangelog
CHANGELOG entry: removed hardcoded mainnet output chainId for mUSD conversion flow
Related issues
Fixes: MUSD-106: Support Linea to Linea conversions
Manual testing steps
Screenshots/Recordings
Before
mUSD conversion flow was hardcoded to convert to mainnet mUSD.
After
Linea -> Linea swap demo - link
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Initiates mUSD conversion on the payment token’s chain when supported (fallback to mainnet) and centralizes education-screen handling; updates CTA/Stake flows and related tests.
outputChainIdviauseMusdConversionTokens.getMusdOutputChainId, enabling same-network conversions with fallback tomainnet.useMusdConversionwithskipEducationChecksupport; callers no longer handle navigation.nestedTransactionsfromaddTransactionoptions.useMusdConversionTokens: addgetMusdOutputChainId, adjustisMusdSupportedOnChainto accept optional chainId and hex-normalize.useMusdConversion: add education redirect helper, allowskipEducationCheck, simplify transaction options.MusdConversionAssetListCta: remove local education routing; use checksum address; computeoutputChainIdper token’s chain.MusdConversionAssetOverviewCta: computeoutputChainIddynamically; callinitiateConversiondirectly.StakeButton: simplify mUSD convert path; computeoutputChainIdvia hook.EarnBalance: treat convertible stablecoins as lending balance when flag enabled.skipEducationCheck, checksummed addresses, dynamicoutputChainId).Written by Cursor Bugbot for commit ea1edb9. This will update automatically on new commits. Configure here.