Skip to content

Commit 1471664

Browse files
authored
fix: Support Zora USDzC in enableL1TokenAcrossEcosystem (#573)
1 parent 502fdc4 commit 1471664

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tasks/enableL1TokenAcrossEcosystem.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,16 @@ task("enable-l1-token-across-ecosystem", "Enable a provided token across the ent
6868
chainIds.map((chainId) => {
6969
// Handle USDC special case where L1 USDC is mapped to different token symbols on L2s.
7070
if (matchedSymbol === "USDC") {
71-
const nativeUsdcAddress = TOKEN_SYMBOLS_MAP.USDC.addresses[chainId];
72-
const bridgedUsdcAddress = TOKEN_SYMBOLS_MAP["USDC.e"].addresses[chainId];
73-
if (nativeUsdcAddress) {
74-
return nativeUsdcAddress;
75-
} else if (bridgedUsdcAddress) {
76-
return bridgedUsdcAddress;
77-
} else {
71+
const symbols = ["USDC", "USDC.e", "USDbC", "USDzC"] as (keyof typeof TOKEN_SYMBOLS_MAP)[];
72+
const symbol = symbols.find((symbol) => TOKEN_SYMBOLS_MAP[symbol].addresses[chainId]);
73+
if (!symbol) {
7874
throw new Error(
79-
`Could not find token address on chain ${chainId} in TOKEN_SYMBOLS_MAP for USDC.e or Native USDC`
75+
`Could not find TOKEN_SYMBOLS_MAP mapping on chain ${chainId} for any of ${symbols.join(", ")}`
8076
);
8177
}
78+
return TOKEN_SYMBOLS_MAP[symbol].addresses[chainId];
8279
} else if (matchedSymbol === "DAI" && chainId === CHAIN_IDs.BLAST) {
83-
return TOKEN_SYMBOLS_MAP.USDB.addresses[chainId]; // DAI maps to USDB on Blast.
80+
return TOKEN_SYMBOLS_MAP.USDB.addresses[chainId]; // DAI maps to USDB on Blast.
8481
}
8582

8683
const l2Address = TOKEN_SYMBOLS_MAP[matchedSymbol].addresses[chainId];

0 commit comments

Comments
 (0)