Skip to content

Commit ebb35d0

Browse files
committed
Workaround for USDT-BNB mapping issue
1 parent 6706a60 commit ebb35d0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"node": ">=20.18.0"
1111
},
1212
"dependencies": {
13-
"@across-protocol/constants": "^3.1.58",
13+
"@across-protocol/constants": "^3.1.59",
1414
"@across-protocol/contracts": "^4.0.5",
1515
"@across-protocol/sdk": "4.1.49",
1616
"@arbitrum/sdk": "^4.0.2",

src/utils/AddressUtils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,20 @@ export function getTranslatedTokenAddress(
8686
if (hubChainId === l2ChainId) {
8787
return l1Token;
8888
}
89+
const onBNB = l2ChainId === CHAIN_IDs.BNB;
8990
if (compareAddressesSimple(l1Token, TOKEN_SYMBOLS_MAP.USDC.addresses[hubChainId])) {
9091
const onBase = l2ChainId === CHAIN_IDs.BASE || l2ChainId === CHAIN_IDs.BASE_SEPOLIA;
9192
const onZora = l2ChainId === CHAIN_IDs.ZORA;
9293
return isNativeUsdc
9394
? TOKEN_SYMBOLS_MAP.USDC.addresses[l2ChainId]
94-
: TOKEN_SYMBOLS_MAP[onBase ? "USDbC" : onZora ? "USDzC" : "USDC.e"].addresses[l2ChainId];
95+
: TOKEN_SYMBOLS_MAP[onBase ? "USDbC" : onZora ? "USDzC" : onBNB ? "USDC-BNB" : "USDC.e"].addresses[l2ChainId];
9596
} else if (
9697
l2ChainId === CHAIN_IDs.BLAST &&
9798
compareAddressesSimple(l1Token, TOKEN_SYMBOLS_MAP.DAI.addresses[hubChainId])
9899
) {
99100
return TOKEN_SYMBOLS_MAP.USDB.addresses[l2ChainId];
101+
} else if (onBNB && compareAddressesSimple(l1Token, TOKEN_SYMBOLS_MAP.USDT.addresses[hubChainId])) {
102+
return TOKEN_SYMBOLS_MAP["USDT-BNB"].addresses[l2ChainId];
100103
}
101104

102105
return getTokenAddress(l1Token, hubChainId, l2ChainId);

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.57.tgz#7f6d3b00e52e142b04d8a1a72be81bdff631646d"
2222
integrity sha512-drkdEYdURc4IcUr0KzcehLhmYU20H3WkHfukodcjvcLogDGHFd8p5Uwajd2kMGDu1GwgM5wehGt7KIEqYLw4eg==
2323

24-
"@across-protocol/constants@^3.1.58":
25-
version "3.1.58"
26-
resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.58.tgz#0861e654997d25831b613b5f062a57232d89a2de"
27-
integrity sha512-ngtMS0h40EoRKSA7lcKvhbJPKwmuHpfjBKZ4OWRUiCrdHOMEHQ5d9EX6Q8DhDP2njIUSprc4Jn/85CgdkEc2KQ==
24+
"@across-protocol/constants@^3.1.59":
25+
version "3.1.59"
26+
resolved "https://registry.yarnpkg.com/@across-protocol/constants/-/constants-3.1.59.tgz#48d18955b5016b8b3fb2128ccdb1e8c98911dffb"
27+
integrity sha512-R5cju53IMSLJ4qQBGmhYnPZ96lxuIDK/bAgQG3A7wSjNtbj6h2fcP+MaTkrH2P5Ew9h4oMPhfJzvCCjA/u4yrg==
2828

2929
"@across-protocol/contracts@^0.1.4":
3030
version "0.1.4"

0 commit comments

Comments
 (0)