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 L2 native token list #146

Merged
merged 12 commits into from
Jul 2, 2024
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
25 changes: 25 additions & 0 deletions .github/workflows/generate-token-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,30 +138,55 @@ jobs:
- ArbTokenLists/660279_arbed_uniswap_labs.json
version: true
command: yarn arbify --l2NetworkID 660279 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/660279_arbed_uniswap_labs.json --tokenList https://tokenlist.arbitrum.io/ArbTokenLists/arbed_uniswap_labs.json --newArbifiedList ./src/ArbTokenLists/660279_arbed_uniswap_labs.json
- name: Xai Arbify L2 native list
paths:
- ArbTokenLists/660279_arbed_native_list.json
version: true
command: yarn arbify --l2NetworkID 660279 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/660279_arbed_native_list.json --tokenList ./src/Assets/42161_arbitrum_native_token_list.json --newArbifiedList ./src/ArbTokenLists/660279_arbed_native_list.json

- name: Rari Arbify Uniswap
paths:
- ArbTokenLists/1380012617_arbed_uniswap_labs.json
version: true
command: yarn arbify --l2NetworkID 1380012617 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/1380012617_arbed_uniswap_labs.json --tokenList https://tokenlist.arbitrum.io/ArbTokenLists/arbed_uniswap_labs.json --newArbifiedList ./src/ArbTokenLists/1380012617_arbed_uniswap_labs.json
- name: Rari Arbify L2 native list
paths:
- ArbTokenLists/1380012617_arbed_native_list.json
version: true
command: yarn arbify --l2NetworkID 1380012617 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/1380012617_arbed_native_list.json --tokenList ./src/Assets/42161_arbitrum_native_token_list.json --newArbifiedList ./src/ArbTokenLists/1380012617_arbed_native_list.json

- name: Muster Arbify Uniswap
paths:
- ArbTokenLists/4078_arbed_uniswap_labs.json
version: true
command: yarn arbify --l2NetworkID 4078 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/4078_arbed_uniswap_labs.json --tokenList https://tokenlist.arbitrum.io/ArbTokenLists/arbed_uniswap_labs.json --newArbifiedList ./src/ArbTokenLists/4078_arbed_uniswap_labs.json
- name: Muster Arbify L2 native list
paths:
- ArbTokenLists/4078_arbed_native_list.json
version: true
command: yarn arbify --l2NetworkID 4078 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/4078_arbed_native_list.json --tokenList ./src/Assets/42161_arbitrum_native_token_list.json --newArbifiedList ./src/ArbTokenLists/4078_arbed_native_list.json

- name: Proof of Play Apex Arbify Uniswap
paths:
- ArbTokenLists/70700_arbed_uniswap_labs.json
version: true
command: yarn arbify --l2NetworkID 70700 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/70700_arbed_uniswap_labs.json --tokenList https://tokenlist.arbitrum.io/ArbTokenLists/arbed_uniswap_labs.json --newArbifiedList ./src/ArbTokenLists/70700_arbed_uniswap_labs.json
- name: Proof of Play Apex Arbify L2 native list
paths:
- ArbTokenLists/70700_arbed_native_list.json
version: true
command: yarn arbify --l2NetworkID 70700 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/70700_arbed_native_list.json --tokenList ./src/Assets/42161_arbitrum_native_token_list.json --newArbifiedList ./src/ArbTokenLists/70700_arbed_native_list.json

- name: L3X Arbify Uniswap
paths:
- ArbTokenLists/12324_arbed_uniswap_labs.json
version: true
command: yarn arbify --l2NetworkID 12324 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/12324_arbed_uniswap_labs.json --tokenList https://tokenlist.arbitrum.io/ArbTokenLists/arbed_uniswap_labs.json --newArbifiedList ./src/ArbTokenLists/12324_arbed_uniswap_labs.json
- name: L3X Arbify L2 native list
paths:
- ArbTokenLists/12324_arbed_native_list.json
version: true
command: yarn arbify --l2NetworkID 12324 --prevArbifiedList https://tokenlist.arbitrum.io/ArbTokenLists/12324_arbed_native_list.json --tokenList ./src/Assets/42161_arbitrum_native_token_list.json --newArbifiedList ./src/ArbTokenLists/12324_arbed_native_list.json

# Orbit Chains testnet
- name: Xai Testnet Arbify Uniswap
Expand Down
36 changes: 36 additions & 0 deletions src/Assets/42161_arbitrum_native_token_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "Arb1 Tokens by Offchain Labs",
"timestamp": "2024-05-29T09:32:20.831Z",
"version": {
"major": 1,
"minor": 0,
"patch": 0
},
"tokens": [
{
"chainId": 42161,
"address": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/assets/0xaf88d065e77c8cC2239327C5EDb3A432268e5831/logo.png"
},
{
"chainId": 42161,
"address": "0x2416092f143378750bb29b79ed961ab195cceea5",
"name": "Renzo Restaked ETH",
"symbol": "ezETH",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xbf5495Efe5DB9ce00f80364C8B423567e58d2110/logo.png"
},
{
"chainId": 42161,
"address": "0x4186BFC76E2E237523CBC30FD220FE055156b41F",
"name": "KelpDao Restaked ETH",
"symbol": "rsETH",
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/33800/large/Icon___Dark.png"
}
],
"logoURI": "https://avatars.githubusercontent.com/u/43838009"
}
2 changes: 1 addition & 1 deletion src/lib/token_list_gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export const generateTokenList = async (
name:
options && options.preserveListName
? name
: listNameToArbifiedListName(name),
: listNameToArbifiedListName(name, l2.network.chainID),
timestamp: new Date().toISOString(),
version,
tokens: arbifiedTokenList,
Expand Down
9 changes: 7 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,19 @@ for (const address of Object.keys(logoUris)) {
logoUris[address.toLowerCase()] = logoUris[address];
}

export const listNameToArbifiedListName = (name: string) => {
export const listNameToArbifiedListName = (
name: string,
childChainId: number,
) => {
const prefix = 'Arbed ';

let fileName = sanitizeNameString(name);
if (!fileName.startsWith(prefix)) {
fileName = prefix + fileName;
}
return fileName.split(' ').slice(0, 2).join(' ').slice(0, 20);

const baseName = fileName.split(' ').slice(0, 3).join(' ').slice(0, 20);
return `${baseName} ${childChainId}`;
};

export const getL1TokenAndL2Gateway = async (
Expand Down
Loading