Skip to content

Commit

Permalink
Remove Native Token (eth)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrugu committed Jan 22, 2024
1 parent 7da5054 commit 974b66f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ VITE_RPC_URI=https://opt-mainnet.g.alchemy.com/v2/eMfpHDDDWuKK99KxTaEiyaCqYDstRv
VITE_WALLETCONNECT_PROJECT_ID=
# Tokens CDN host to load the logos based on the token address
VITE_TOKEN_ADDRESSES=0x4200000000000000000000000000000000000042,0x7f5c764cbc14f9669b88837ca1490cca17c31607,0x94b008aa00579c1307b0ef2c499ad98a8ce58e58
VITE_NATIVE_TOKEN_LOGO=/tokens/ETH.svg
VITE_WRAPPED_NATIVE_TOKEN=0x4200000000000000000000000000000000000006
VITE_TOKEN_ASSETS_CDN=https://assets.smold.app/api/token
# Feature flags, use comma-delimited tags to activate feature flags...
# Available flags: disable-fees,marketplace,migration,no-batch-rpc-calls
Expand Down
13 changes: 0 additions & 13 deletions public/tokens/ETH.svg

This file was deleted.

12 changes: 1 addition & 11 deletions src/components/TokenAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Img } from "react-image";

import {
DEFAULT_CHAIN,
NATIVE_TOKEN,
NATIVE_TOKEN_LOGO,
TOKEN_ASSETS_CDN,
TOKEN_ICON,
} from "../constants";
import { DEFAULT_CHAIN, TOKEN_ASSETS_CDN, TOKEN_ICON } from "../constants";
import { Address } from "../hooks/types";

export default function TokenAvatar({
Expand All @@ -27,10 +21,6 @@ export default function TokenAvatar({
? `${className} rounded-full bg-gray-200 dark:bg-gray-700 hover:opacity-80`
: `w-8 h-8 rounded-full bg-gray-200 dark:bg-gray-700 hover:opacity-80`;

if (lowcase == NATIVE_TOKEN.address) {
return <Img className={classNames} src={NATIVE_TOKEN_LOGO} />;
}

// Builds a list of potential CDN logo URIs
const logoURIs = TOKEN_ASSETS_CDN.map((cdnUri) => [
`${cdnUri}/${DEFAULT_CHAIN.id}/${checksum}/logo.svg`,
Expand Down
13 changes: 0 additions & 13 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ export const TOKEN_ASSETS_CDN = String(
import.meta.env.VITE_TOKEN_ASSETS_CDN,
).split(",");
export const DEFAULT_CHAIN = optimism;
export const NATIVE_TOKEN_LOGO = import.meta.env.VITE_NATIVE_TOKEN_LOGO;
export const NATIVE_TOKEN = {
...DEFAULT_CHAIN.nativeCurrency,
wrappedAddress:
import.meta.env.VITE_WRAPPED_NATIVE_TOKEN.toLowerCase() as Address,
/**
* TODO: This is an exception for the native token where "address" is "ETH"
* - Change this later so it's type-safe
* Discussion: https://github.com/velodrome-finance/app/pull/347#discussion_r1380073009
*/

address: DEFAULT_CHAIN.nativeCurrency.symbol.toLowerCase() as Address,
};

export const WALLETCONNECT_PROJECT_ID = import.meta.env
.VITE_WALLETCONNECT_PROJECT_ID;
Expand Down

0 comments on commit 974b66f

Please sign in to comment.