Skip to content

Conversation

@alfetopito
Copy link
Collaborator

@alfetopito alfetopito commented Nov 7, 2025

Summary

Add BNB COW token.

image

To Test

  1. Connect on BNB
  2. Search for COW
  • Should show up in the list
  • Should be set as a favourite token
  1. Go to Account page
  • Should show your COW balance

Summary by CodeRabbit

Release Notes

  • New Features

    • COW token now available on BNB chain for transactions and portfolio management.
  • Updates

    • Standardized token logo handling across all supported chains for consistent visual presentation.

@alfetopito alfetopito self-assigned this Nov 7, 2025
@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
cowfi Ready Ready Preview Nov 7, 2025 2:07pm
explorer-dev Ready Ready Preview Nov 7, 2025 2:07pm
sdk-tools Ready Ready Preview Nov 7, 2025 2:07pm
swap-dev Ready Ready Preview Nov 7, 2025 2:07pm
widget-configurator Ready Ready Preview Nov 7, 2025 2:07pm
1 Skipped Deployment
Project Deployment Preview Updated (UTC)
cosmos Ignored Ignored Nov 7, 2025 2:07pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

This PR adds support for the COW token on the BNB chain by updating the contract address mapping to assign a specific address for BNB, introducing a standardized default logo URI for COW tokens, and adding the COW token to the default favorite tokens list for the BNB chain.

Changes

Cohort / File(s) Change Summary
CoW Contract Address Configuration
libs/common-const/src/common.ts
Updated COW_CONTRACT_ADDRESS mapping to assign the BNB contract address (0x5bfdaa3f7c28b9994b56135403bf1acea02595b0) instead of null.
Token Logo URI Standardization
libs/common-const/src/tokens.ts
Introduced DEFAULT_LOGO_URI constant and updated getCowTokenForChain function to use a default logoURI parameter, ensuring a standardized logo URI is always provided.
Default Favorite Tokens
libs/tokens/src/const/defaultFavoriteTokens.ts
Added import of COW_TOKEN_BNB and included it in the default favorite tokens list for the BNB chain.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the BNB contract address (0x5bfdaa3f7c28b9994b56135403bf1acea02595b0) is correct and matches the deployed contract
  • Confirm the new DEFAULT_LOGO_URI parameter change in getCowTokenForChain doesn't break existing token creation logic
  • Check that adding COW_TOKEN_BNB to favorites doesn't introduce duplicate or conflicting token entries

Possibly related issues

Possibly related PRs

Suggested reviewers

  • shoom3301
  • elena-zh
  • fairlighteth

Poem

🐰 On BNB's verdant pasture green,
COW token dances, fresh and keen,
With logo bright and address true,
The herd's preferred choice, through and through! 🌾✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(cow-token): add bnb cow' directly aligns with the main change of adding BNB COW token support.
Description check ✅ Passed The description includes Summary and To Test sections with clear testing steps, though Background section is omitted as optional.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/bnb-cow

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba4edb0 and 7b662c8.

📒 Files selected for processing (3)
  • libs/common-const/src/common.ts (1 hunks)
  • libs/common-const/src/tokens.ts (1 hunks)
  • libs/tokens/src/const/defaultFavoriteTokens.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/tokens/src/const/tokensList.json:135-167
Timestamp: 2025-07-18T08:07:55.497Z
Learning: Token lists for CoW Swap are maintained in a separate repository at https://github.com/cowprotocol/token-lists, not in the main cowswap repository. Issues related to missing token lists should be tracked in the token-lists repository.
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.
📚 Learning: 2025-05-26T12:39:29.009Z
Learnt from: cowdan
Repo: cowprotocol/cowswap PR: 5715
File: libs/common-const/src/tokens.ts:539-555
Timestamp: 2025-05-26T12:39:29.009Z
Learning: The team accepts using NATIVE_CURRENCY_ADDRESS as a temporary placeholder for COW token contract addresses on new networks (Polygon, Avalanche) until actual COW contracts are deployed.

Applied to files:

  • libs/common-const/src/common.ts
  • libs/tokens/src/const/defaultFavoriteTokens.ts
  • libs/common-const/src/tokens.ts
📚 Learning: 2025-08-05T14:27:05.023Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/wallet/src/web3-react/utils/switchChain.ts:36-38
Timestamp: 2025-08-05T14:27:05.023Z
Learning: In libs/wallet/src/web3-react/utils/switchChain.ts, the team prefers using Record<SupportedChainId, string | null> over Partial<Record<SupportedChainId, string>> for WALLET_RPC_SUGGESTION to enforce that all supported chain IDs have explicit values set, even if some might be null. This ensures compile-time completeness checking.

Applied to files:

  • libs/common-const/src/common.ts
📚 Learning: 2025-08-08T13:55:17.528Z
Learnt from: shoom3301
Repo: cowprotocol/cowswap PR: 6125
File: libs/tokens/src/state/tokens/allTokensAtom.ts:78-78
Timestamp: 2025-08-08T13:55:17.528Z
Learning: In libs/tokens/src/state/tokens/allTokensAtom.ts (TypeScript/Jotai), the team prefers to wait for token lists to initialize (listsStatesListAtom non-empty) before returning tokens. No fallback to favorites/user-added/native tokens should be used when listsStatesList is empty.

Applied to files:

  • libs/tokens/src/const/defaultFavoriteTokens.ts
📚 Learning: 2025-07-18T08:07:55.497Z
Learnt from: alfetopito
Repo: cowprotocol/cowswap PR: 5992
File: libs/tokens/src/const/tokensList.json:135-167
Timestamp: 2025-07-18T08:07:55.497Z
Learning: Token lists for CoW Swap are maintained in a separate repository at https://github.com/cowprotocol/token-lists, not in the main cowswap repository. Issues related to missing token lists should be tracked in the token-lists repository.

Applied to files:

  • libs/tokens/src/const/defaultFavoriteTokens.ts
  • libs/common-const/src/tokens.ts
📚 Learning: 2025-09-19T11:38:59.206Z
Learnt from: fairlighteth
Repo: cowprotocol/cowswap PR: 6232
File: apps/cowswap-frontend/src/modules/tokensList/pure/ChainsSelector/index.tsx:199-200
Timestamp: 2025-09-19T11:38:59.206Z
Learning: The makeBuildClickEvent function in apps/cowswap-frontend/src/modules/tokensList/pure/ChainsSelector/index.tsx takes five parameters: defaultChainId, contextLabel, mode, isSwapMode, and chainsCount. The chainsCount parameter is used to determine the CrossChain flag in analytics events.

Applied to files:

  • libs/common-const/src/tokens.ts
🧬 Code graph analysis (2)
libs/tokens/src/const/defaultFavoriteTokens.ts (1)
libs/common-const/src/tokens.ts (1)
  • COW_TOKEN_BNB (619-619)
libs/common-const/src/tokens.ts (3)
libs/common-const/src/cowprotocolTokenLogoUrl.ts (1)
  • cowprotocolTokenLogoUrl (5-6)
libs/common-const/src/common.ts (1)
  • COW_CONTRACT_ADDRESS (60-73)
libs/common-const/src/types.ts (1)
  • TokenWithLogo (6-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Setup
  • GitHub Check: Cypress
🔇 Additional comments (4)
libs/common-const/src/tokens.ts (2)

598-603: LGTM! Clean standardization of token logo.

The introduction of DEFAULT_LOGO_URI and the default parameter in getCowTokenForChain ensures consistent branding across all chains while maintaining flexibility to override when needed.


619-619: LGTM! Correctly creates BNB COW token.

The token creation follows the established pattern and integrates properly with the updated COW_CONTRACT_ADDRESS mapping.

libs/tokens/src/const/defaultFavoriteTokens.ts (2)

8-8: LGTM! Correct import.

The import of COW_TOKEN_BNB is properly added and will enable including the token in BNB's default favorites.


123-123: LGTM! COW token added to BNB favorites.

This correctly adds the COW token to the default favorite tokens list for the BNB chain, meeting the PR objective to have COW set as a favorite token on BNB.

Copy link
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

LGTM!
But still cannot be traded :(

@alfetopito
Copy link
Collaborator Author

LGTM! But still cannot be traded :(

Yeah. Wondering if we should wait for it to have liquidity before this change is merged

@alfetopito alfetopito added the On_hold There's unresolved blockers. label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

On_hold There's unresolved blockers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants