Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit 55c856a

Browse files
authored
Merge pull request #267 from brave/update-token-lists
chore: update tokenlists and prevent blacklisted tokens
2 parents 7275e0b + 4f104f4 commit 55c856a

File tree

4 files changed

+211
-88
lines changed

4 files changed

+211
-88
lines changed

package.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@
8181
"netmask": "^2.0.1",
8282
"ganache-core/lodash": "^4.17.21",
8383
"underscore": "^1.12.1",
84-
"url-parse": "^1.5.0",
84+
"url-parse": "^1.5.2",
8585
"ssri": "^6.0.2",
86-
"hosted-git-info": "^3.0.8"
86+
"hosted-git-info": "^3.0.8",
87+
"**/swarm-js/tar": "^4.4.15",
88+
"**/node-pre-gyp/tar": "^4.4.15",
89+
"geckodriver/tar": "^6.1.2",
90+
"**/node-sass/node-gyp/tar": "^4.4.3",
91+
"**/path-parse": "^1.0.7",
92+
"**/jszip": "^3.7.0"
8793
},
8894
"dependencies": {
8995
"@babel/runtime": "^7.5.5",
@@ -93,7 +99,7 @@
9399
"@formatjs/intl-relativetimeformat": "^5.2.6",
94100
"@fortawesome/fontawesome-free": "^5.13.0",
95101
"@material-ui/core": "^4.11.0",
96-
"@metamask/contract-metadata": "^1.25.0",
102+
"@metamask/contract-metadata": "1.26.0",
97103
"@metamask/controllers": "^2.0.5",
98104
"@metamask/eth-ledger-bridge-keyring": "github:brave/eth-ledger-bridge-keyring#6db82c15435f9ae47dadbc1fc19586552a7044eb",
99105
"@metamask/etherscan-link": "^1.1.0",

ui/app/pages/swap/assets/assets.mainnet.json

+130-16
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@
8383
"name": "2key network",
8484
"decimals": 18
8585
},
86+
{
87+
"address": "0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B",
88+
"symbol": "AAAVE",
89+
"name": "Aave AAVE",
90+
"decimals": 18
91+
},
8692
{
8793
"address": "0x05Ec93c0365baAeAbF7AefFb0972ea7ECdD39CF1",
8894
"symbol": "ABAT",
@@ -185,6 +191,12 @@
185191
"name": "Aave REN",
186192
"decimals": 18
187193
},
194+
{
195+
"address": "0x358AA737e033F34df7c54306960a38d09AaBd523",
196+
"symbol": "ARES",
197+
"name": "Ares Protocol",
198+
"decimals": 18
199+
},
188200
{
189201
"address": "0xfec0cF7fE078a500abf15F1284958F22049c2C7e",
190202
"symbol": "ART",
@@ -227,6 +239,18 @@
227239
"name": "Auctus",
228240
"decimals": 18
229241
},
242+
{
243+
"address": "0x18aAA7115705e8be94bfFEBDE57Af9BFc265B998",
244+
"symbol": "AUDIO",
245+
"name": "Audius",
246+
"decimals": 18
247+
},
248+
{
249+
"address": "0xB9D7CB55f463405CDfBe4E90a6D2Df01C2B92BF1",
250+
"symbol": "AUNI",
251+
"name": "Aave UNI",
252+
"decimals": 18
253+
},
230254
{
231255
"address": "0xBcca60bB61934080951369a648Fb03DF4F96263C",
232256
"symbol": "AUSDC",
@@ -251,12 +275,24 @@
251275
"name": "Aave WBTC",
252276
"decimals": 18
253277
},
278+
{
279+
"address": "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e",
280+
"symbol": "AWETH",
281+
"name": "Aave WETH",
282+
"decimals": 18
283+
},
254284
{
255285
"address": "0x71F85B2E46976bD21302B64329868fd15eb0D127",
256286
"symbol": "AXN",
257287
"name": "Axion",
258288
"decimals": 18
259289
},
290+
{
291+
"address": "0x5165d24277cD063F5ac44Efd447B27025e888f37",
292+
"symbol": "AYFI",
293+
"name": "Aave YFI",
294+
"decimals": 18
295+
},
260296
{
261297
"address": "0xDf7FF54aAcAcbFf42dfe29DD6144A69b629f8C9e",
262298
"symbol": "AZRX",
@@ -413,6 +449,12 @@
413449
"name": "SwissBorg",
414450
"decimals": 8
415451
},
452+
{
453+
"address": "0x75739d5944534115d7C54ee8C73F186D793BAE02",
454+
"symbol": "CO2",
455+
"name": "Collective",
456+
"decimals": 18
457+
},
416458
{
417459
"address": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
418460
"symbol": "COMP",
@@ -635,6 +677,12 @@
635677
"name": "Hut34 Entropy",
636678
"decimals": 18
637679
},
680+
{
681+
"address": "0x1Da87b114f35E1DC91F72bF57fc07A768Ad40Bb0",
682+
"symbol": "EQZ",
683+
"name": "Equalizer",
684+
"decimals": 18
685+
},
638686
{
639687
"address": "0xb1CD6e4153B2a390Cf00A6556b0fC1458C4A5533",
640688
"symbol": "ETHBNT",
@@ -695,6 +743,12 @@
695743
"name": "FUNToken",
696744
"decimals": 8
697745
},
746+
{
747+
"address": "0x970B9bB2C0444F5E81e9d0eFb84C8ccdcdcAf84d",
748+
"symbol": "FUSE",
749+
"name": "Fuse",
750+
"decimals": 18
751+
},
698752
{
699753
"address": "0x35bD01FC9d6D5D81CA9E055Db88Dc49aa2c699A8",
700754
"symbol": "FWB",
@@ -815,12 +869,24 @@
815869
"name": "Indorse",
816870
"decimals": 18
817871
},
872+
{
873+
"address": "0x544c42fBB96B39B21DF61cf322b5EDC285EE7429",
874+
"symbol": "INSUR",
875+
"name": "InsurAce",
876+
"decimals": 18
877+
},
818878
{
819879
"address": "0x0DB8D8b76BC361bAcbB72E2C491E06085A97Ab31",
820880
"symbol": "IQN",
821881
"name": "IQeon",
822882
"decimals": 18
823883
},
884+
{
885+
"address": "0x7420B4b9a0110cdC71fB720908340C03F9Bc03EC",
886+
"symbol": "JASMY",
887+
"name": "JasmyCoin",
888+
"decimals": 18
889+
},
824890
{
825891
"address": "0x8727c112C712c4a03371AC87a74dD6aB104Af768",
826892
"symbol": "JET",
@@ -833,6 +899,12 @@
833899
"name": "JOYSO",
834900
"decimals": 6
835901
},
902+
{
903+
"address": "0x6E765D26388A17A6e86c49A8E41DF3F58aBcd337",
904+
"symbol": "KANGAL",
905+
"name": "Kangal",
906+
"decimals": 18
907+
},
836908
{
837909
"address": "0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC",
838910
"symbol": "KEEP",
@@ -935,6 +1007,12 @@
9351007
"name": "MahaDAO",
9361008
"decimals": 18
9371009
},
1010+
{
1011+
"address": "0x75387e1287Dd85482aB66102DA9f6577E027f609",
1012+
"symbol": "MAI",
1013+
"name": "Mindsync",
1014+
"decimals": 18
1015+
},
9381016
{
9391017
"address": "0x0cae9e4d663793c2a2A0b211c1Cf4bBca2B9cAa7",
9401018
"symbol": "MAMZN",
@@ -953,12 +1031,6 @@
9531031
"name": "Midas Protocol",
9541032
"decimals": 18
9551033
},
956-
{
957-
"address": "0x1C9491865a1DE77C5b6e19d2E6a5F1D7a6F2b25F",
958-
"symbol": "MATTER",
959-
"name": "AntiMatter",
960-
"decimals": 18
961-
},
9621034
{
9631035
"address": "0x56aA298a19C93c6801FDde870fA63EF75Cc0aF72",
9641036
"symbol": "MBABA",
@@ -1121,6 +1193,12 @@
11211193
"name": "NANJCOIN",
11221194
"decimals": 8
11231195
},
1196+
{
1197+
"address": "0x4a615bB7166210CCe20E6642a6f8Fb5d4D044496",
1198+
"symbol": "NAOS",
1199+
"name": "NAOS Finance",
1200+
"decimals": 18
1201+
},
11241202
{
11251203
"address": "0xEB58343b36C7528F23CAAe63a150240241310049",
11261204
"symbol": "NBU",
@@ -1187,6 +1265,12 @@
11871265
"name": "Menlo One",
11881266
"decimals": 18
11891267
},
1268+
{
1269+
"address": "0xDb05EA0877A2622883941b939f0bb11d1ac7c400",
1270+
"symbol": "OPCT",
1271+
"name": "Opacity",
1272+
"decimals": 18
1273+
},
11901274
{
11911275
"address": "0xff56Cc6b1E6dEd347aA0B7676C85AB0B3D08B0FA",
11921276
"symbol": "ORBS",
@@ -1238,7 +1322,7 @@
12381322
{
12391323
"address": "0xeca82185adCE47f39c684352B0439f030f860318",
12401324
"symbol": "PERL",
1241-
"name": "Perlin",
1325+
"name": "PERL eco",
12421326
"decimals": 18
12431327
},
12441328
{
@@ -1481,6 +1565,18 @@
14811565
"name": "Router Protocol",
14821566
"decimals": 18
14831567
},
1568+
{
1569+
"address": "0x8762db106B2c2A0bccB3A80d1Ed41273552616E8",
1570+
"symbol": "RSR",
1571+
"name": "Reserve Rights Toke",
1572+
"decimals": 18
1573+
},
1574+
{
1575+
"address": "0x196f4727526eA7FB1e17b2071B3d8eAA38486988",
1576+
"symbol": "RSV",
1577+
"name": "Reserve",
1578+
"decimals": 18
1579+
},
14841580
{
14851581
"address": "0x3d1BA9be9f66B8ee101911bC36D3fB562eaC2244",
14861582
"symbol": "RVT",
@@ -1517,6 +1613,12 @@
15171613
"name": "sETH",
15181614
"decimals": 18
15191615
},
1616+
{
1617+
"address": "0x84810bcF08744d5862B8181f12d17bfd57d3b078",
1618+
"symbol": "SGT",
1619+
"name": "SharedStake Governa",
1620+
"decimals": 18
1621+
},
15201622
{
15211623
"address": "0x6888a16eA9792c15A4DCF2f6C623D055c8eDe792",
15221624
"symbol": "SIG",
@@ -1631,12 +1733,6 @@
16311733
"name": "Swarm City",
16321734
"decimals": 18
16331735
},
1634-
{
1635-
"address": "0xeF31Cb88048416E301Fee1eA13e7664b887BA7e8",
1636-
"symbol": "SYAX",
1637-
"name": "Staked yAxis",
1638-
"decimals": 18
1639-
},
16401736
{
16411737
"address": "0x8282df223AC402d04B2097d16f758Af4F70e7Db0",
16421738
"symbol": "SYFL",
@@ -1649,6 +1745,12 @@
16491745
"name": "Sylo",
16501746
"decimals": 18
16511747
},
1748+
{
1749+
"address": "0x182F4c4C97cd1c24E1Df8FC4c053E5C47bf53Bef",
1750+
"symbol": "TANGO",
1751+
"name": "keyTango",
1752+
"decimals": 18
1753+
},
16521754
{
16531755
"address": "0x8dAEBADE922dF735c38C80C7eBD708Af50815fAa",
16541756
"symbol": "TBTC",
@@ -1733,6 +1835,12 @@
17331835
"name": "Sora Validator Toke",
17341836
"decimals": 18
17351837
},
1838+
{
1839+
"address": "0x898BAD2774EB97cF6b94605677F43b41871410B1",
1840+
"symbol": "VETH2",
1841+
"name": "vEth2",
1842+
"decimals": 18
1843+
},
17361844
{
17371845
"address": "0xfeF4185594457050cC9c23980d301908FE057Bb1",
17381846
"symbol": "VIDT",
@@ -1745,6 +1853,12 @@
17451853
"name": "Vesper Finance",
17461854
"decimals": 18
17471855
},
1856+
{
1857+
"address": "0x1cF4592ebfFd730c7dc92c1bdFFDfc3B9EfCf29a",
1858+
"symbol": "WAVES",
1859+
"name": "Waves",
1860+
"decimals": 18
1861+
},
17481862
{
17491863
"address": "0x667088b212ce3d06a1b553a7221E1fD19000d9aF",
17501864
"symbol": "WINGS",
@@ -1842,9 +1956,9 @@
18421956
"decimals": 18
18431957
},
18441958
{
1845-
"address": "0xC7e43A1c8E118aA2965F5EAbe0e718D83DB7A63C",
1846-
"symbol": "ZCRT",
1847-
"name": "ZCore Token",
1959+
"address": "0x5150956E082C748Ca837a5dFa0a7C10CA4697f9c",
1960+
"symbol": "ZDEX",
1961+
"name": "Zeedex",
18481962
"decimals": 18
18491963
},
18501964
{

ui/app/pages/swap/assets/lib.js

+31-12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ const ethUtil = require('ethereumjs-util')
55
const uniqBy = require('lodash/uniqBy')
66
const sortBy = require('lodash/sortBy')
77

8+
const tokenLists = {
9+
allTokens: 'https://tokens.coingecko.com/uniswap/all.json',
10+
unsupportedTokens: 'https://raw.githubusercontent.com/Uniswap/uniswap-interface/main/src/constants/tokenLists/unsupported.tokenlist.json',
11+
}
12+
813
const ETH = {
914
symbol: 'ETH',
1015
address: '',
@@ -26,8 +31,24 @@ const assetsPriorityList = [
2631
'AAVE',
2732
]
2833

34+
function writeTokens (tokens) {
35+
let assets = uniqBy([ETH, ...tokens], (e) => e.address)
36+
37+
assets = prioritySort(assets, assetsPriorityList)
38+
39+
try {
40+
fs.writeFileSync(
41+
`${__dirname}/assets.mainnet.json`,
42+
JSON.stringify(assets, null, 4),
43+
)
44+
console.log('✅️ Asset list successfully updated.')
45+
} catch (error) {
46+
console.error(error)
47+
}
48+
}
49+
2950
function main () {
30-
fetch('https://tokens.coingecko.com/uniswap/all.json').then((r) =>
51+
fetch(tokenLists.allTokens).then((r) =>
3152
r.json().then((data) => {
3253
const tokens = data.tokens
3354
.map((token) => ({
@@ -38,19 +59,17 @@ function main () {
3859
}))
3960
.filter(({ address }) => address in contractMap)
4061

41-
let assets = uniqBy([ETH, ...tokens], (e) => e.address)
62+
fetch(tokenLists.unsupportedTokens).then((u) =>
63+
u.json().then((data) => {
64+
const unsupportedTokens = data.tokens
65+
.map(({ address }) => (ethUtil.toChecksumAddress(address)))
4266

43-
assets = prioritySort(assets, assetsPriorityList)
67+
const supportedTokens = tokens
68+
.filter(({ address }) => !(address in unsupportedTokens))
4469

45-
try {
46-
fs.writeFileSync(
47-
`${__dirname}/assets.mainnet.json`,
48-
JSON.stringify(assets, null, 4),
49-
)
50-
console.log('✅️ Asset list successfully updated.')
51-
} catch (error) {
52-
console.error(error)
53-
}
70+
writeTokens(supportedTokens)
71+
}),
72+
)
5473
}),
5574
)
5675
}

0 commit comments

Comments
 (0)