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: Add arb token list #213

Merged
merged 1 commit into from
Aug 7, 2023
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions lists/pancakeswap-arbitrum-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"name": "PancakeSwap Arbitrum Default",
"timestamp": "2023-08-07T03:09:58.256Z",
"version": {
"major": 0,
"minor": 0,
"patch": 3
},
"logoURI": "https://pancakeswap.finance/logo.png",
"keywords": [
"pancakeswap",
"default",
"arbitrum"
],
"tokens": [
{
"name": "Wrapped Ether",
"symbol": "WETH",
"address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"chainId": 42161,
"decimals": 18,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/weth.png"
},
{
"name": "USD Coin",
"symbol": "USDC",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/usdc.png"
},
{
"name": "Bridged USDC",
"symbol": "USDC.e",
"address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/arbitrum/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8.png"
},
{
"name": "Tether USD",
"symbol": "USDT",
"address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/usdt.png"
},
{
"name": "Arbitrum",
"symbol": "ARB",
"address": "0x912CE59144191C1204E64559FE8253a0e49E6548",
"chainId": 42161,
"decimals": 18,
"logoURI": "https://tokens.pancakeswap.finance/images/arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548.png"
},
{
"name": "Wrapped BTC",
"symbol": "WBTC",
"address": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
"chainId": 42161,
"decimals": 8,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/wbtc.png"
}
]
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"checksum:pcs-polygon-zkevm-default": "yarn build && node ./dist checksum pancakeswap-polygon-zkevm-default",
"generate:pcs-polygon-zkevm-default": "yarn test --list=pancakeswap-polygon-zkevm-default && yarn build && node ./dist generate pancakeswap-polygon-zkevm-default",
"makelist:pcs-polygon-zkevm-default": "yarn checksum:pcs-polygon-zkevm-default && yarn generate:pcs-polygon-zkevm-default",
"checksum:pcs-arbitrum-default": "yarn build && node ./dist checksum pancakeswap-arbitrum-default",
"generate:pcs-arbitrum-default": "yarn test --list=pancakeswap-arbitrum-default && yarn build && node ./dist generate pancakeswap-arbitrum-default",
"makelist:pcs-arbitrum-default": "yarn checksum:pcs-arbitrum-default && yarn generate:pcs-arbitrum-default",
"checksum:pcs-eth-mm": "yarn build && node ./dist checksum pancakeswap-eth-mm",
"generate:pcs-eth-mm": "yarn test --list=pancakeswap-eth-mm && yarn build && node ./dist generate pancakeswap-eth-mm",
"makelist:pcs-eth-mm": "yarn checksum:pcs-eth-mm && yarn generate:pcs-eth-mm",
Expand Down
10 changes: 10 additions & 0 deletions src/buildList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import { version as coingeckoVersion } from "../lists/coingecko.json";
import { version as cmcVersion } from "../lists/cmc.json";
import { version as pancakeswapMiniVersion } from "../lists/pancakeswap-mini.json";
import { version as pancakeswapMiniExtendedVersion } from "../lists/pancakeswap-mini-extended.json";
import { version as pancakeswapArbitrumVersion } from "../lists/pancakeswap-arbitrum-default.json";
import pancakeswapAptos from "./tokens/pancakeswap-aptos.json";
import pancakeswapDefault from "./tokens/pancakeswap-default.json";
import pancakeswapPolygonZkevmDefault from "./tokens/pancakeswap-polygon-zkevm-default.json";
import pancakeswapZksyncDefault from "./tokens/pancakeswap-zksync-default.json";
import pancakeswapArbDefault from "./tokens/pancakeswap-arbitrum-default.json";
import pancakeswapEthDefault from "./tokens/pancakeswap-eth-default.json";
import pancakeswapEthMM from "./tokens/pancakeswap-eth-mm.json";
import pancakeswapExtended from "./tokens/pancakeswap-extended.json";
Expand Down Expand Up @@ -68,6 +70,14 @@ const lists = {
sort: false,
currentVersion: pancakeswapPolygonZkevmDefaultVersion,
},
"pancakeswap-arbitrum-default": {
list: pancakeswapArbDefault,
name: "PancakeSwap Arbitrum Default",
keywords: ["pancakeswap", "default", "arbitrum"],
logoURI: "https://pancakeswap.finance/logo.png",
sort: false,
currentVersion: pancakeswapArbitrumVersion,
},
"pancakeswap-eth-default": {
list: pancakeswapEthDefault,
name: "PancakeSwap Ethereum Default",
Expand Down
2 changes: 2 additions & 0 deletions src/checksum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import pancakeswapDefault from "./tokens/pancakeswap-default.json";
import pancakeswapEthDefault from "./tokens/pancakeswap-eth-default.json";
import pancakeswapZksyncDefault from "./tokens/pancakeswap-zksync-default.json";
import pancakeswapPolygonZkevmDefault from "./tokens/pancakeswap-polygon-zkevm-default.json";
import pancakeswapArbitrumDefault from "./tokens/pancakeswap-arbitrum-default.json";
import pancakeswapEthMM from "./tokens/pancakeswap-eth-mm.json";
import pancakeswapBnbMM from "./tokens/pancakeswap-bnb-mm.json";
import pancakeswapExtended from "./tokens/pancakeswap-extended.json";
Expand All @@ -19,6 +20,7 @@ const lists = {
"pancakeswap-default": pancakeswapDefault,
"pancakeswap-eth-default": pancakeswapEthDefault,
"pancakeswap-polygon-zkevm-default": pancakeswapPolygonZkevmDefault,
"pancakeswap-arbitrum-default": pancakeswapArbitrumDefault,
"pancakeswap-zksync-default": pancakeswapZksyncDefault,
"pancakeswap-eth-mm": pancakeswapEthMM,
"pancakeswap-bnb-mm": pancakeswapBnbMM,
Expand Down
7 changes: 7 additions & 0 deletions src/ci-check.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import srcDefault from "./tokens/pancakeswap-default.json";
import srcEthDefault from "./tokens/pancakeswap-eth-default.json";
import srcPolygonZkevmDefault from "./tokens/pancakeswap-polygon-zkevm-default.json";
import srcArbitrumDefault from "./tokens/pancakeswap-arbitrum-default.json";
import srcZksyncDefault from "./tokens/pancakeswap-zksync-default.json";
import srcExtended from "./tokens/pancakeswap-extended.json";
import srcTop100 from "./tokens/pancakeswap-top-100.json";
Expand All @@ -13,6 +14,7 @@ import defaultList from "../lists/pancakeswap-default.json";
import defaultEthList from "../lists/pancakeswap-eth-default.json";
import defaultPolygonZkevmList from "../lists/pancakeswap-polygon-zkevm-default.json";
import defaultZksyncList from "../lists/pancakeswap-zksync-default.json";
import defaultArbitrumList from "../lists/pancakeswap-arbitrum-default.json";
import extendedtList from "../lists/pancakeswap-extended.json";
import top15List from "../lists/pancakeswap-top-15.json";
import top100tList from "../lists/pancakeswap-top-100.json";
Expand Down Expand Up @@ -42,6 +44,11 @@ const lists = [
src: srcPolygonZkevmDefault,
actual: defaultPolygonZkevmList,
},
{
name: "pancakeswap-arbitrum-default",
src: srcArbitrumDefault,
actual: defaultArbitrumList,
},
{
name: "pancakeswap-extended",
src: srcExtended,
Expand Down
50 changes: 50 additions & 0 deletions src/tokens/pancakeswap-arbitrum-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"name": "Wrapped Ether",
"symbol": "WETH",
"address": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"chainId": 42161,
"decimals": 18,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/weth.png"
},
{
"name": "USD Coin",
"symbol": "USDC",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/usdc.png"
},
{
"name": "Bridged USDC",
"symbol": "USDC.e",
"address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/arbitrum/0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8.png"
},
{
"name": "Tether USD",
"symbol": "USDT",
"address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"chainId": 42161,
"decimals": 6,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/usdt.png"
},
{
"name": "Arbitrum",
"symbol": "ARB",
"address": "0x912CE59144191C1204E64559FE8253a0e49E6548",
"chainId": 42161,
"decimals": 18,
"logoURI": "https://tokens.pancakeswap.finance/images/arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548.png"
},
{
"name": "Wrapped BTC",
"symbol": "WBTC",
"address": "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",
"chainId": 42161,
"decimals": 8,
"logoURI": "https://tokens.pancakeswap.finance/images/symbol/wbtc.png"
}
]
1 change: 1 addition & 0 deletions src/utils/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const multicall = {
[56]: "0xcA11bde05977b3631167028862bE2a173976CA11",
[1101]: "0xcA11bde05977b3631167028862bE2a173976CA11",
[324]: "0xF9cda624FBC7e059355ce98a31693d299FACd963",
[42161]: "0xcA11bde05977b3631167028862bE2a173976CA11",
};

interface MultiCall {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/simpleRpcProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ const bscRpcProvider = new ethers.providers.StaticJsonRpcProvider(RPC_URL, 56);
const ethRpcProvider = new ethers.providers.StaticJsonRpcProvider(ETH_RPC_URL, 1);
const polygonZkevmRpcProvider = new ethers.providers.StaticJsonRpcProvider(POLYGON_ZKEVM_RPC_URL, 1101);
const zksyncRpcProvider = new ethers.providers.StaticJsonRpcProvider(ZKSYNC_RPC_URL, 324);
const arbitrumRpcProvider = new ethers.providers.StaticJsonRpcProvider("https://arb1.arbitrum.io/rpc", 42161);

const simpleRpcProvider = {
[1]: ethRpcProvider,
[56]: bscRpcProvider,
[1101]: polygonZkevmRpcProvider,
[324]: zksyncRpcProvider,
[42161]: arbitrumRpcProvider,
};

export default simpleRpcProvider;
18 changes: 18 additions & 0 deletions test/default.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import pancakeswapSchema from "@pancakeswap/token-lists/schema/pancakeswap.json"
import currentPancakeswapDefaultList from "../lists/pancakeswap-default.json";
import currentPancakeswapEthDefaultList from "../lists/pancakeswap-eth-default.json";
import currentPancakeswapZksyncDefaultList from "../lists/pancakeswap-zksync-default.json";
import currentPancakeswapArbitrumDefaultList from "../lists/pancakeswap-arbitrum-default.json";
import currentPancakeswapPolygonZkevmDefaultList from "../lists/pancakeswap-polygon-zkevm-default.json";
import currentPancakeswapEthMMList from "../lists/pancakeswap-eth-mm.json";
import currentPancakeswapBnbMMList from "../lists/pancakeswap-bnb-mm.json";
Expand All @@ -32,6 +33,7 @@ const CASES = [
["pancakeswap-eth-default"],
["pancakeswap-zksync-default"],
["pancakeswap-polygon-zkevm-default"],
["pancakeswap-arbitrum-default"],
["pancakeswap-eth-mm"],
["pancakeswap-extended"],
["pancakeswap-top-100"],
Expand All @@ -52,6 +54,7 @@ const currentLists = {
"pancakeswap-bnb-mm": currentPancakeswapBnbMMList,
"pancakeswap-eth-default": currentPancakeswapEthDefaultList,
"pancakeswap-zksync-default": currentPancakeswapZksyncDefaultList,
"pancakeswap-arbitrum-default": currentPancakeswapArbitrumDefaultList,
"pancakeswap-polygon-zkevm-default": currentPancakeswapPolygonZkevmDefaultList,
"pancakeswap-extended": currentPancakeswapExtendedtList,
"pancakeswap-top-100": currentPancakeswapTop100tList,
Expand Down Expand Up @@ -88,6 +91,7 @@ const pathToImages = path.join(path.resolve(), "lists", "images");
const pathToEthImages = path.join(path.resolve(), "lists", "images", "eth");
const pathToZksyncImages = path.join(path.resolve(), "lists", "images", "zksync");
const pathToPolygonZkevmImages = path.join(path.resolve(), "lists", "images", "polygon-zkevm");
const pathToARbImages = path.join(path.resolve(), "lists", "images", "arbitrum");

const logoFiles = fs
.readdirSync(pathToImages, { withFileTypes: true })
Expand All @@ -109,18 +113,25 @@ const polygonZkevmLogoFiles = fs
.filter((f) => f.isFile())
.filter((f) => !/(^|\/)\.[^\/\.]/g.test(f.name));

const pathToARbImagesLogoFiles = fs
.readdirSync(pathToARbImages, { withFileTypes: true })
.filter((f) => f.isFile())
.filter((f) => !/(^|\/)\.[^\/\.]/g.test(f.name));

const multiChainLogoPath = {
[56]: "",
[1]: "/eth",
[1101]: "/polygon-zkevm",
[324]: "/zksync",
[42161]: "/arbitrum",
};

const multiChainLogoFiles = {
[56]: logoFiles,
[1]: ethLogoFiles,
[1101]: polygonZkevmLogoFiles,
[324]: polygonZksyncFiles,
[42161]: pathToARbImagesLogoFiles,
};

// Modified https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get
Expand Down Expand Up @@ -191,6 +202,13 @@ expect.extend({
// Note: fs.existsSync can't be used here because its not case sensetive
hasLocalLogo = multiChainLogoFiles[token.chainId]?.map((f) => f.name).includes(fileName);
}

if (token.logoURI === `https://tokens.pancakeswap.finance/images/symbol/${token.symbol.toLowerCase()}.png`) {
return {
message: () => ``,
pass: true,
};
}
if (hasTWLogo || hasLocalLogo) {
return {
message: () => ``,
Expand Down
Loading