Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Token List #95

Merged
merged 8 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@pancakeswap-libs/eslint-config-pancake": "0.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-typescript": "^8.2.1",
"@rollup/plugin-url": "^6.0.0",
"@storybook/addon-a11y": "^6.2.9",
Expand Down
17 changes: 17 additions & 0 deletions packages/token-lists/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"settings": {
"import/resolver": {
"node": {
"paths": ["./src"]
}
}
},
"env": {
"es6": true,
"jest": true
},
"extends": "@pancakeswap/eslint-config-pancake",
"rules": {
"no-console": ["warn", { "allow": ["info", "warn", "error"] }]
}
}
35 changes: 35 additions & 0 deletions packages/token-lists/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PancakeSwap Token Lists

This repo contains main PancakeSwap token list and tools to validate it.

## How to add external lists

URLs to external lists are stored in `token-lists.json`, if you want your list to be available on upcoming list UI page - submit a PR modifying `token-lists.json`.

## How to add new lists within this repository

- Add an array of tokens under `src/tokens`
- Add `checksum:newlistname`, `generate:newlistname`, `makelist:newlistname` command to `package.json` analogous to PancakeSwap default and extended list scripts.
- Modify `checksum.ts`, `buildList.ts` and `default.test.ts` to handle new list

## How to add new tokens to pancakeswap (extended) token list

Note - this is not something we expect pull requests for.
Unless you've been specifically asked by someone from PCS team please do no submit PRs to be listed on default PCS list. You can still trade your tokens on PCS exchange by pasting your address into the token field.

- Update version in `package.json`
- Add new tokens to `src/tokens/pancakeswap-extended.json` file
- Run `yarn makelist:pcs-extended`
- If tests pass - new token list will be created under `lists` directory

For list to be considered valid it need to satisfy the following criteria:

- It passes [token list schema](https://github.com/Uniswap/token-lists/blob/master/src/tokenlist.schema.json) validation (schema is [slightly modified](src/schema.ts))
- There are no duplicate addresses, symbols or token names in the list
- All addresses are valid and checksummed (`yarn checksum:pcs` automatically converts addresses to checksummed versions, it is also part of `yarn makelist:pcs`)

## Deploying

Token lists will be auto-deployed via netlify when PR is merged to master. Be sure to build the list with `yarn makelist:list-name` before submitting/merging the PR since it doesn't make much sense building lists within Netlify (because most errors are related to wrong token information and should be fixed prior to landing into master)

Netlify simply takes the json files under `lists` directory and hosts them on `tokens.pancakeswap.finance/list-name.json`
6 changes: 6 additions & 0 deletions packages/token-lists/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
14 changes: 14 additions & 0 deletions packages/token-lists/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default {
preset: "ts-jest",
testEnvironment: "node",
transform: {
"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest",
},
collectCoverageFrom: [
"**/*.ts",
"!./src/index.ts",
"!**/node_modules/**",
"!**/dist/**",
],
};
136 changes: 136 additions & 0 deletions packages/token-lists/lists/pancakeswap-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"name": "PancakeSwap Default Token List",
"timestamp": "2021-05-31T08:27:57.877Z",
"version": {
"major": 2,
"minor": 10,
"patch": 0
},
"logoURI": "https://assets.trustwalletapp.com/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",
"keywords": [
"pancakeswap",
"default"
],
"tokens": [
{
"name": "WBNB Token",
"symbol": "WBNB",
"address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png"
},
{
"name": "PancakeSwap Token",
"symbol": "CAKE",
"address": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82.png"
},
{
"name": "BUSD Token",
"symbol": "BUSD",
"address": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xe9e7cea3dedca5984780bafc599bd69add087d56.png"
},
{
"name": "Tether USD",
"symbol": "USDT",
"address": "0x55d398326f99059fF775485246999027B3197955",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x55d398326f99059ff775485246999027b3197955.png"
},
{
"name": "BTCB Token",
"symbol": "BTCB",
"address": "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c.png"
},
{
"name": "Ethereum Token",
"symbol": "ETH",
"address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x2170ed0880ac9a755fd29b2688956bd959f933f8.png"
},
{
"name": "Pancake Bunny",
"symbol": "BUNNY",
"address": "0xC9849E6fdB743d08fAeE3E34dd2D1bc69EA11a51",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xc9849e6fdb743d08faee3e34dd2d1bc69ea11a51.png"
},
{
"name": "Venus",
"symbol": "XVS",
"address": "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xcf6bb5389c92bdda8a3747ddb454cb7a64626c63.png"
},
{
"name": "VAI Stablecoin",
"symbol": "VAI",
"address": "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x4bd17003473389a42daf6a0a729f6fdb328bbbd7.png"
},
{
"name": "SafeMoon",
"symbol": "SAFEMOON",
"address": "0x8076C74C5e3F5852037F31Ff0093Eeb8c8ADd8D3",
"chainId": 56,
"decimals": 9,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x8076c74c5e3f5852037f31ff0093eeb8c8add8d3.png"
},
{
"name": "Alpaca",
"symbol": "ALPACA",
"address": "0x8F0528cE5eF7B51152A59745bEfDD91D97091d2F",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x8f0528ce5ef7b51152a59745befdd91d97091d2f.png"
},
{
"name": "Belt",
"symbol": "BELT",
"address": "0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xE0e514c71282b6f4e823703a39374Cf58dc3eA4f.png"
},
{
"name": "TokoCrypto",
"symbol": "TKO",
"address": "0x9f589e3eabe42ebC94A44727b3f3531C0c877809",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x9f589e3eabe42ebc94a44727b3f3531c0c877809.png"
},
{
"name": "Nerve Finance",
"symbol": "NRV",
"address": "0x42F6f551ae042cBe50C739158b4f0CAC0Edb9096",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0x42f6f551ae042cbe50c739158b4f0cac0edb9096.png"
},
{
"name": "Ellipsis",
"symbol": "EPS",
"address": "0xA7f552078dcC247C2684336020c03648500C6d9F",
"chainId": 56,
"decimals": 18,
"logoURI": "https://exchange.pancakeswap.finance/images/coins/0xa7f552078dcc247c2684336020c03648500c6d9f.png"
}
]
}
Loading