Skip to content

Commit

Permalink
feat: display USDC instead of fUSDC on mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] and af-afk committed Dec 13, 2024
1 parent 897ec5f commit 4090145
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions web/src/config/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ import { useSwapStore } from "@/stores/useSwapStore";
import { EmptyToken } from "@/lib/utils";
import { useStakeStore } from "@/stores/useStakeStore";
import { useChainId } from "wagmi";
import { allChains, useChain } from "./chains";
import { allChains, superpositionMainnet, useChain } from "./chains";

export type ChainIdTypes = (typeof allChains)[number]["id"];

function getDisplaySymbol(symbol: string, chainId: number): string {
if (chainId === superpositionMainnet.id && symbol.toLowerCase() === "fusdc") {
return "USDC";
}
return symbol;
}

export type Token = {
address: `0x${string}`;
symbol: string;
Expand Down Expand Up @@ -92,6 +99,7 @@ export function useTokens(token?: "default" | string) {
...t.token,
address: t.token.address as `0x${string}`,
icon: t.token.image,
symbol: getDisplaySymbol(t.token.symbol, chainId),
...(isGasToken(t.token.symbol)
? {
abi: WETH10,
Expand All @@ -105,7 +113,7 @@ export function useTokens(token?: "default" | string) {
}),
{} as { [symbol: string]: Token },
);
}, [tokensData, fusdcData_, isGasToken]);
}, [tokensData, fusdcData_, isGasToken, chainId]);
const isTokens = fusdcData_ && tokensData;

const DefaultToken = isTokens
Expand Down

0 comments on commit 4090145

Please sign in to comment.