Skip to content

Conversation

@ameeshaagrawal
Copy link
Contributor

@ameeshaagrawal ameeshaagrawal commented Oct 30, 2025

Summary by CodeRabbit

  • Refactor
    • Updated Polygon network token references to align with the current ecosystem token standard across mainnet and testnet environments.

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Walkthrough

Polygon chain mappings updated to reference a new native token enum value. Added polygon-ecosystem-token member to the NativeTokens enum, then updated POLYGON_MAINNET and POLYGON_AMOY currency entries to use this new token reference instead of the previous mapping.

Changes

Cohort / File(s) Change Summary
Native token enum expansion
src/enums/native-tokens.ts
Added new enum member "polygon-ecosystem-token" to NativeTokens, positioned between "matic-network" and "binancecoin".
Polygon chain mappings
src/enums/currency.ts
Updated POLYGON_MAINNET and POLYGON_AMOY currency entries to map to NativeTokens["polygon-ecosystem-token"] instead of NativeTokens["matic-network"].

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward enum member addition with consistent reference updates across two identical chain mappings.

Poem

Polygons bloom in fresh new light,
A token reborn, ecosystem bright,
Where MAINNET and AMOY now convene,
Under one verdant banner supreme. 🟣✨

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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: update polygon native" is directly related to the actual changes in the pull request. The PR updates Polygon chain mappings to reference a new "polygon-ecosystem-token" enum member instead of "matic-network", and adds the corresponding new token enum. The title uses specific domain terms ("polygon" and "native") that accurately reference the core change. However, the title is incomplete and could better convey the scope—it doesn't specify that mappings are being updated or that a new token is being introduced.
✨ 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 fix/polygon-native

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dac283c and d6ccaaa.

📒 Files selected for processing (2)
  • src/enums/currency.ts (2 hunks)
  • src/enums/native-tokens.ts (1 hunks)
🔇 Additional comments (2)
src/enums/currency.ts (1)

6-6: This is a real breaking change—verify downstream dependencies beyond the codebase.

Both Polygon entries (POLYGON_MAINNET at line 6, POLYGON_AMOY at line 19) have been updated to use "polygon-ecosystem-token" instead of "matic-network". The old enum value still exists in NativeTokens, but the getCurrency() function will now return the new token ID for these chains.

The codebase search found no internal usage patterns that depend on the old token ID, and the old enum value wasn't removed. However, this doesn't mean there's no risk—external systems like price feeds, logging, or API contracts that depend on receiving "matic-network" from getCurrency(ChainSlug.POLYGON_MAINNET) will break.

Coordinate this with any services that consume the Currency mapping and document the migration path.

src/enums/native-tokens.ts (1)

5-5: Verified: "polygon-ecosystem-token" is the correct CoinGecko token ID for Polygon POL.

CoinGecko's coin ID for Polygon (POL, formerly MATIC) is "polygon-ecosystem-token". The code is correct.


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

@arthcp arthcp merged commit adce691 into master Oct 30, 2025
1 of 3 checks passed
@arthcp arthcp deleted the fix/polygon-native branch October 30, 2025 20:25
@coderabbitai coderabbitai bot mentioned this pull request Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants