Skip to content

Commit 4e5d5d5

Browse files
authored
Merge pull request #658 from maticnetwork/clean-lists
Clean lists
2 parents 965931b + a17bcbb commit 4e5d5d5

36 files changed

+5912
-141573
lines changed

README.md

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,49 @@ This repo contains lists of tokens mapped to the Polygon chains that may be used
66

77
The JSON schema for the tokens includes: chainId, name, address, decimals, symbol, logoURI (optional), tags (optional), and custom extensions metadata.
88

9-
1. [Mapped Tokens List](https://api-polygon-tokens.polygon.technology/tokenlists/polygon.tokenlist.json) Contains tokens that are mapped to Polygon PoS and Polygon zkEVM. Anyone can propose updates to this list.
9+
1. [Mapped Tokens](https://api-polygon-tokens.polygon.technology/tokenlists/mapped.tokenlist.json) Contains tokens that are mapped to Polygon bridges. Anyone can propose updates to this list.
1010

11-
2. [Popular Tokens List](https://api-polygon-tokens.polygon.technology/tokenlists/polygonPopular.tokenlist.json) Contains the top 100 most used tokens on the Polygon chains.
11+
2. [Popular Tokens](https://api-polygon-tokens.polygon.technology/tokenlists/popular.tokenlist.json) Contains the top 100 most used tokens on the mainnet chains.
1212

13-
3. [Testnet Tokens List](https://api-polygon-tokens.polygon.technology/tokenlists/polygonTestnet.tokenlist.json) contains the tokens mapped on the Mumbai chain.
13+
3. [Mapped Tokens Testnet](https://api-polygon-tokens.polygon.technology/tokenlists/mappedTestnet.tokenlist.json) ontains tokens that are mapped to Polygon bridges on testnet chains. Anyone can propose updates to this list.
1414

15-
4. [Blacklist Tokens List](https://api-polygon-tokens.polygon.technology/tokenlists/blacklist.tokenlist.json) Contains tokens that have been flagged for issues.
15+
4. [Popular Tokens Testnet](https://api-polygon-tokens.polygon.technology/tokenlists/popularTestnet.tokenlist.json) Contains the most used tokens on the testnet chains.
1616

17-
## Adding or Updating a token
17+
## Updating a token
1818

1919
1. Fork the repository
2020

21-
2. Add the new token at the end of the token array in `src/tokens/polygonTokens.json`
22-
23-
Please make sure that the new token follows this schema.
24-
25-
```json
26-
{
27-
"chainId": 137, // Chain Id of the L2 chain
28-
"name": "token_name",
29-
"symbol": "token_symbol",
30-
"decimals": "<token_decimals>",
31-
"address": "token_address on Polygon",
32-
"logoURI": "token_icon_uri",
33-
"tags": ["<bridge>", "<token_type>", "<optional_tag>", "<optional_tag>", ...], // For all acceptable tags, check the below list
34-
"extensions": {
35-
"originTokenAddress": "token_address on the origin chain", // If not deployed on ethereum, add noDeposit and noWithdraw tags
36-
"originTokenNetwork": "id of the token's origin chain", // Use 0 for Ethereum, 1 for zkEVM, -1 for PoS
37-
"wrappedTokenNetwork": "id of the wrapper token's chain", // Only for tokens bridged via LxLy bridge (zkEVM)
38-
"project": {
39-
"name": "Project_Name",
40-
"summary": "Short_Project_Description",
41-
"contact": "Project_Support",
42-
"website": "Project_Website"
43-
},
44-
"originChainBridgeAdapter": "Bridge adapter contract address on origin chain", // Only required for tokens bridged using zkEVM messaging layer
45-
"wrapperChainBridgeAdapter": "Bridge adapter contract address on wrapper chain" // Only required for tokens bridged using zkEVM messaging layer
46-
}
47-
}
48-
```
21+
2. Update the token in the token array of `src/tokens/mapped.json` for mainnet or `src/tokens/mappedTestnet.json` for testnet
22+
23+
Please make sure that the updated token do not disturb the schema.
4924

5025
### Tags
5126

52-
1. `stablecoin`: Tokens that are pegged to a fiat asset, e.g. USDC, USDT
27+
1. `lxly`: Tokens that are bridged using the LxLy bridge (Agg Layer v1)
5328

54-
2. `swapable`: Tokens are eligible for swapping through the 0x contracts
29+
2. `pos`: Tokens that are bridged using the PoS bridge
5530

56-
3. `native`: Tokens are native tokens of the chain
31+
3. `plasma`: Tokens that are bridged using the PLASMA bridge
5732

58-
4. `erc20`: Tokens are of ERC20 token type
33+
4. `fx`: Tokens that are bridged using the FX
5934

60-
5. `pos`: Tokens that are bridged using the PoS bridge
61-
Note: Also use this tag if the tokens cannot be bridged.
35+
5. `customBridge`: Token mapped through custom bridges
6236

63-
6. `fx`: Tokens that are bridged using the FX or custom FX bridge
37+
6. `zkevmMessageBridge`: Token mapped through zkevmMessageBridge bridge
6438

65-
7. `plasma`: Tokens that are bridged using the PLASMA bridge
39+
7. `customFx`: Token mapped through customFx bridge
6640

67-
8. `lxly`: Tokens that are bridged using the LxLy bridge (zkEVM)
41+
8. `erc20`: Token of ERC20 token type
6842

69-
9. `metaTx`: Tokens are eligible for meta transactions
70-
Note: Use this tag if the tokens support meta transactions and can be used for a gasless swaps.
43+
9. `governanceToken`: Governance token of the chain
7144

72-
10. `customSig`: The token has its custom withdraw event signature and does not depend on the transfer event signature while verifing withdrawals
45+
10. `nativeToken`: Native token of the chain
7346

74-
11. `noDeposit`: Tokens are not eligible for deposits from Ethereum
75-
Note: Also use this tag if the tokens cannot be bridged.
47+
11. `customWithdrawEventSig`: The token has its custom withdraw event signature and does not depend on the transfer event signature while verifing withdrawals
7648

77-
12. `noWithdraw`: Tokens are not eligible for withdrawals back to Ethereum
78-
Note: Also use this tag if the tokens cannot be bridged.
49+
12. `noDeposit`: Token not eligible for deposits
7950

80-
13. `customZkevmBridge`: Tokens that are bridged using zkEVM messaging layer
51+
13. `noWithdraw`: Token not eligible for withdrawals on PoS bridges
8152

8253
3. Run linter and fix the issues if any
8354

@@ -99,7 +70,7 @@ The JSON schema for the tokens includes: chainId, name, address, decimals, symbo
9970
npm run build
10071
```
10172

102-
5. Commit the changes and raise a Pull request to our repo's dev branch
73+
5. Commit the changes and raise a Pull request to our repo
10374

10475
### Disclaimer
10576

src/build.js

Lines changed: 30 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,51 @@
1-
const polygonTokens = require("./tokens/polygonTokens.json");
2-
const popularTokens = require("./tokens/popularTokens.json");
3-
const testnetTokens = require("./tokens/testnetTokens.json");
4-
const blacklistTokens = require("./tokens/blacklistTokens.json");
5-
const zkevmPopularTokens = require("./tokens/zkevmPopularTokens.json");
6-
const allPolygonTokens = require("./tokens/polygon.json");
7-
const allPolygonTestnetTokens = require("./tokens/polygonTestnet.json");
8-
const allPolygonPopularTokens = require("./tokens/polygonPopular.json");
9-
const allPolygonTestnetPopularTokens = require("./tokens/polygonTestnetPopular.json");
10-
const v2PopularTokens = require("./tokens/defaultTokens.json");
11-
const v2MappedTokens = require("./tokens/mappedTokens.json");
12-
const v2PopularTokensTestnet = require("./tokens/defaultTokensTestnet.json");
13-
const v2PopularTokensTestnetNew = require("./tokens/defaultTokensTestnetNew.json");
14-
const v2MappedTokensTestnet = require("./tokens/mappedTokensTestnet.json");
15-
const v2PopularTokensStaging = require("./tokens/defaultTokensStaging.json");
16-
const v2MappedTokensStaging = require("./tokens/mappedTokensStaging.json");
17-
const v2MappedTokensTestnetNew = require("./tokens/mappedTokensTestnetNew.json");
18-
const polygonTokensTokenList = require("./metadata/polygonTokens.json");
19-
const popularTokenList = require("./metadata/popularTokens.json");
20-
const testnetTokenList = require("./metadata/testnetTokens.json");
21-
const blacklistTokenList = require("./metadata/blacklistTokens.json");
22-
const zkevmPopularTokenList = require("./metadata/zkevmPopularTokens.json");
23-
const allPolygonTokenList = require("./metadata/polygon.json");
24-
const allPolygonTestnetTokenList = require("./metadata/polygonTestnet.json");
25-
const allPolygonPopularTokenList = require("./metadata/polygonPopular.json");
26-
const allPolygonTestnetPopularTokenList = require("./metadata/polygonTestnetPopular.json");
27-
const v2PopularTokenList = require("./metadata/defaultTokens.json");
28-
const v2MappedTokenList = require("./metadata/mappedTokens.json");
29-
const v2PopularTestnetTokenList = require("./metadata/defaultTokensTestnet.json");
30-
const v2MappedTestnetTokenList = require("./metadata/mappedTokensTestnet.json");
31-
const v2PopularTestnetTokenListNew = require("./metadata/defaultTokensTestnetNew.json");
32-
const v2PopularTokenListStaging = require("./metadata/defaultTokensStaging.json");
33-
const v2MappedTokenListStaging = require("./metadata/mappedTokensStaging.json");
34-
const v2MappedTestnetNewTokenList = require("./metadata/mappedTokensTestnetNew.json");
35-
36-
// Remove the project information from lists
37-
allPolygonTokens.forEach((token) => {
38-
delete token.extensions.project;
39-
});
40-
41-
allPolygonPopularTokens.forEach((token) => {
42-
delete token.extensions.project;
43-
});
44-
45-
polygonTokens.forEach((token) => {
46-
delete token.extensions.project;
47-
});
48-
49-
popularTokens.forEach((token) => {
50-
delete token.extensions.project;
51-
});
1+
const popularTokens = require("./tokens/defaultTokens.json");
2+
const mappedTokens = require("./tokens/mappedTokens.json");
3+
const popularTokensTestnet = require("./tokens/defaultTokensTestnet.json");
4+
const mappedTokensTestnet = require("./tokens/mappedTokensTestnet.json");
5+
const popularTokensStaging = require("./tokens/defaultTokensStaging.json");
6+
const mappedTokensStaging = require("./tokens/mappedTokensStaging.json");
7+
8+
const popularTokenList = require("./metadata/defaultTokens.json");
9+
const mappedTokenList = require("./metadata/mappedTokens.json");
10+
const popularTestnetTokenList = require("./metadata/defaultTokensTestnet.json");
11+
const mappedTestnetTokenList = require("./metadata/mappedTokensTestnet.json");
12+
const popularTokenListStaging = require("./metadata/defaultTokensStaging.json");
13+
const mappedTokenListStaging = require("./metadata/mappedTokensStaging.json");
5214

5315
module.exports = function buildList() {
5416
const timestamp = new Date().toISOString();
5517

56-
Object.assign(v2PopularTokenList, {
18+
Object.assign(popularTokenList, {
5719
timestamp,
58-
tokens: v2PopularTokens,
20+
tokens: popularTokens,
5921
}); // v2 Default List
60-
Object.assign(v2MappedTokenList, {
22+
Object.assign(mappedTokenList, {
6123
timestamp,
62-
tokens: v2MappedTokens,
24+
tokens: mappedTokens,
6325
}); //v2 Mapped List
64-
Object.assign(v2PopularTestnetTokenList, {
26+
Object.assign(popularTestnetTokenList, {
6527
timestamp,
66-
tokens: v2PopularTokensTestnet,
28+
tokens: popularTokensTestnet,
6729
}); // v2 Default Testnet List
68-
Object.assign(v2MappedTestnetTokenList, {
30+
Object.assign(mappedTestnetTokenList, {
6931
timestamp,
70-
tokens: v2MappedTokensTestnet,
32+
tokens: mappedTokensTestnet,
7133
}); //v2 Mapped Testnet List
72-
Object.assign(v2MappedTestnetNewTokenList, {
73-
timestamp,
74-
tokens: v2MappedTokensTestnetNew,
75-
}); //v2 Mapped Testnet New List
76-
Object.assign(v2PopularTestnetTokenListNew, {
77-
timestamp,
78-
tokens: v2PopularTokensTestnetNew,
79-
}); //v2 Default Testnet New List
80-
81-
Object.assign(allPolygonTokenList, { timestamp, tokens: allPolygonTokens }); // Aggregated Polygon Tokens List
82-
Object.assign(allPolygonPopularTokenList, {
83-
timestamp,
84-
tokens: allPolygonPopularTokens,
85-
}); // Aggregated Polygon Popular Tokens List
86-
Object.assign(allPolygonTestnetTokenList, {
87-
timestamp,
88-
tokens: allPolygonTestnetTokens,
89-
}); // Aggregated Polygon Testnet Tokens List
90-
Object.assign(allPolygonTestnetPopularTokenList, {
91-
timestamp,
92-
tokens: allPolygonTestnetPopularTokens,
93-
}); // Aggregated Polygon Testnet Popular Tokens List
94-
Object.assign(polygonTokensTokenList, { timestamp, tokens: polygonTokens }); // PolygonTokens tokenlist
95-
Object.assign(popularTokenList, { timestamp, tokens: popularTokens }); // popular tokenlist
96-
Object.assign(zkevmPopularTokenList, {
97-
timestamp,
98-
tokens: zkevmPopularTokens,
99-
}); // zkevm popular tokenlist
100-
Object.assign(testnetTokenList, { timestamp, tokens: testnetTokens }); // Testnet tokenlist
101-
Object.assign(blacklistTokenList, { timestamp, tokens: blacklistTokens }); // blacklist tokenlist
102-
Object.assign(v2PopularTokenListStaging, {
34+
Object.assign(popularTokenListStaging, {
10335
timestamp,
104-
tokens: v2PopularTokensStaging,
36+
tokens: popularTokensStaging,
10537
}); // Staging Tokenlist
106-
Object.assign(v2MappedTokenListStaging, {
38+
Object.assign(mappedTokenListStaging, {
10739
timestamp,
108-
tokens: v2MappedTokensStaging,
40+
tokens: mappedTokensStaging,
10941
}); // Staging Tokenlist
11042

11143
return {
112-
allPolygonTokenList,
113-
allPolygonPopularTokenList,
114-
allPolygonTestnetTokenList,
115-
allPolygonTestnetPopularTokenList,
116-
polygonTokensTokenList,
44+
popularTokenListStaging,
45+
mappedTokenListStaging,
11746
popularTokenList,
118-
zkevmPopularTokenList,
119-
testnetTokenList,
120-
blacklistTokenList,
121-
v2PopularTokenListStaging,
122-
v2MappedTokenListStaging,
123-
v2PopularTokenList,
124-
v2MappedTokenList,
125-
v2PopularTestnetTokenList,
126-
v2MappedTestnetTokenList,
127-
v2MappedTestnetNewTokenList,
128-
v2PopularTestnetTokenListNew,
47+
mappedTokenList,
48+
popularTestnetTokenList,
49+
mappedTestnetTokenList,
12950
};
13051
};

src/listRegistry.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
[
22
{
3-
"name": "Polygon Tokens",
4-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/polygonTokens.tokenlist.json",
5-
"summary": "A list of tokens on the polygon network added by the community",
3+
"name": "Popular Tokens",
4+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/popular.tokenlist.json",
5+
"summary": "Contains the top 100 most used tokens on the Polygon chains",
66
"homepage": "polygon.technology",
77
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
88
},
99
{
10-
"name": "Popular Tokens",
11-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/popularTokens.tokenlist.json",
12-
"summary": "A list of most used tokens on the polygon wallet",
10+
"name": "Popular Tokens Staging",
11+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/staging.tokenlist.json",
12+
"summary": "Contains the top 100 most used tokens on the Polygon chains - Staging purposes",
1313
"homepage": "polygon.technology",
1414
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
1515
},
1616
{
17-
"name": "ZKEVM Popular",
18-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/zkevmPopular.tokenlist.json",
19-
"summary": "A list of most used tokens on the polygon wallet zkevm chain",
17+
"name": "Popular Tokens Testnet",
18+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/popularTestnet.tokenlist.json",
19+
"summary": "Contains the top 100 most used tokens on the Polygon testnet chains",
2020
"homepage": "polygon.technology",
2121
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
2222
},
2323
{
24-
"name": "Cross-Chain",
25-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/cross-chain.tokenlist.json",
26-
"summary": "A cross-chain tokens list for transfers and swaps",
24+
"name": "Mapped Tokens",
25+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/mapped.tokenlist.json",
26+
"summary": "Contains tokens that are mapped on Polygon Bridges. Anyone can propose updates to this list.",
2727
"homepage": "polygon.technology",
2828
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
2929
},
3030
{
31-
"name": "Polygon Testnet",
32-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/testnet.tokenlist.json",
33-
"summary": "A list of tokens on the Mumbai testnet",
31+
"name": "Mapped Tokens Staging",
32+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/mappedStaging.tokenlist.json",
33+
"summary": "Contains tokens that are mapped on Polygon Bridges. Anyone can propose updates to this list.",
3434
"homepage": "polygon.technology",
3535
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
3636
},
3737
{
38-
"name": "BlackList Tokens",
39-
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/blacklist.tokenlist.json",
40-
"summary": "A list of tokens that are blacklisted",
38+
"name": "Mapped Tokens Testnet",
39+
"listURI": "api-polygon-tokens.polygon.technology/tokenlists/mappedTestnet.tokenlist.json",
40+
"summary": "Contains tokens that are mapped on Polygon Bridges. Anyone can propose updates to this list.",
4141
"homepage": "polygon.technology",
4242
"logoURI": "https://assets.polygon.technology/tokenAssets/matic.svg"
4343
}

src/metadata/blacklistTokens.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)