Support 18-decimal stablecoins on BNB Chain - #2154
Merged
Merged
Conversation
Add USDT to the Base and BNB Chain bridge token lists so it appears in the Add Funds and Deposit to Savings token selectors (which render from BRIDGE_TOKENS), matching the backend bridge-deposit support: - Base: Tether USD 0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2 (6 dp) - BNB Chain: Binance-Peg BSC-USD 0x55d398326f99059fF775485246999027B3197955 (18 dp) Derive token decimals from the bridge config in the Add Funds wallet-transfer flow (form + useTransferToWallet) instead of hardcoding stablecoins to 6 dp, so the 18-decimal BNB Chain stablecoins (USDC/USDT) transfer and display correctly. https://claude.ai/code/session_012jF7BVuvcndnadBoePaAWG
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for USDT on Base and BNB Chain, and updates the decimal handling logic to dynamically read decimals from the bridge token configuration instead of assuming all stablecoins use 6 decimals.
Key Changes
BRIDGE_TOKENSconstantuseTransferToWallet.tsandAddFundsToWalletForm.tsxAddFundsToWalletForm.tsxto include decimals from token dataImplementation Details
The key insight is that stablecoins don't always use 6 decimals—Binance-Peg versions on BNB Chain use 18 decimals. Rather than hardcoding decimal assumptions, the code now:
BRIDGE_TOKENSbased on the source chain and token nameThis ensures amount parsing, formatting, and validation work correctly across different token implementations.
https://claude.ai/code/session_012jF7BVuvcndnadBoePaAWG