Skip to content
Open
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: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/1-addTokenForm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ body:
- POLYGON
- AVALANCHE
- BNB
- LENS
- LINEA
- PLASMA
- INK
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/2-addImageForm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ body:
- POLYGON
- AVALANCHE
- BNB
- LENS
- LINEA
- PLASMA
- INK
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/3-removeTokenForm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ body:
- POLYGON
- AVALANCHE
- BNB
- LENS
- LINEA
- PLASMA
- INK
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
validate:
name: Validate list schema
name: Check TS & validate list schema & tests
runs-on: ubuntu-latest

steps:
Expand All @@ -24,8 +24,14 @@ jobs:
with:
authToken: ${{ secrets.PACKAGE_READ_AUTH_TOKEN }}

- name: Run validation
run: yarn validate
- name: Run validation schema
run: yarn validate:schema

- name: Run validation chains
run: yarn validate:chains

- name: TypeScript check
run: yarn typecheck
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added this here.


- name: Run tests
run: yarn test
7 changes: 5 additions & 2 deletions .github/workflows/executeAction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ jobs:
OPERATION: ${{ inputs.operation }}

# Validation steps
- name: Validate
run: yarn validate
- name: Validate schema
run: yarn validate:schema

- name: Validate chains
run: yarn validate:chains

# Passed validation
- name: Create Pull Request
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/updatePermitInfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false # continue parallel jobs even if individual parts fail
matrix:
chainId: [ 1, 56, 100, 137, 232, 8453, 9745, 42161, 43114, 57073, 59144 ] # all supported chains
chainId: [ 1, 56, 100, 137, 8453, 9745, 42161, 43114, 57073, 59144 ] # all supported chains

steps:
- name: Checkout code
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ The script generates token list files in `src/public/` for the following network
- Base (CoinGecko.8453.json, Uniswap.8453.json)
- BNB (CoinGecko.56.json, Uniswap.56.json)
- Gnosis Chain (CoinGecko.100.json, Uniswap.100.json)
- Lens (CoinGecko.232.json, Uniswap.232.json)
- Linea (CoinGecko.59144.json, Uniswap.59144.json)
- Plasma (CoinGecko.9745.json, Uniswap.9745.json)
- Ink (CoinGecko.57073.json, Uniswap.57073.json)
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"cowAmmTokenLists": "yarn run-script src/scripts/lp-tokens/generateCowAmmTokenList.ts",
"public": "copyfiles src/public/*.json build/lists -f",
"workflowHelper": "python3 src/scripts/workflow_helper.py",
"validate": "ajv -s node_modules/@uniswap/token-lists/dist/tokenlist.schema.json -d src/public/CowSwap.json -c ajv-formats --errors text",
"validate:schema": "ajv -s node_modules/@uniswap/token-lists/dist/tokenlist.schema.json -d src/public/CowSwap.json -c ajv-formats --errors text",
"validate:chains": "yarn run-script src/scripts/validateSupportedChains.ts",
"fetchAllPermitInfo": "yarn run-script src/permitInfo/fetchAllPermitInfo.ts",
"fetchPermitInfo": "yarn run-script src/permitInfo/fetchPermitInfoByChain.ts",
"fetchPermitInfo:mainnet": "yarn run fetchPermitInfo -- 1",
Expand All @@ -29,7 +30,6 @@
"fetchPermitInfo:avalanche": "yarn run fetchPermitInfo -- 43114",
"fetchPermitInfo:polygon": "yarn run fetchPermitInfo -- 137",
"fetchPermitInfo:bnb": "yarn run fetchPermitInfo -- 56",
"fetchPermitInfo:lens": "yarn run fetchPermitInfo -- 232",
"fetchPermitInfo:linea": "yarn run fetchPermitInfo -- 59144",
"fetchPermitInfo:plasma": "yarn run fetchPermitInfo -- 9745",
"fetchPermitInfo:ink": "yarn run fetchPermitInfo -- 57073",
Expand All @@ -41,16 +41,16 @@
"recheckPermitInfo:avalanche": "yarn run fetchPermitInfo -- 43114 '' '' true",
"recheckPermitInfo:polygon": "yarn run fetchPermitInfo -- 137 '' '' true",
"recheckPermitInfo:bnb": "yarn run fetchPermitInfo -- 56 '' '' true",
"recheckPermitInfo:lens": "yarn run fetchPermitInfo -- 232 '' '' true",
"recheckPermitInfo:linea": "yarn run fetchPermitInfo -- 59144 '' '' true",
"recheckPermitInfo:plasma": "yarn run fetchPermitInfo -- 9745 '' '' true",
"recheckPermitInfo:ink": "yarn run fetchPermitInfo -- 57073 '' '' true",
"run-script": "node --loader ts-node/esm --experimental-json-modules --experimental-specifier-resolution=node",
"typecheck": "tsc --noEmit",
"test": "node --test"
},
"license": "(MIT OR Apache-2.0)",
"dependencies": {
"@cowprotocol/cow-sdk": "7.3.1",
"@cowprotocol/cow-sdk": "8.0.0",
"@cowprotocol/permit-utils": "^0.7.0-RC.1",
"@uniswap/token-lists": "^1.0.0-beta.33",
"ajv": "^8.17.1",
Expand All @@ -71,4 +71,4 @@
"prettier": "^3.0.3",
"typescript": "^5.2.2"
}
}
}
1 change: 0 additions & 1 deletion scripts/processRequest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const NETWORK_CONFIG = {
AVALANCHE: { chainId: 43114, blockExplorer: 'snowscan.xyz' },
POLYGON: { chainId: 137, blockExplorer: 'polygonscan.com' },
BNB: { chainId: 56, blockExplorer: 'bscscan.com' },
LENS: { chainId: 232, blockExplorer: 'explorer.lens.xyz' },
GNOSIS_CHAIN: { chainId: 100, blockExplorer: 'gnosisscan.io' },
LINEA: { chainId: 59144, blockExplorer: 'lineascan.build' },
PLASMA: { chainId: 9745, blockExplorer: 'plasmascan.to' },
Expand Down
1 change: 0 additions & 1 deletion src/permitInfo/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const DEFAULT_RPC_URLS: Record<SupportedChainId, string> = {
[SupportedChainId.AVALANCHE]: 'https://api.avax.network/ext/bc/C/rpc',
[SupportedChainId.POLYGON]: 'https://polygon-rpc.com',
[SupportedChainId.BNB]: 'https://bsc-dataseed.binance.org',
[SupportedChainId.LENS]: 'https://rpc.lens.xyz',
[SupportedChainId.LINEA]: 'https://rpc.linea.build',
[SupportedChainId.PLASMA]: 'https://rpc.plasma.to',
[SupportedChainId.INK]: 'https://rpc-ten.inkonchain.com',
Expand Down
47 changes: 0 additions & 47 deletions src/public/CoinGecko.232.json

This file was deleted.

16 changes: 0 additions & 16 deletions src/public/CowSwap.json
Original file line number Diff line number Diff line change
Expand Up @@ -1782,22 +1782,6 @@
"chainId": 137,
"logoURI": "https://files.cow.fi/token-lists/images/137/0xc2132d05d31c914a87c6611c10748aeb04b58e8f/logo.png"
},
{
"address": "0x6bdc36e20d267ff0dd6097799f82e78907105e2f",
"symbol": "WGHO",
"name": "Wrapped GHO Token",
"decimals": 18,
"chainId": 232,
"logoURI": "https://files.cow.fi/token-lists/images/232/0x6bdc36e20d267ff0dd6097799f82e78907105e2f/logo.png"
},
{
"address": "0xe5ecd226b3032910ceaa43ba92ee8232f8237553",
"symbol": "WETH",
"name": "Lens Bridged WETH",
"decimals": 18,
"chainId": 232,
"logoURI": "https://files.cow.fi/token-lists/images/232/0xe5ecd226b3032910ceaa43ba92ee8232f8237553/logo.png"
},
{
"address": "0x0000000f2eb9f69274678c76222b35eec7588a65",
"symbol": "yoUSD",
Expand Down
24 changes: 0 additions & 24 deletions src/public/PermitInfo.232.json

This file was deleted.

23 changes: 0 additions & 23 deletions src/public/Uniswap.232.json

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions src/scripts/auxLists/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const COINGECKO_CHAINS: Record<SupportedChainId, string | null> = {
[SupportedChainId.POLYGON]: 'polygon-pos',
[SupportedChainId.AVALANCHE]: 'avalanche',
[SupportedChainId.BNB]: 'binance-smart-chain',
[SupportedChainId.LENS]: 'lens',
[SupportedChainId.LINEA]: 'linea',
[SupportedChainId.PLASMA]: 'plasma',
[SupportedChainId.INK]: 'ink',
Expand All @@ -52,7 +51,6 @@ export const DISPLAY_CHAIN_NAMES: Record<SupportedChainId, string | null> = {
[SupportedChainId.POLYGON]: 'Polygon',
[SupportedChainId.AVALANCHE]: 'Avalanche',
[SupportedChainId.BNB]: 'BNB',
[SupportedChainId.LENS]: 'Lens',
[SupportedChainId.LINEA]: 'Linea',
[SupportedChainId.PLASMA]: 'Plasma',
[SupportedChainId.INK]: 'Ink',
Expand Down
36 changes: 36 additions & 0 deletions src/scripts/validateSupportedChains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { exit, cwd } from 'node:process'
import { ALL_CHAINS_IDS } from '@cowprotocol/cow-sdk'

const COWSWAP_JSON_PATH = join(cwd(), 'src', 'public', 'CowSwap.json')

interface TokenEntry {
address: string
symbol?: string
name?: string
chainId: number
}

interface TokenList {
tokens: TokenEntry[]
}

function main(): void {
const supportedChainIds = new Set(ALL_CHAINS_IDS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that ALL_CHAINS_IDS contains also chains that are not supported, such as Optimism, Bitcoin and Solana

https://github.com/cowprotocol/cow-sdk/blob/5f7ecfba74abc721b80c5fe6f4997f9518c40788/packages/config/src/chains/const/chainIds.ts#L63-L90

Is that intentional?

const list: TokenList = JSON.parse(readFileSync(COWSWAP_JSON_PATH, 'utf-8'))
const invalid = list.tokens.filter((token) => !supportedChainIds.has(token.chainId))

if (invalid.length === 0) {
console.log('All tokens in CowSwap.json use supported chain IDs.')
exit(0)
}

console.error(
`CowSwap.json contains ${invalid.length} token(s) with unsupported chainId:\n${invalid.map((t) => `- ${t.chainId}: ${t.symbol ?? '?'} (${t.address})`).join('\n')}`,
)

exit(1)
}

main()
Loading
Loading