-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat(synapse-constants): chain and token updates #3320
Conversation
WalkthroughThe changes in this pull request involve updates to various constant files related to token definitions and mappings across multiple blockchain networks. New entries for the token 'WLD' have been added to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Deploying sanguine-fe with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3320 +/- ##
====================================================
+ Coverage 26.98386% 90.44834% +63.46448%
====================================================
Files 178 54 -124
Lines 11833 1026 -10807
Branches 82 82
====================================================
- Hits 3193 928 -2265
+ Misses 8357 95 -8262
+ Partials 283 3 -280
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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: 3
🧹 Outside diff range and nitpick comments (4)
packages/widget/src/constants/bridgeMap.ts (1)
31-37
: LGTM. Consider adding a comment for the WLD token.The addition of the WLD token to the Ethereum mainnet (network '1') looks good. The structure is consistent with other token entries.
Consider adding a comment above this entry to briefly describe what WLD represents (e.g., "// Worldcoin token") for better code readability and maintenance.
packages/synapse-constants/src/constants/bridgeMap.ts (2)
31-37
: Addition of WLD token looks good.The new entry for the WLD token is consistent with other token entries in the
BRIDGE_MAP
. It's correctly structured with decimals, symbol, origin, and destination fields.Consider adding a comment explaining the significance of 'RFQ.WLD' for clarity, especially if this is a new concept in the system.
889-911
: New network '480' added successfully.The addition of network '480' with entries for WLD, USDC.e, and ETH tokens is structured correctly and consistent with other network entries in the
BRIDGE_MAP
.Consider adding a comment or updating the documentation to explain what network '480' represents and why it's being added to the
BRIDGE_MAP
.packages/synapse-constants/src/constants/tokens/bridgeable.ts (1)
Line range hint
1151-1163
: Inconsistent symbol in WPOL token definitionThe
WPOL
token hassymbol
set to'WMATIC'
, butrouteSymbol
is'WPOL'
. Consider updating thesymbol
to'WPOL'
to maintain consistency.Apply this diff to fix the inconsistency:
export const WPOL = new Token({ addresses: { [CHAINS.POLYGON.id]: '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', }, decimals: 18, - symbol: 'WMATIC', + symbol: 'WPOL', name: 'WMATIC', logo: 'https://8f3ea9f2.sanguine-fe.pages.dev/_next/static/media/matic.237cd2b6.svg', swapableType: 'MATIC', color: 'blue', visibilityRank: 90, priorityRank: 3, routeSymbol: 'WPOL', })
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
- packages/synapse-constants/src/constants/bridgeMap.ts (12 hunks)
- packages/synapse-constants/src/constants/chains/master.ts (1 hunks)
- packages/synapse-constants/src/constants/tokens/bridgeable.ts (5 hunks)
- packages/widget/src/constants/bridgeMap.ts (6 hunks)
🧰 Additional context used
🔇 Additional comments (13)
packages/synapse-constants/src/constants/chains/master.ts (3)
508-532
: LGTM: WORLDCHAIN constant structure is consistent with other chain definitions.The overall structure and properties of the WORLDCHAIN constant align well with other chain definitions in the file. It includes all necessary fields and follows the established pattern.
514-515
: Ensure consistency in image URL domains.The
chainImg
andexplorerImg
URLs for WORLDCHAIN use a different domain (synapse-interface-worldchain.sanguine-fe.pages.dev) compared to other chains in the file. Consider using the same domain as other chains for consistency.#!/bin/bash # Check the domains used for chainImg and explorerImg across all chains grep -E "chainImg:|explorerImg:" packages/synapse-constants/src/constants/chains/master.tsAlso applies to: 523-524
518-519
: Consider using different URLs for primary and fallback RPC endpoints.The primary and fallback RPC URLs are currently identical. For better redundancy and fault tolerance, it's recommended to use different endpoints for the primary and fallback URLs.
packages/widget/src/constants/bridgeMap.ts (2)
465-471
: LGTM. WLD token successfully added to Optimism network.The addition of the WLD token to the Optimism network (network '10') is consistent with the Ethereum mainnet entry and follows the established structure for token entries.
889-911
: New network 480 added with WLD, USDC.e, and ETH tokens.The addition of network '480' with entries for WLD, USDC.e, and ETH tokens looks structurally correct and consistent with other network entries.
As this is a new network addition, please confirm the following:
- The network ID '480' is correct and corresponds to the intended blockchain.
- The token addresses are accurate for this network.
- The origin and destination arrays for each token are correctly specified.
✅ Verification successful
Verification Successful: Network '480' and Associated Tokens Confirmed
The addition of network '480' along with the WLD, USDC.e, and ETH tokens has been thoroughly verified and is consistent across the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for other occurrences of network 480 in the codebase echo "Searching for other occurrences of network 480:" rg "480" --type ts # Verify consistency of token addresses across the codebase echo "Verifying WLD token address:" rg "0x2cFc85d8E48F8EAB294be644d9E25C3030863003" --type ts echo "Verifying USDC.e token address:" rg "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1" --type tsLength of output: 21358
packages/synapse-constants/src/constants/bridgeMap.ts (4)
934-940
: Addition of WMetis and Metis tokens to network '1088' looks good.The new entries for WMetis and Metis tokens are structured correctly and consistent with other token entries in the
BRIDGE_MAP
. The use of 'Metis' for both origin and destination in the Metis token entry suggests it's the native token of this network.Also applies to: 969-975
1861-1890
: New network '59144' added successfully, but verify USDT configuration.The addition of network '59144' with entries for USDC, USDT, ETH, and WETH tokens is structured correctly and mostly consistent with other network entries in the
BRIDGE_MAP
.The USDT token has an empty destination array, which is different from other tokens. Please verify if this is intentional or if it needs to be updated.
Consider adding a comment or updating the documentation to explain what network '59144' represents and why it's being added to the
BRIDGE_MAP
.
1944-1973
: New network '534352' added successfully, but verify token configurations.The addition of network '534352' with entries for USDC, WETH, ETH, and USDT tokens is structured correctly and mostly consistent with other network entries in the
BRIDGE_MAP
.The WETH and USDT tokens have empty destination arrays, which is different from other tokens. Please verify if this is intentional or if these need to be updated.
Consider adding a comment or updating the documentation to explain what network '534352' represents and why it's being added to the
BRIDGE_MAP
.
687-687
: Verify the impact of changing MATIC to POL.The symbol change from 'MATIC' to 'POL' has been implemented correctly. This change appears to be related to the previous WMATIC to WPOL change, suggesting a network-wide rebranding.
Please ensure this change is consistent across the entire codebase. Run the following script to check for any remaining instances of 'MATIC':
#!/bin/bash # Description: Check for remaining instances of 'MATIC' in the codebase # Search for 'MATIC' in all files rg -i '\bMATIC\b'packages/synapse-constants/src/constants/tokens/bridgeable.ts (4)
752-752
: Addition of WORLDCHAIN to ETH token addressesThe addition of
WORLDCHAIN
to theETH
token addresses withnullAddress
appears appropriate.
915-915
: Include USDCe on WORLDCHAINThe inclusion of USDCe on
WORLDCHAIN
with the specified address looks correct.
1298-1316
: Addition of WLD tokenThe
WLD
token is correctly defined with appropriate addresses and properties.
1134-1149
:⚠️ Potential issueInconsistent symbol and name in POL token definition
The
POL
token hassymbol
andname
set to'MATIC'
, butrouteSymbol
is'POL'
. Consider updating thesymbol
andname
to'POL'
to maintain consistency.Apply this diff to fix the inconsistency:
export const POL = new Token({ addresses: { [CHAINS.POLYGON.id]: zeroAddress, }, decimals: 18, - symbol: 'MATIC', - name: 'MATIC', + symbol: 'POL', + name: 'POL', logo: 'https://8f3ea9f2.sanguine-fe.pages.dev/_next/static/media/matic.237cd2b6.svg', isNative: true, swapableType: 'MATIC',Likely invalid or redundant comment.
@@ -591,7 +605,7 @@ export const BRIDGE_MAP = { | |||
}, | |||
'0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270': { | |||
decimals: 18, | |||
symbol: 'WMATIC', | |||
symbol: 'WPOL', |
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.
💡 Codebase verification
Residual 'WMATIC' Instances Detected After Changing to 'WPOL'.
Multiple files still reference 'WMATIC', indicating the symbol change to 'WPOL' may be incomplete.
- packages/widget/src/types/index.d.ts
- packages/widget/src/index.tsx
- packages/widget/src/constants/bridgeable.ts
- packages/synapse-interface/tests/getFromTokens.test.ts
- packages/synapse-interface/tests/getToTokens.test.ts
- packages/synapse-interface/tests/fixtures/mockRoutes.ts
- packages/synapse-interface/constants/tokens/bridgeable.ts
- packages/synapse-constants/src/constants/tokens/bridgeable.ts
- packages/rest-api/src/constants/bridgeable.ts
- packages/rest-api/src/constants/tokens/bridgeable.ts
🔗 Analysis chain
Verify the intention behind changing WMATIC to WPOL.
The symbol change from 'WMATIC' to 'WPOL' for the Polygon network (137) has been noted. This could represent a significant update in token representation.
Please confirm that this change is intentional and aligns with any broader updates in the project or the Polygon ecosystem. Also, ensure that this change is reflected consistently across all relevant parts of the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining instances of 'WMATIC' in the codebase
echo "Searching for remaining 'WMATIC' instances:"
rg "WMATIC" --type ts
# Search for new 'WPOL' instances to ensure consistent implementation
echo "Searching for new 'WPOL' instances:"
rg "WPOL" --type ts
Length of output: 2258
@@ -670,7 +684,7 @@ | |||
}, | |||
'0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': { | |||
decimals: 18, | |||
symbol: 'MATIC', | |||
symbol: 'POL', |
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.
💡 Codebase verification
Incomplete symbol replacement detected.
Multiple instances of 'MATIC' remain in the codebase, which may lead to inconsistencies with the recent change to 'POL'. Please ensure that all occurrences of 'MATIC' are appropriately updated to 'POL' to maintain consistency across the project.
🔗 Analysis chain
Consistent change from MATIC to POL noted.
The symbol change from 'MATIC' to 'POL' for the native token on the Polygon network (137) is consistent with the earlier WMATIC to WPOL change.
This change further supports the notion of a broader update in token representation on Polygon. Please ensure this change is part of the same intended update as the WMATIC to WPOL change, and verify its consistency across the project.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining instances of 'MATIC' in the codebase
echo "Searching for remaining 'MATIC' instances:"
rg "MATIC" --type ts
# Search for new 'POL' instances to ensure consistent implementation
echo "Searching for new 'POL' instances:"
rg "POL" --type ts
Length of output: 21358
Script:
#!/bin/bash
# Search for any remaining instances of 'MATIC' in the codebase
echo "Searching for remaining 'MATIC' instances:"
rg "MATIC" --type ts
# Search for new 'POL' instances to ensure consistent implementation
echo "Searching for new 'POL' instances:"
rg "POL" --type ts
Length of output: 21308
@@ -591,7 +605,7 @@ export const BRIDGE_MAP = { | |||
}, | |||
'0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270': { | |||
decimals: 18, | |||
symbol: 'WMATIC', | |||
symbol: 'WPOL', |
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.
💡 Codebase verification
Residual 'WMATIC' instances found in the codebase.
The symbol 'WMATIC' is still present in multiple files and needs to be updated to 'WPOL' to ensure consistency across the project.
Affected files include, but are not limited to:
packages/widget/src/types/index.d.ts
packages/synapse-interface/constants/tokens/bridgeable.ts
packages/synapse-interface/__tests__/getToTokens.test.ts
packages/synapse-interface/__tests__/__fixtures__/mockRoutes.ts
packages/widget/src/index.tsx
packages/synapse-constants/src/constants/tokens/bridgeable.ts
packages/rest-api/src/constants/bridgeable.ts
Please update all instances of 'WMATIC' to 'WPOL' to complete the symbol change.
🔗 Analysis chain
Verify the impact of changing WMATIC to WPOL.
The symbol change from 'WMATIC' to 'WPOL' has been implemented correctly. However, this change could have wider implications across the project.
Please ensure this change is consistent across the entire codebase. Run the following script to check for any remaining instances of 'WMATIC':
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for remaining instances of 'WMATIC' in the codebase
# Search for 'WMATIC' in all files
rg -i 'WMATIC'
Length of output: 9950
Script:
#!/bin/bash
# Description: Check for remaining instances of 'WMATIC' in the codebase
# Search for 'WMATIC' in all files
rg -i '\bWMATIC\b'
Length of output: 1263
Bundle ReportChanges will increase total bundle size by 165.0kB (0.52%) ⬆️. This is within the configured threshold ✅ Detailed changes
ℹ️ *Bundle size includes cached data from a previous commit |
Chain and token updates
Summary by CodeRabbit
New Features
Bug Fixes
Improvements