update unsupported and broken lists (#2100)

This commit is contained in:
Ian Lapham 2021-07-23 18:05:14 -04:00 committed by GitHub
parent e07599ef0f
commit 4078390a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1079 additions and 43 deletions

@ -11,7 +11,6 @@ const KLEROS_LIST = 't2crtokens.eth'
export const OPTIMISM_LIST = 'https://static.optimism.io/optimism.tokenlist.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 UMA_LIST = 'https://umaproject.org/uma.tokenlist.json'
const WRAPPED_LIST = 'wrapped.tokensoft.eth'
// only load blocked list if on app url
@ -23,7 +22,6 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [
AAVE_LIST,
CMC_ALL_LIST,
CMC_STABLECOIN,
UMA_LIST,
WRAPPED_LIST,
SET_LIST,
ROLL_LIST,

@ -0,0 +1,22 @@
{
"name": "Broken Token List",
"timestamp": "2021-01-05T20:47:02.923Z",
"version": {
"major": 1,
"minor": 0,
"patch": 0
},
"tags": {},
"logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir",
"keywords": ["uniswap", "broken"],
"tokens": [
{
"name": "UNI HODL",
"address": "0x4bf5dc91E2555449293D7824028Eb8Fe5879B689",
"symbol": "UniH",
"decimals": 18,
"chainId": 1,
"logoURI": ""
}
]
}

@ -1,38 +0,0 @@
{
"name": "Unsupported Tokens",
"timestamp": "2021-01-05T20:47:02.923Z",
"version": {
"major": 1,
"minor": 0,
"patch": 0
},
"tags": {},
"logoURI": "ipfs://QmNa8mQkrNKp1WEEeGjFezDmDeodkWRevGFN8JCV7b4Xir",
"keywords": ["uniswap", "unsupported"],
"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",
"address": "0x4bf5dc91E2555449293D7824028Eb8Fe5879B689",
"symbol": "UniH",
"decimals": 18,
"chainId": 1,
"logoURI": ""
}
]
}

File diff suppressed because it is too large Load Diff

@ -4,7 +4,8 @@ import { IS_ON_APP_URL } from 'constants/misc'
import { useMemo } from 'react'
import { useAppSelector } from 'state/hooks'
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 { UNSUPPORTED_LIST_URLS } from './../../constants/lists'
import { WrappedTokenInfo } from './wrappedTokenInfo'
@ -119,13 +120,16 @@ export function useUnsupportedTokenList(): TokenAddressMap {
// get hard coded unsupported tokens, only block on app url
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
const loadedUnsupportedListMap = useCombinedTokenMapFromUrls(UNSUPPORTED_LIST_URLS)
// format into one token address map
return useMemo(
() => combineMaps(localUnsupportedListMap, loadedUnsupportedListMap),
[localUnsupportedListMap, loadedUnsupportedListMap]
() => combineMaps(brokenListMap, combineMaps(localUnsupportedListMap, loadedUnsupportedListMap)),
[localUnsupportedListMap, loadedUnsupportedListMap, brokenListMap]
)
}