Skip to content

Conversation

@alfetopito
Copy link
Collaborator

@alfetopito alfetopito commented Jul 21, 2025

Summary

Add to lens and bnb:

  • Permit info
  • Coingecko lists
  • Uniswap list (for bnb only)

Summary by CodeRabbit

  • New Features

    • Added support for Binance Smart Chain (BNB) and Lens networks, including new token lists and permit info for both.
    • Introduced new scripts to fetch and recheck permit information for BNB and Lens networks.
    • Updated display names and CoinGecko identifiers for BNB and Lens.
  • Dependency Updates

    • Upgraded the @cowprotocol/cow-sdk dependency to a newer version for enhanced network compatibility.
  • Data Updates

    • Added comprehensive token lists and permit information for BNB and Lens networks to improve asset coverage.

@alfetopito alfetopito self-assigned this Jul 21, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3f2391b and f6521a7.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • .github/workflows/updatePermitInfo.yml (1 hunks)
  • README.md (1 hunks)
  • package.json (3 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)

Walkthrough

This 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

Files / Areas Change Summary
package.json Added scripts for BNB and Lens to fetch/recheck permit info; upgraded @cowprotocol/cow-sdk version.
src/permitInfo/const.ts Added DEFAULT_RPC_URLS entries for BNB and Lens.
src/permitInfo/utils/getTokensFromTokenList.ts Refactored token list mapping to use mapSupportedNetworks; removed explicit Polygon and Avalanche entries.
src/scripts/auxLists/utils.ts Added BNB and Lens to COINGECKO_CHAINS and DISPLAY_CHAIN_NAMES mappings.
src/public/CoinGecko.232.json Added new token list JSON for Lens (chainId 232) with four tokens.
src/public/PermitInfo.232.json Added permit info JSON for Lens; marks one token as unsupported.
src/public/PermitInfo.56.json Added permit info JSON for BNB; marks one token as unsupported.
src/public/Uniswap.56.json Added comprehensive Uniswap token list JSON for BNB (chainId 56), including bridge info and metadata.
.github/workflows/updatePermitInfo.yml Extended matrix to include chain IDs 56 and 232 for permit info update workflow.
README.md Updated documentation to include Avalanche, Lens, and BNB networks in token list generation script output.

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
Loading

Estimated code review effort

2 (10–30 minutes)

Suggested reviewers

  • shoom3301

Poem

In a warren of code, new networks appear,
BNB and Lens now hop in with cheer.
Token lists sprout, permit files bloom,
The SDK’s fresh—there’s plenty of room!
With every new chain, our garden expands,
Hopping through blockchains, with carrots in hand. 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/lens-bnb

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@alfetopito alfetopito requested a review from a team July 21, 2025 10:20
@socket-security
Copy link

socket-security bot commented Jul 21, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​cowprotocol/​app-data@​3.1.0 ⏵ 3.3.083 +2100100 +194100
Updated@​cowprotocol/​cow-sdk@​6.0.0-RC.63 ⏵ 6.2.0-lens-bsc.083 +11009899 +1100

View full report

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 consistency

All 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 duplication

The fetchPermitInfo:* and recheckPermitInfo:* 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 hits

The static-analysis report is flagging hundreds of “generic API keys” – it’s actually tripping on lowercase BSC/Ethereum addresses.
Running our scripts/utils/checksumAddresses.ts (or npx @cowprotocol/token-lists checksum <file>) will:

  1. Convert all address and extensions.bridgeInfo.*.tokenAddress values to EIP-55 checksum.
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between f2a0241 and f5956bd.

⛔ Files ignored due to path filters (1)
  • yarn.lock is 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 mapSupportedNetworks supports 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.org is the official Binance Smart Chain RPC
  • https://rpc.lens.xyz is the correct Lens protocol RPC endpoint

These 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 version

Using a caret with a pre-release tag (^6.1.0-lens-bsc.2) lets npm float to 6.1.1 once published, which may drop the lens-bsc patches 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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_LISTS always includes Uniswap.${{ matrix.chainId }}.json, but Lens (232) has no Uniswap source.
Although the subsequent -f check skips nonexistent files, building the string for unsupported chains is unnecessary noise and makes the intent harder to follow.
Consider setting TOKEN_LISTS conditionally (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

📥 Commits

Reviewing files that changed from the base of the PR and between f5956bd and 3f2391b.

📒 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 expects RPC_URL_56 and RPC_URL_232 repository secrets. Missing secrets will cause silent job failures (the step executes but RPC_URL is empty, so yarn fetchPermitInfo will hang or exit with ENOTFOUND).
Please verify that both secrets are defined before merging.

@alfetopito alfetopito merged commit 4b55d5b into main Aug 12, 2025
7 checks passed
@alfetopito alfetopito deleted the feat/lens-bnb branch August 12, 2025 10:06
@github-actions github-actions bot locked and limited conversation to collaborators Aug 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants