-
Notifications
You must be signed in to change notification settings - Fork 29
feat(new-networks): add lens and bnb permit and aux lists support #1033
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
Conversation
|
Warning Rate limit exceeded@alfetopito has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 54 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
WalkthroughThis change adds support for Binance Smart Chain (BNB, chainId 56) and Lens (chainId 232) networks. It updates package scripts, constants, and utility mappings, introduces new token list and permit info JSON files for these networks, and upgrades the @cowprotocol/cow-sdk dependency to a newer version. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Scripts as NPM Scripts
participant PermitFetcher as fetchPermitInfo Script
participant Network as BNB/Lens Network
Dev->>Scripts: Run fetchPermitInfo:bnb or fetchPermitInfo:lens
Scripts->>PermitFetcher: Execute fetchPermitInfo with chainId 56 or 232
PermitFetcher->>Network: Connect using DEFAULT_RPC_URLS
PermitFetcher->>PermitFetcher: Fetch tokens from token list JSON
PermitFetcher->>PermitFetcher: Read permit info JSON
PermitFetcher->>Dev: Output permit info for BNB/Lens
Estimated code review effort2 (10–30 minutes) Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/public/CoinGecko.232.json (1)
12-42: Consider EIP-55 checksummed addresses for consistencyAll addresses are fully lowercase. While valid, the rest of our token lists follow the EIP-55 checksum convention, which helps tooling catch typos. Converting the four addresses here will keep the corpus homogeneous.
Example:- "address": "0x88f08e304ec4f90d644cec3fb69b8ad414acf884" + "address": "0x88F08E304Ec4F90d644cEc3fB69b8aD414aCf884"package.json (1)
31-33: Group new chain scripts together & avoid duplicationThe
fetchPermitInfo:*andrecheckPermitInfo:*blocks are now split by unrelated entries, hurting discoverability."fetchPermitInfo:polygon": "yarn run fetchPermitInfo -- 137", - "fetchPermitInfo:bnb": "yarn run fetchPermitInfo -- 56", - "fetchPermitInfo:lens": "yarn run fetchPermitInfo -- 232", + "fetchPermitInfo:bnb": "yarn run fetchPermitInfo -- 56", + "fetchPermitInfo:lens": "yarn run fetchPermitInfo -- 232", "run-script": "node --loader ts-node/esm --experimental-json-modules --experimental-specifier-resolution=node", - "recheckPermitInfo:bnb": "yarn run fetchPermitInfo -- 56 '' '' true", - "recheckPermitInfo:lens": "yarn run fetchPermitInfo -- 232 '' '' true", + "recheckPermitInfo:bnb": "yarn run fetchPermitInfo -- 56 '' '' true", + "recheckPermitInfo:lens": "yarn run fetchPermitInfo -- 232 '' '' true",Keeping all permit-scripts contiguous (or alphabetically sorted) makes grepping & future edits easier.
Also applies to: 41-42
src/public/Uniswap.56.json (1)
10-1250: Normalise token addresses to checksum & silence false Gitleaks hitsThe static-analysis report is flagging hundreds of “generic API keys” – it’s actually tripping on lowercase BSC/Ethereum addresses.
Running ourscripts/utils/checksumAddresses.ts(ornpx @cowprotocol/token-lists checksum <file>) will:
- Convert all
addressandextensions.bridgeInfo.*.tokenAddressvalues to EIP-55 checksum.- Remove the incidental Gitleaks noise.
Doing so improves human readability and prevents subtle mismatches in dApp UIs that expect checksummed strings.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (8)
package.json(2 hunks)src/permitInfo/const.ts(1 hunks)src/permitInfo/utils/getTokensFromTokenList.ts(1 hunks)src/public/CoinGecko.232.json(1 hunks)src/public/PermitInfo.232.json(1 hunks)src/public/PermitInfo.56.json(1 hunks)src/public/Uniswap.56.json(1 hunks)src/scripts/auxLists/utils.ts(2 hunks)
🧰 Additional context used
🪛 Gitleaks (8.27.2)
src/public/Uniswap.56.json
36-36: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
51-51: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
66-66: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
81-81: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
96-96: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
111-111: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
126-126: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
141-141: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
156-156: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
171-171: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
186-186: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
201-201: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
216-216: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
231-231: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
246-246: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
261-261: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
276-276: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
291-291: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
306-306: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
321-321: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
336-336: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
351-351: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
366-366: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
381-381: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
396-396: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
411-411: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
426-426: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
441-441: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
456-456: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
471-471: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
486-486: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
501-501: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
516-516: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
531-531: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
546-546: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
561-561: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
576-576: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
591-591: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
606-606: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
621-621: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
636-636: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
651-651: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
666-666: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
681-681: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
696-696: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
711-711: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
726-726: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
741-741: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
756-756: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
771-771: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
786-786: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
801-801: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
816-816: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
831-831: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
846-846: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
861-861: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
876-876: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
891-891: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
906-906: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
921-921: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
936-936: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
951-951: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
966-966: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
981-981: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
996-996: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1011-1011: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1026-1026: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1041-1041: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1056-1056: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1079-1079: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1094-1094: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
1109-1109: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🔇 Additional comments (7)
src/public/PermitInfo.232.json (1)
1-6: LGTM! Well-structured permit info for Lens network.The JSON structure is valid and correctly defines permit information for the Wrapped Gho Token on the Lens network. The token is appropriately marked as "unsupported" for EIP-2612 permits.
src/public/PermitInfo.56.json (1)
1-6: LGTM! Correct permit info structure for BNB network.The JSON structure is valid and properly defines permit information for the Wrapped BNB token. The "unsupported" classification for EIP-2612 permits is appropriate.
src/permitInfo/utils/getTokensFromTokenList.ts (2)
1-1: Good addition of mapSupportedNetworks import.The import of
mapSupportedNetworkssupports the refactoring to use a more maintainable approach for mapping networks to token lists.
8-8: Excellent refactoring to use mapSupportedNetworks.Replacing explicit network mappings with
...mapSupportedNetworks('CowSwap.json')is a great improvement that:
- Reduces code duplication
- Makes adding new networks more maintainable
- Automatically handles supported networks without manual updates
This change perfectly supports the addition of BNB and Lens networks.
src/permitInfo/const.ts (1)
16-17: LGTM! Correct RPC URLs for new networks.The RPC endpoints for BNB and Lens networks are appropriate:
https://bsc-dataseed.binance.orgis the official Binance Smart Chain RPChttps://rpc.lens.xyzis the correct Lens protocol RPC endpointThese additions are necessary for permit info functionality on the new networks.
src/scripts/auxLists/utils.ts (1)
51-52: LGTM! Appropriate display names for new networks.The display names 'BNB' and 'Lens' are clear, concise, and consistent with the existing naming pattern in the codebase.
package.json (1)
47-47: Pin pre-release SDK to an exact versionUsing a caret with a pre-release tag (
^6.1.0-lens-bsc.2) lets npm float to6.1.1once published, which may drop thelens-bscpatches and silently change behaviour.- "@cowprotocol/cow-sdk": "^6.1.0-lens-bsc.2", + "@cowprotocol/cow-sdk": "6.1.0-lens-bsc.2",Locking the version prevents accidental upgrades; bump deliberately when a verified successor is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/updatePermitInfo.yml (1)
36-38: Avoid listing token-lists that do not exist for every chain
TOKEN_LISTSalways includesUniswap.${{ matrix.chainId }}.json, but Lens (232) has no Uniswap source.
Although the subsequent-fcheck skips nonexistent files, building the string for unsupported chains is unnecessary noise and makes the intent harder to follow.
Consider settingTOKEN_LISTSconditionally (e.g. via a matrix include/extend or environment mapping) so each chain only references existing lists.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/updatePermitInfo.yml(1 hunks)README.md(1 hunks)
🧠 Learnings (1)
📓 Common learnings
Learnt from: alfetopito
PR: cowprotocol/token-lists#1033
File: src/scripts/auxLists/utils.ts:39-40
Timestamp: 2025-07-21T15:22:30.373Z
Learning: For CoinGecko's tokens API (https://tokens.coingecko.com/), the correct identifier for BNB Smart Chain is 'binance-smart-chain', not 'bnb-smart-chain'. This identifier successfully returns token data for chain ID 56.
✅ Files skipped from review due to trivial changes (1)
- README.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: alfetopito
PR: cowprotocol/token-lists#1033
File: src/scripts/auxLists/utils.ts:39-40
Timestamp: 2025-07-21T15:22:30.373Z
Learning: For CoinGecko's tokens API (https://tokens.coingecko.com/), the correct identifier for BNB Smart Chain is 'binance-smart-chain', not 'bnb-smart-chain'. This identifier successfully returns token data for chain ID 56.
🔇 Additional comments (1)
.github/workflows/updatePermitInfo.yml (1)
17-20: Ensure RPC secrets exist for the newly-added chain IDs (56 & 232)
The workflow now expectsRPC_URL_56andRPC_URL_232repository secrets. Missing secrets will cause silent job failures (the step executes butRPC_URLis empty, soyarn fetchPermitInfowill hang or exit with ENOTFOUND).
Please verify that both secrets are defined before merging.
3f2391b to
f6521a7
Compare
Summary
Add to lens and bnb:
Summary by CodeRabbit
New Features
Dependency Updates
Data Updates