feat: add wbtc.eth, usdt.sol, usdt.arb on chainflip, fix usdc.arb and eth.arb (#3050)
What changed, and why it matters
This commit adds support for new cryptocurrencies (wrapped Bitcoin on Ethereum, Tether on Solana and Arbitrum) and fixes mapping labels for USD Coin and Ethereum on Arbitrum within the Chainflip exchange integration. It is a routine feature/configuration update with no apparent security relevance.
No security action required; review as normal feature code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates two Dart files: (1) cw_core/lib/crypto_currency.dart adds USDC and USDT on Arbitrum to the exchangeCurrencies list, defines new CryptoCurrency constants (usdcArb, usdtArb), and renumbers the raw ID for ltcmweb to avoid a collision with the previous 107 value now used by zec/usdtArb; (2) lib/exchange/provider/chainflip_exchange_provider.dart adds WBTC, USDT-SOL, USDT-ARB to the supported currency list, adds an ‘ARBITRUM’ network-name mapping, and adds parser cases for wbtc.eth, eth.arb, usdc.arb, and usdt.arb. No cryptographic, authentication, or input-validation logic is changed.
Changed components
cw_core/lib/crypto_currency.dartlib/exchange/provider/chainflip_exchange_provider.dartInspect captured patch +12 / −3
diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart
index 03e48eeb..879534d7 100644
--- a/cw_core/lib/crypto_currency.dart
+++ b/cw_core/lib/crypto_currency.dart
@@ -124,6 +124,8 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
CryptoCurrency.baseEth,
CryptoCurrency.usde,
CryptoCurrency.arbEth,
+ CryptoCurrency.usdcArb,
+ CryptoCurrency.usdtArb,
];
static const havenCurrencies = [
@@ -259,8 +261,8 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
static const arbEth = CryptoCurrency(title: 'ETH', tag: 'ARB', fullName: 'Ethereum', raw: 106, name: 'arbeth', iconPath: 'assets/images/crypto/ethereum.webp', decimals: 18, flatIconPath: "assets/new-ui/balance_card_icons/arbitrum.svg");
static const zec = CryptoCurrency(title: 'ZEC', fullName: 'Zcash', raw: 107, name: 'zec', iconPath: 'assets/images/zec_icon.png', decimals: 8,flatIconPath: "assets/new-ui/balance_card_icons/zcash.svg");
static const usdcArb = CryptoCurrency(title: 'USDC', tag: 'ARB', fullName: 'USDC Coin', raw: 108, name: 'usdcarb', iconPath: 'assets/images/crypto/usdc.webp', decimals: 6);
- static const ltcmweb = CryptoCurrency(title: 'LTC', fullName: 'Litecoin MWeb', raw: 107, name: 'ltcmweb', iconPath: 'assets/images/crypto/litecoin.webp', decimals: 8);
-
+ static const usdtArb = CryptoCurrency(title: 'USDT', tag: 'ARB', fullName: 'USDT Tether', raw: 109, name: 'usdtarb', iconPath: 'assets/images/crypto/tether.webp', decimals: 6);
+ static const ltcmweb = CryptoCurrency(title: 'LTC', fullName: 'Litecoin MWeb', raw: 110, name: 'ltcmweb', iconPath: 'assets/images/crypto/litecoin.webp', decimals: 8);
static final Map<int, CryptoCurrency> _rawCurrencyMap =
[...all, ...havenCurrencies, ...zcashCurrencies].fold<Map<int, CryptoCurrency>>(<int, CryptoCurrency>{}, (acc, item) {
diff --git a/lib/exchange/provider/chainflip_exchange_provider.dart b/lib/exchange/provider/chainflip_exchange_provider.dart
index 2fa44a4c..787070be 100644
--- a/lib/exchange/provider/chainflip_exchange_provider.dart
+++ b/lib/exchange/provider/chainflip_exchange_provider.dart
@@ -24,11 +24,13 @@ class ChainflipExchangeProvider extends ExchangeProvider {
CryptoCurrency.usdc,
CryptoCurrency.usdterc20,
CryptoCurrency.flip,
+ CryptoCurrency.wbtc,
CryptoCurrency.sol,
CryptoCurrency.usdcsol,
+ CryptoCurrency.usdtSol,
CryptoCurrency.arbEth,
CryptoCurrency.usdcArb,
- // TODO: Add CryptoCurrency.dot
+ CryptoCurrency.usdtArb,
];
static const _baseURL = 'chainflip-broker.io';
@@ -338,6 +340,7 @@ class ChainflipExchangeProvider extends ExchangeProvider {
final networkName = switch (name) {
'BITCOIN' => 'Bitcoin',
'ETHEREUM' => 'Ethereum',
+ 'ARBITRUM' => 'Arbitrum',
'SOLANA' => 'Solana',
_ => name
};
@@ -353,8 +356,12 @@ class ChainflipExchangeProvider extends ExchangeProvider {
'usdc.eth' => CryptoCurrency.usdc,
'usdt.eth' => CryptoCurrency.usdterc20,
'flip.eth' => CryptoCurrency.flip,
+ 'wbtc.eth' => CryptoCurrency.wbtc,
'sol.sol' => CryptoCurrency.sol,
'usdc.sol' => CryptoCurrency.usdcsol,
+ 'eth.arb' => CryptoCurrency.arbEth,
+ 'usdc.arb' => CryptoCurrency.usdcArb,
+ 'usdt.arb' => CryptoCurrency.usdtArb,
_ => null
};
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.