Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display USDC instead of fUSDC on mainnet #218

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading