Skip to content

Commit

Permalink
temp eth address fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex committed Mar 29, 2024
1 parent 82cad43 commit 0c19d17
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/PositionListItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ export default function PositionListItem({
tick_lower: tickLower,
tick_upper: tickUpper,
}: PositionListItemProps) {
const { formatDelta, formatTickPrice } = useFormatter()

const { formatTickPrice } = useFormatter()
const token0 = useToken(token0Address)
const token1 = useToken(token1Address)

Expand Down
1 change: 1 addition & 0 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const isBsc = false
export const isPolygon = false
export const isCelo = false
export const MAX_UINT128 = BigInt(2) ** BigInt(128) - BigInt(1)
export const ETH_ADDRESS = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'

export const NATIVE_CHAIN_ID = 'NATIVE'
export const ZERO_ADDRESS_STARKNET = '0x0000000000000000000000000000000000000000000000000000000000000000'
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/Tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { deserializeToken, useUserAddedTokens } from '../state/user/hooks'
import { isAddressValidForStarknet } from 'utils/addresses'
import { useTokenContract } from './useContractV2'
import { NEVER_RELOAD, useSingleCallResult } from 'state/multicall/hooks'
import { ETH_ADDRESS, WETH } from 'constants/tokens'

type Maybe<T> = T | null | undefined

Expand Down Expand Up @@ -203,6 +204,7 @@ export function useToken(tokenAddress?: string | null): Token | null | undefined
return useMemo(() => {
if (token) return token
if (!chainId || !address) return undefined
if (address === ETH_ADDRESS) return WETH[chainId]
if (decimals.loading || symbol.loading || tokenName.loading) return null
if (decimals.result) {
const token = new Token(
Expand Down
4 changes: 0 additions & 4 deletions src/utils/unwrappedToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ import { Currency } from '@vnaysn/jediswap-sdk-core'
// import { nativeOnChain, WRAPPED_NATIVE_CURRENCY } from '../constants/tokens'

export function unwrappedToken(currency: Currency): Currency {
if (currency.isNative) return currency
// const formattedChainId = asSupportedChain(currency.chainId)
// if (formattedChainId && WRAPPED_NATIVE_CURRENCY[formattedChainId]?.equals(currency))
// return nativeOnChain(currency.chainId)
return currency
}

0 comments on commit 0c19d17

Please sign in to comment.