Commit 4078390a authored by Ian Lapham's avatar Ian Lapham Committed by GitHub

update unsupported and broken lists (#2100)

parent e07599ef
...@@ -11,7 +11,6 @@ const KLEROS_LIST = 't2crtokens.eth' ...@@ -11,7 +11,6 @@ const KLEROS_LIST = 't2crtokens.eth'
export const OPTIMISM_LIST = 'https://static.optimism.io/optimism.tokenlist.json' export const OPTIMISM_LIST = 'https://static.optimism.io/optimism.tokenlist.json'
const ROLL_LIST = 'https://app.tryroll.com/tokens.json' const ROLL_LIST = 'https://app.tryroll.com/tokens.json'
const SET_LIST = 'https://raw.githubusercontent.com/SetProtocol/uniswap-tokenlist/main/set.tokenlist.json' const SET_LIST = 'https://raw.githubusercontent.com/SetProtocol/uniswap-tokenlist/main/set.tokenlist.json'
const UMA_LIST = 'https://umaproject.org/uma.tokenlist.json'
const WRAPPED_LIST = 'wrapped.tokensoft.eth' const WRAPPED_LIST = 'wrapped.tokensoft.eth'
// only load blocked list if on app url // only load blocked list if on app url
...@@ -23,7 +22,6 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [ ...@@ -23,7 +22,6 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [
AAVE_LIST, AAVE_LIST,
CMC_ALL_LIST, CMC_ALL_LIST,
CMC_STABLECOIN, CMC_STABLECOIN,
UMA_LIST,
WRAPPED_LIST, WRAPPED_LIST,
SET_LIST, SET_LIST,
ROLL_LIST, ROLL_LIST,
......
{ {
"name": "Unsupported Tokens", "name": "Broken Token List",
"timestamp": "2021-01-05T20:47:02.923Z", "timestamp": "2021-01-05T20:47:02.923Z",
"version": { "version": {
"major": 1, "major": 1,
...@@ -8,24 +8,8 @@ ...@@ -8,24 +8,8 @@
}, },
"tags": {}, "tags": {},
"logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir", "logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir",
"keywords": ["uniswap", "unsupported"], "keywords": ["uniswap", "broken"],
"tokens": [ "tokens": [
{
"name": "Gold Tether",
"address": "0x4922a015c4407F87432B179bb209e125432E4a2A",
"symbol": "XAUt",
"decimals": 6,
"chainId": 1,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4922a015c4407F87432B179bb209e125432E4a2A/logo.png"
},
{
"name": "Grump Cat",
"address": "0x93B2FfF814FCaEFFB01406e80B4Ecd89Ca6A021b",
"symbol": "GRUMPY",
"decimals": 9,
"chainId": 1,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4922a015c4407F87432B179bb209e125432E4a2A/logo.png"
},
{ {
"name": "UNI HODL", "name": "UNI HODL",
"address": "0x4bf5dc91E2555449293D7824028Eb8Fe5879B689", "address": "0x4bf5dc91E2555449293D7824028Eb8Fe5879B689",
......
This diff is collapsed.
...@@ -4,7 +4,8 @@ import { IS_ON_APP_URL } from 'constants/misc' ...@@ -4,7 +4,8 @@ import { IS_ON_APP_URL } from 'constants/misc'
import { useMemo } from 'react' import { useMemo } from 'react'
import { useAppSelector } from 'state/hooks' import { useAppSelector } from 'state/hooks'
import sortByListPriority from 'utils/listSort' import sortByListPriority from 'utils/listSort'
import UNSUPPORTED_TOKEN_LIST from '../../constants/tokenLists/uniswap-v2-unsupported.tokenlist.json' import UNSUPPORTED_TOKEN_LIST from '../../constants/tokenLists/unsupported.tokenlist.json'
import BROKEN_LIST from '../../constants/tokenLists/broken.tokenlist.json'
import { AppState } from '../index' import { AppState } from '../index'
import { UNSUPPORTED_LIST_URLS } from './../../constants/lists' import { UNSUPPORTED_LIST_URLS } from './../../constants/lists'
import { WrappedTokenInfo } from './wrappedTokenInfo' import { WrappedTokenInfo } from './wrappedTokenInfo'
...@@ -119,13 +120,16 @@ export function useUnsupportedTokenList(): TokenAddressMap { ...@@ -119,13 +120,16 @@ export function useUnsupportedTokenList(): TokenAddressMap {
// get hard coded unsupported tokens, only block on app url // get hard coded unsupported tokens, only block on app url
const localUnsupportedListMap = useMemo(() => (IS_ON_APP_URL ? listToTokenMap(UNSUPPORTED_TOKEN_LIST) : {}), []) const localUnsupportedListMap = useMemo(() => (IS_ON_APP_URL ? listToTokenMap(UNSUPPORTED_TOKEN_LIST) : {}), [])
// broken tokens, blocked on all URLS
const brokenListMap = useMemo(() => listToTokenMap(BROKEN_LIST), [])
// get any loaded unsupported tokens, this will be empty if not on app URL // get any loaded unsupported tokens, this will be empty if not on app URL
const loadedUnsupportedListMap = useCombinedTokenMapFromUrls(UNSUPPORTED_LIST_URLS) const loadedUnsupportedListMap = useCombinedTokenMapFromUrls(UNSUPPORTED_LIST_URLS)
// format into one token address map // format into one token address map
return useMemo( return useMemo(
() => combineMaps(localUnsupportedListMap, loadedUnsupportedListMap), () => combineMaps(brokenListMap, combineMaps(localUnsupportedListMap, loadedUnsupportedListMap)),
[localUnsupportedListMap, loadedUnsupportedListMap] [localUnsupportedListMap, loadedUnsupportedListMap, brokenListMap]
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment