Skip to content
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

New Chains #3521

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

New Chains #3521

wants to merge 11 commits into from

Conversation

Defi-Moses
Copy link
Collaborator

@Defi-Moses Defi-Moses commented Feb 17, 2025

Description
A clear and concise description of the features you're adding in this pull request.

Additional context
Add any other context about the problem you're solving.

Metadata

  • Fixes #[Link to Issue]

Summary by CodeRabbit

  • New Features

    • Expanded support to include two additional blockchain networks: UNICHAIN and BERACHAIN, enhancing RFQ operations and transaction performance.
    • Improved token interoperability with updated mappings for USDC, ETH, and WETH, ensuring accurate representation across multiple chains.
    • Added new entries for USDC and WETH to support UNICHAIN and BERACHAIN.
  • Chores

    • Removed outdated RPC endpoint configurations to streamline the application.

Copy link
Contributor

coderabbitai bot commented Feb 17, 2025

Walkthrough

This update adds two new blockchain identifiers—UNICHAIN (130) and BERACHAIN (80094)—across multiple configuration files. The changes update chain ID enumerations, RFQ permitted chain arrays, and median transaction times. In addition, new token entries and address mappings have been added while some existing token entries have been removed or modified. The update also introduces complete chain configuration objects and revises several RPC endpoint URLs in JSON configuration files, integrating the new chains consistently across the SDK, constants, and interface modules.

Changes

File(s) Change Summary
packages/sdk-router/.../chainIds.ts
packages/sdk-router/.../medianTime.ts
packages/synapse-constants/.../generateMaps.cjs
packages/synapse-interface/.../generateMaps.js
Added new enum entries UNICHAIN = 130 and BERACHAIN = 80094. Updated arrays: UNSUPPORTED_BRIDGE_CHAIN_IDS, RFQ_SUPPORTED_CHAIN_IDS, and allowedChainIdsForRfq to include the new chains.
packages/synapse-constants/.../bridgeMap.ts
packages/synapse-interface/.../bridgeMap.ts
Modified bridge mappings: new token entries (e.g., ETH), removal of BNB/WBNB entries, introduction of a new section under key 130, and updating the USDT symbol to USD₮0.
packages/synapse-constants/.../chains/master.ts
packages/synapse-interface/.../chains/extraWagmiChains.ts
packages/synapse-interface/.../chains/index.tsx
packages/synapse-interface/.../chains/master.tsx
packages/synapse-interface/.../chains/supportedChains.ts
Introduced full chain configuration objects for UNICHAIN and BERACHAIN, including RPC URLs, explorer details, native currency settings, and integration within the supported chains list.
packages/synapse-constants/.../tokens/bridgeable.ts
packages/synapse-interface/.../tokens/bridgeable.ts
Extended token definitions by adding new blockchain addresses for tokens such as USDC, ETH, and USDC.e, and updated the WETH address for consistency with the new chains.
packages/synapse-interface/.../data/providers.json Removed the JSON configuration file that contained various RPC endpoint URLs for different blockchain networks.

Possibly related PRs

  • feat(synapse-constants): chain and token updates #3320: The changes in the main PR are related to the addition of new chain IDs and their corresponding entries in various constants, which aligns with the updates in the retrieved PR that also involves modifications to the BRIDGE_MAP and the introduction of new tokens, including their mappings for the same chain IDs.
  • fear(widget): Adds Linea #2983: The changes in the main PR, which involve adding new entries for UNICHAIN and BERACHAIN in various constants, are related to the modifications in the retrieved PR that also adds an entry for ETH in the BRIDGE_MAP, as both PRs involve updates to the same bridgeMap.ts file and the handling of token entries.
  • feat(widget): add unsupported network #2860: The changes in the main PR are related to the addition of new chain IDs and their properties, which directly connects to the modifications in the retrieved PR that also involve updates to chain objects, specifically the inclusion of a nativeCurrency property for various chains.

Suggested labels

size/s, M-docs

Suggested reviewers

  • trajan0x
  • bigboydiamonds
  • abtestingalpha

Poem

I'm a rabbit, full of cheer,
Hopping through configs far and near.
New chains emerge with every beat,
Tokens and endpoints now complete.
With every update, my code leaps high—
Crunching numbers under starlit sky.
A hop, a skip—changes bring a smile!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7da787 and 68dd104.

📒 Files selected for processing (1)
  • packages/synapse-constants/src/scripts/data/symbolOverrides.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build (1.22.x)
  • GitHub Check: Deploy to Vercel (synapse-interface)
  • GitHub Check: test
  • GitHub Check: SonarCloud
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: lint
  • GitHub Check: test
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
packages/synapse-constants/src/scripts/data/symbolOverrides.json (2)

8-11: Ensure Correct Addition of the New Symbol Mapping.

The new mapping under the key "42161" correctly adds the association for "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9": "USDT". This aligns with the intended updates across the configuration for token symbols. Additionally, the JSON structure remains consistent with the existing mappings.


15-16: File-Termination Formatting Check.

The addition of a newline at the end of the file improves readability and adheres to standard formatting practices.


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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @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. (Beta)
  • @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.

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.

@github-actions github-actions bot added javascript Pull requests that update Javascript code M-synapse-interface Sol Typescript size/m labels Feb 17, 2025
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: 7

🔭 Outside diff range comments (2)
packages/synapse-interface/constants/chains/extraWagmiChains.ts (1)

534-554: ⚠️ Potential issue

Remove the exposed API key from the primary RPC URL.

The primary RPC URL contains an API key which should not be committed to the repository. This poses a security risk as the key could be misused.

Apply this diff to remove the API key:

-    primary:
-      'https://berachain-mainnet.g.alchemy.com/v2/HZ0zXJXi91qTagNP24CLIHgo6VkZ7L7n',
+    primary: 'https://berachain-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}',
packages/synapse-interface/constants/tokens/bridgeable.ts (1)

375-375: ⚠️ Potential issue

Add decimals configuration for UNICHAIN.

The USDC token address for UNICHAIN is added, but its decimals configuration is missing in the decimals mapping. This could lead to incorrect token amount calculations.

Add the following to the decimals mapping:

  decimals: {
    // ... existing entries ...
+   [CHAINS.UNICHAIN.id]: 6,
  },
🧹 Nitpick comments (1)
packages/synapse-interface/scripts/generateMaps.js (1)

45-47: Remove the trailing comma in the array.

The array has a trailing comma which might cause issues in older JavaScript environments.

Apply this diff to remove the trailing comma:

-  1, 10, 56, 130, 480, 8453, 42161, 59144, 80094, 81457, 534352,
+  1, 10, 56, 130, 480, 8453, 42161, 59144, 80094, 81457, 534352
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef66ee and cb00300.

⛔ Files ignored due to path filters (2)
  • packages/synapse-interface/assets/chains/berachain.svg is excluded by !**/*.svg
  • packages/synapse-interface/assets/chains/unichain.svg is excluded by !**/*.svg
📒 Files selected for processing (14)
  • packages/sdk-router/src/constants/chainIds.ts (4 hunks)
  • packages/sdk-router/src/constants/medianTime.ts (1 hunks)
  • packages/synapse-constants/src/constants/bridgeMap.ts (4 hunks)
  • packages/synapse-constants/src/constants/chains/master.ts (1 hunks)
  • packages/synapse-constants/src/constants/tokens/bridgeable.ts (4 hunks)
  • packages/synapse-constants/src/scripts/generateMaps.cjs (1 hunks)
  • packages/synapse-interface/constants/bridgeMap.ts (4 hunks)
  • packages/synapse-interface/constants/chains/extraWagmiChains.ts (1 hunks)
  • packages/synapse-interface/constants/chains/index.tsx (2 hunks)
  • packages/synapse-interface/constants/chains/master.tsx (2 hunks)
  • packages/synapse-interface/constants/chains/supportedChains.ts (1 hunks)
  • packages/synapse-interface/constants/tokens/bridgeable.ts (6 hunks)
  • packages/synapse-interface/scripts/data/providers.json (1 hunks)
  • packages/synapse-interface/scripts/generateMaps.js (1 hunks)
🧰 Additional context used
🪛 GitHub Check: lint
packages/sdk-router/src/constants/chainIds.ts

[warning] 37-37:
Insert ,


[warning] 84-84:
Insert ,

🪛 GitHub Actions: Typescript Packages
packages/sdk-router/src/constants/chainIds.ts

[warning] 37-37: Insert , prettier/prettier


[warning] 84-84: Insert , prettier/prettier

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Deploy to Vercel (synapse-interface)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (20)
packages/synapse-interface/constants/chains/supportedChains.ts (1)

29-30:

❓ Verification inconclusive

Consider chain priority placement.

The new chains (unichain and berachain) are placed at the top of the supportedChains array, which might affect chain priority in the UI. Consider placing them based on their priority rank to maintain consistent user experience.


🏁 Script executed:

#!/bin/bash
# Check priority ranks in master.ts
ast-grep --pattern 'export const $CHAIN = {
  $$$
  priorityRank: $_,
  $$$
}'

Length of output: 80


Verify chain priority order

The new chains (unichain and berachain) are currently placed at the top of the supportedChains array. However, since our initial check for a "priorityRank" field in the chain definitions returned no output, it is unclear if a priority-based ordering mechanism is in use. Please manually verify that the chain order (or any priority rank logic) in the repository aligns with your intended UI behavior. If a specific priority ordering is expected (for example, based on a "priorityRank" property defined elsewhere), adjust the placement of these chains accordingly to preserve consistent chain priority.

packages/synapse-interface/constants/chains/index.tsx (1)

42-42: LGTM!

The new chain IDs are correctly added and maintain consistent ordering with other chain IDs.

Also applies to: 56-56

packages/sdk-router/src/constants/chainIds.ts (1)

32-38:

❓ Verification inconclusive

Verify chain support configuration.

The new chains are configured for RFQ support but not for bridge support. Please confirm this is the intended configuration.

Also applies to: 73-85


🏁 Script executed:

#!/bin/bash
# Check if there are any bridge-related configurations for these chains
rg -A 5 "(?i)(unichain|berachain).*(bridge|rfq)"

Length of output: 50


Chain Support Configuration: Manual Verification Required

The current configuration defines the list of chains unsupported for bridge functionality (including UNICHAIN and BERACHAIN). Our automated search did not reveal any conflicting bridge or RFQ settings for these chains. Please manually verify that these chains are indeed intended to only support RFQ (and not bridge support) and that no additional configuration elsewhere contradicts this setup. Also applies to lines 73–85.

🧰 Tools
🪛 GitHub Check: lint

[warning] 37-37:
Insert ,

🪛 GitHub Actions: Typescript Packages

[warning] 37-37: Insert , prettier/prettier

packages/synapse-interface/constants/chains/extraWagmiChains.ts (2)

534-554:

❓ Verification inconclusive

Verify the multicall3 contract deployment block.

Similar to Unichain, the blockCreated value for the multicall3 contract is set to 1, which is unusually low.

Run this script to check the actual deployment block:


🏁 Script executed:

#!/bin/bash
# Description: Verify the multicall3 contract deployment block on Berachain

# Get the contract creation transaction
rg -A 5 "0xca11bde05977b3631167028862be2a173976ca11"

Length of output: 52


Action Required: Verify the multicall3 Contract Deployment Block

The current check using the provided search command produced no output, so it's unclear whether the expected deployment details for the multicall3 contract on Berachain are present. Please manually verify that the blockCreated value—currently set to 1—is correct. If this value is indeed erroneous, update it to reflect the real deployment block number.

  • Location: packages/synapse-interface/constants/chains/extraWagmiChains.ts (Lines 534–554)
  • Next Steps: Manually confirm the deployed contract’s creation block (or re-run with a refined script) to ensure the block number is accurate.

95-120:

❓ Verification inconclusive

Verify the multicall3 contract deployment block.

The blockCreated value for the multicall3 contract is set to 1, which is unusually low. This might cause unnecessary scanning of blocks during multicall operations.

Run this script to check the actual deployment block:


🏁 Script executed:

#!/bin/bash
# Description: Verify the multicall3 contract deployment block on Unichain

# Get the contract creation transaction
rg -A 5 "0xca11bde05977b3631167028862be2a173976ca11"

Length of output: 52


Attention: Verify the Multicall3 Deployment Block

The Unichain chain configuration in packages/synapse-interface/constants/chains/extraWagmiChains.ts (lines 95–120) sets the blockCreated value for the multicall3 contract to 1, which is unusually low. The automated search did not return any transaction details for the contract address. Please manually verify this value using blockchain explorer data (e.g., on Uniscan) or on-chain queries to ensure it reflects the actual deployment block. If you find a different block number, update the configuration accordingly.

packages/synapse-constants/src/scripts/generateMaps.cjs (1)

43-43: LGTM!

The addition of UNICHAIN (130) and BERACHAIN (80094) to the RFQ-supported chains is consistent with the changes in other files.

packages/synapse-interface/constants/chains/master.tsx (3)

25-26: LGTM! Image imports follow the established pattern.

The new chain image imports maintain consistency with existing imports.


677-702:

✅ Verification successful

Verify RPC endpoint availability.

The BERACHAIN configuration looks good, with appropriate chain-specific values. Let's verify the RPC endpoints are accessible.


🏁 Script executed:

#!/bin/bash
# Description: Check if RPC endpoints are accessible

# Test primary endpoint
curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  'https://berachain-mainnet.g.alchemy.com/v2/HZ0zXJXi91qTagNP24CLIHgo6VkZ7L7n'

# Test fallback endpoint
curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  'https://rpc.berachain.com'

Length of output: 1151


RPC endpoints verified – configuration approved.

The BERACHAIN chain configuration in packages/synapse-interface/constants/chains/master.tsx (lines 677-702) has been verified. Both the primary and fallback RPC endpoints responded correctly to the eth_blockNumber request, confirming their accessibility along with the correct chain-specific values. No changes are necessary.


650-675:

✅ Verification successful

Verify RPC endpoint availability.

The UNICHAIN configuration looks good, following the established pattern for L2 chains. However, let's verify the RPC endpoints are accessible.


🏁 Script executed:

#!/bin/bash
# Description: Check if RPC endpoints are accessible

# Test primary endpoint
curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  'https://unichain-mainnet.g.alchemy.com/v2/XxF21ZshhEst0phSQwyiRozKTYSxG9J7'

# Test fallback endpoint
curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  'https://mainnet.unichain.org'

Length of output: 1153


RPC Endpoints Verified: UNICHAIN configuration is approved

Both the primary and fallback RPC endpoints responded with valid JSON when queried, confirming that the endpoints are accessible and functional. The UNICHAIN configuration follows the established pattern for L2 chains, including the correct chain ID, block time, and native currency settings.

  • Verified primary endpoint: returned valid block number.
  • Verified fallback endpoint: returned valid block number.
packages/synapse-interface/constants/tokens/bridgeable.ts (2)

755-756: LGTM! ETH token configuration is correct.

  • UNICHAIN correctly uses zeroAddress as ETH is the native token.
  • BERACHAIN uses the appropriate contract address for ETH.

920-920: LGTM! USDCe token configuration is correct.

The BERACHAIN address for USDCe is properly configured and inherits the correct decimals (6) from the parent token definition.

packages/synapse-interface/constants/bridgeMap.ts (3)

591-613: LGTM! New chain configurations look good.

The new chain entries for UNICHAIN (130) and BERACHAIN (80094) are properly configured with appropriate token mappings and consistent with the bridge architecture.

Also applies to: 1907-1922


511-517: LGTM! ETH token configuration on BNB Chain is correct.

The ETH token entry on BNB Chain (56) is properly configured with:

  • Correct decimals (18)
  • Appropriate origin mapping to RFQ.ETH
  • Empty destination array as expected for wrapped tokens

1580-1581:

❓ Verification inconclusive

Verify the USDT symbol change impact.

The USDT symbol has been changed from 'USDT' to 'USD₮0' on Arbitrum. While this appears to be intentional, ensure this change:

  1. Aligns with the display requirements in the UI
  2. Won't break any string comparisons in the codebase

🏁 Script executed:

#!/bin/bash
# Search for direct USDT symbol comparisons that might break
rg -A 2 "=== 'USDT'"
rg -A 2 "=== \"USDT\""

Length of output: 51


Action Required: Manual Verification of USDT Symbol Update

The Arbitrum token symbol was updated from 'USDT' to 'USD₮0'. Automated checks using the provided script did not return any direct references to === 'USDT' comparisons. However, since the script output was inconclusive, please ensure the following:

  • Manually verify that the UI displays the new symbol correctly.
  • Confirm that no logic in the codebase relies on literal string comparisons with the value 'USDT'.
packages/synapse-constants/src/constants/bridgeMap.ts (4)

511-517: LGTM! Well-structured ETH token configuration for BSC.

The token entry is properly configured with correct decimals and origin chain specification.


591-612: LGTM! Well-structured token configurations for UNICHAIN.

The chain section includes all necessary tokens (USDC, WETH, ETH) with proper configurations for cross-chain operations.


1907-1922: LGTM! Well-structured token configurations for BERACHAIN.

The chain section includes essential tokens (WETH, USDC.e) with proper configurations for cross-chain operations.


1581-1581:

❓ Verification inconclusive

Verify the impact of USDT symbol change.

The symbol change from 'USDT' to 'USD₮0' might affect UI displays and integrations. Please ensure all UI components can properly render the Unicode character '₮'.


🏁 Script executed:

#!/bin/bash
# Search for any UI components or tests that might be affected by the USDT symbol change
rg -A 2 "USDT" --type ts --type tsx

Length of output: 63


Action: Manually verify UI impact for USDT symbol change.

The symbol update from 'USDT' to 'USD₮0' appears cosmetic, but the previous search attempt failed due to the --type tsx flag error. To ensure no UI components or tests rely on the original 'USDT' string, please verify references by searching without file type restrictions. For example, you can run:

#!/bin/bash
# Search across all files for occurrences of "USDT" to catch any potential UI or test dependencies
rg -A 2 "USDT"

Confirm that any affected components render the Unicode character '₮' correctly.

packages/synapse-interface/scripts/data/providers.json (1)

6-6:

❓ Verification inconclusive

Verify the reliability and rate limits of new RPC endpoints.

Please ensure that the new RPC endpoints for UNICHAIN and BERACHAIN:

  1. Have sufficient rate limits for production use
  2. Provide stable uptime
  3. Support all required JSON-RPC methods

Also applies to: 18-18


🏁 Script executed:

#!/bin/bash
# Test basic connectivity and eth_blockNumber support
for CHAIN in "130" "80094"; do
  URL=$(jq -r .\"$CHAIN\" providers.json)
  echo "Testing $CHAIN: $URL"
  curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' $URL
done

Length of output: 787


Action Required: Update the verification script to use the correct file path.

It appears that the initial test failed because it looked for a file named providers.json in the current directory instead of at its correct location (packages/synapse-interface/scripts/data/providers.json). Please update the verification script as follows:

  • Replace the hardcoded filename with the correct path.
  • Re-run the connectivity tests for both chain 130 (UNICHAIN) and chain 80094 (BERACHAIN).

For example, you can use the revised shell script below:

#!/bin/bash
FILE="packages/synapse-interface/scripts/data/providers.json"
if [ ! -f "$FILE" ]; then
    echo "Error: File $FILE does not exist."
else
    for CHAIN in "130" "80094"; do
      URL=$(jq -r ".[\"$CHAIN\"]" "$FILE")
      echo "Testing $CHAIN: $URL"
      curl -X POST -H "Content-Type: application/json" \
           --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' "$URL"
      echo
    done
fi

After these adjustments, please manually verify that:

  • Both endpoints have sufficient rate limits for production use.
  • They offer stable uptime.
  • They support all required JSON-RPC methods.
packages/synapse-constants/src/constants/tokens/bridgeable.ts (1)

755-756: Verify the duplicate address usage for ETH and WETH on BERACHAIN.

The same address 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590 is used for both ETH and WETH tokens on BERACHAIN. While this could be intentional, it's unusual and might lead to confusion or issues.

Please verify:

  1. Is this intentional?
  2. Should these be different addresses?
  3. Are there any implications for token swaps or bridging?

Also applies to: 1215-1215

Comment on lines 83 to 84
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix missing comma in RFQ_SUPPORTED_CHAIN_IDS array.

Add a trailing comma to maintain consistent formatting and fix the linting error.

  SupportedChainId.UNICHAIN,
- SupportedChainId.BERACHAIN
+ SupportedChainId.BERACHAIN,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN,
🧰 Tools
🪛 GitHub Check: lint

[warning] 84-84:
Insert ,

🪛 GitHub Actions: Typescript Packages

[warning] 84-84: Insert , prettier/prettier

Comment on lines 36 to 37
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix missing comma in UNSUPPORTED_BRIDGE_CHAIN_IDS array.

Add a trailing comma to maintain consistent formatting and fix the linting error.

  SupportedChainId.WORLDCHAIN,
  SupportedChainId.UNICHAIN,
- SupportedChainId.BERACHAIN
+ SupportedChainId.BERACHAIN,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN
SupportedChainId.UNICHAIN,
SupportedChainId.BERACHAIN,
🧰 Tools
🪛 GitHub Check: lint

[warning] 37-37:
Insert ,

🪛 GitHub Actions: Typescript Packages

[warning] 37-37: Insert , prettier/prettier

Copy link

cloudflare-workers-and-pages bot commented Feb 17, 2025

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 68dd104
Status: ✅  Deploy successful!
Preview URL: https://8cd65d8c.sanguine-fe.pages.dev
Branch Preview URL: https://ft-uniberainterfaces.sanguine-fe.pages.dev

View logs

@railway-app railway-app bot temporarily deployed to staging-bera-uni February 18, 2025 16:43 Inactive
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)
packages/rest-api/src/constants/bridgeMap.ts (1)

589-591: Consider updating swappable configurations for new tokens.

The new tokens on UNICHAIN and BERACHAIN have empty swappable arrays. Consider:

  1. Reviewing if any swap pairs should be enabled
  2. Adding appropriate swappable tokens if cross-chain swaps are intended

Also applies to: 596-598, 602-605

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb21574 and a686136.

📒 Files selected for processing (3)
  • packages/rest-api/src/constants/bridgeMap.ts (3 hunks)
  • packages/rest-api/src/constants/bridgeable.ts (8 hunks)
  • packages/rest-api/src/constants/chains.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Deploy to Vercel (synapse-interface)
  • GitHub Check: Build (1.22.x)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (10)
packages/rest-api/src/constants/bridgeable.ts (4)

813-814: Verify ETH configuration on UNICHAIN.

The ETH configuration for UNICHAIN uses the NativeTokenAddress constant and 18 decimals, which is consistent with other chains where ETH is the native token.

Also applies to: 828-829


1007-1008:

❓ Verification inconclusive

Verify USDC.e contract address on BERACHAIN.

The USDC.e configuration for BERACHAIN follows the standard pattern with 6 decimals, but let's verify the contract address.

Also applies to: 1016-1017


🏁 Script executed:

#!/bin/bash
# Description: Verify USDC.e contract address on BERACHAIN

# Check if the contract address exists and is verified
curl -s "https://artio.beratrail.io/api/v1/address/0x549943e04f40284185054145c6E4e9568C1D3241"

Length of output: 1014


USDC.e Contract Address Verification on BERACHAIN – Inconclusive

The API call used for verification returned a CloudFront 403 error, meaning the request was blocked. As a result, we couldn’t confirm the validity of the USDC.e contract address via the current endpoint. Please review the endpoint configuration for access issues or consider an alternative verification method (e.g., querying blockchain data directly).

  • Files & Lines:
    • packages/rest-api/src/constants/bridgeable.ts (Lines 1007-1008 and 1016-1017)
  • Action:
    • Investigate the endpoint configuration or use a different API to verify the address.

440-441:

❓ Verification inconclusive

Verify USDC contract address on UNICHAIN.

The USDC configuration for UNICHAIN follows the standard pattern with 6 decimals, but let's verify the contract address.

Also applies to: 458-459


🏁 Script executed:

#!/bin/bash
# Description: Verify USDC contract address on UNICHAIN

# Check if the contract address exists and is verified
curl -s "https://uni.network/api/v1/address/0x078d782b760474a361dda0af3839290b0ef57ad6"

Length of output: 111


Action: Verify USDC Contract Address on UNICHAIN

The USDC configuration in packages/rest-api/src/constants/bridgeable.ts (lines 440-441 and 458-459) correctly follows the established pattern (6 decimals). However, the verification script against the uni.network API returned a "Forbidden" response. This likely indicates that the endpoint requires authentication or additional permissions, so the address’s validity could not be conclusively confirmed.

  • Confirm the contract address "0x078d782b760474a361dda0af3839290b0ef57ad6" using a blockchain explorer or an authenticated API endpoint.
  • Ensure similar checks are applied consistently for all new chain configurations.

1309-1310:

❓ Verification inconclusive

Verify WETH contract address on BERACHAIN.

The WETH configuration for BERACHAIN follows the standard pattern with 18 decimals, but let's verify the contract address.

Also applies to: 1322-1323


🏁 Script executed:

#!/bin/bash
# Description: Verify WETH contract address on BERACHAIN

# Check if the contract address exists and is verified
curl -s "https://artio.beratrail.io/api/v1/address/0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590"

Length of output: 1014


Action Required: Confirm WETH Contract Address on BERACHAIN

The WETH configuration for BERACHAIN (address: 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590) seems to follow the standard pattern (18 decimals). However, our verification attempt returned a 403 error from the API endpoint, which suggests one of the following:

  • The endpoint (https://artio.beratrail.io/api/v1/address/0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590) might be misconfigured or restricted.
  • The address verification through this endpoint requires additional authentication or alternative access.

Please verify the following:

  • Confirm if the API endpoint is the correct and expected service for verifying contract addresses on BERACHAIN.
  • Ensure that the endpoint is accessible (or if additional headers/authentication are required).
  • Consider using an alternative method or source for verifying the WETH contract address if the API remains inaccessible.

This review applies to the configuration in the file at:

  • packages/rest-api/src/constants/bridgeable.ts on lines 1309–1310 and 1322–1323.
packages/rest-api/src/constants/chains.ts (4)

556-557: LGTM!

The new chains are correctly added to the CHAINS object, maintaining the established pattern and alphabetical ordering.


490-509:

✅ Verification successful

Verify Berachain RPC endpoints and block explorer.

The configuration looks good, but let's verify the RPC endpoints and block explorer are operational.


🏁 Script executed:

#!/bin/bash
# Check if the Berachain RPC endpoint and block explorer are accessible
echo "Checking Berachain RPC endpoint..."
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://rpc.berachain.com

echo "\nChecking Berachain block explorer..."
curl -I https://berascan.com

Length of output: 1988


Berachain chain configuration endpoints verified

The Berachain configuration at packages/rest-api/src/constants/chains.ts (lines 490-509) has been successfully verified. The RPC endpoint (https://rpc.berachain.com) returns the expected chain ID (0x138de, which is 80094 in decimal), and the block explorer (https://berascan.com) responds with a valid HTTP 200 status. There are no further issues with these endpoints.


511-530:

❓ Verification inconclusive

Verify Unichain RPC endpoint and block explorer.

The configuration looks good, but let's verify the RPC endpoint and block explorer are operational.


🏁 Script executed:

#!/bin/bash
# Check if the Unichain RPC endpoint and block explorer are accessible
echo "Checking Unichain RPC endpoint..."
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://unichain-rpc.publicnode.com

echo "\nChecking Unichain block explorer..."
curl -I https://uniscan.xyz

Length of output: 1996


RPC Endpoint and Explorer Verified; Confirm Unique Chain ID

  • The Unichain RPC endpoint is responsive, returning "result": "0x82" (which corresponds to the configured chain ID of 130).
  • The block explorer (https://uniscan.xyz) is operational, returning an HTTP 200 response.
  • While the endpoints are confirmed to be working, please ensure that the chain ID (130) is unique within your network configurations to avoid potential conflicts.

512-512:

✅ Verification successful

Verify chain ID uniqueness.

The chain ID 130 is unusually low for a new chain. Let's verify this doesn't conflict with any existing chains.


🌐 Web query:

Is chain ID 130 already assigned to any other blockchain network in the Chain ID registry (chainlist.org)?

💡 Result:

Chain ID 130 does not appear to be currently assigned to any blockchain network listed in the provided ChainList registry[1][4][8]. The search results include multiple EVM networks with their respective ChainIDs, such as:

ChainID Network
1 Ethereum Mainnet
56 BNB Chain
137 Polygon
8453 Base
59144 Linea

The Tenderly documentation explicitly lists supported networks like Taiko (167000), Ronin (2020), and Zora (7777777)[4], but none reference ChainID 130. Similarly, the primary ChainList data from the search results shows no entries for this identifier[1][8].

For real-time verification, users can directly consult the ChainList website[9].

Citations:


Chain ID 130 is verified as unique.
After checking the ChainList registry, chain ID 130 does not conflict with any existing blockchain networks. No further changes are needed.

packages/rest-api/src/constants/bridgeMap.ts (2)

584-606: New chain configurations look good!

The token configurations for UNICHAIN (130) and BERACHAIN (80094) follow the established patterns and include proper decimal places, symbols, and origin/destination arrays.

Also applies to: 1886-1901


1560-1560:

❓ Verification inconclusive

Verify the USDT symbol change impact.

The symbol change from 'USDT' to 'USD₮0' uses a special Unicode character (₮). Please ensure:

  1. This change is intentional and required
  2. All UI components can properly display the Unicode character
  3. No downstream systems are affected by this symbol change

🏁 Script executed:

#!/bin/bash
# Search for any UI components or tests that might be affected by the USDT symbol change
rg -l "USDT" --type ts --type tsx

Length of output: 61


USDT Symbol Change Verification

The change of the token symbol from 'USDT' to 'USD₮0' uses a special Unicode character (₮). Please ensure that:

  • The change is intentional and reflects the correct token update on chain 42161.
  • All UI components properly render the 'USD₮0' symbol without display issues.
  • No downstream systems or tests are adversely affected by this Unicode character.

After running the updated search commands above, manually verify that no unintended references or display errors exist in the UI components or related tests.


🏁 Script executed:

[run_scripts]
#!/bin/bash
# Re-run the search for occurrences of "USDT" and "USD₮0" in TypeScript and TSX files using glob patterns 
rg -l "USDT" -g "*.ts" -g "*.tsx"
rg -l "USD₮0" -g "*.ts" -g "*.tsx"

Length of output: 502


Confirm USDT Token Symbol Update on Chain 42161

The token symbol has been updated from 'USDT' to 'USD₮0' using a special Unicode character (₮). Please ensure that:

  • This change is intentional and accurately reflects the token update on chain 42161.
  • All UI components and tests correctly render and handle the new 'USD₮0' symbol.
  • There are no adverse effects on any downstream systems or integrations.

Because the automated search commands did not return any UI or test references, please perform a manual verification of any components potentially impacted by this change.

@railway-app railway-app bot temporarily deployed to staging-bera-uni February 18, 2025 20:30 Inactive
@railway-app railway-app bot temporarily deployed to staging-bera-uni February 18, 2025 20:32 Inactive
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)
packages/widget/src/constants/bridgeMap.ts (1)

584-901: Consider adding swappable tokens for the new chains.

Both UNICHAIN and BERACHAIN tokens have empty swappable arrays. Consider if any token swapping capabilities should be enabled, as most other stablecoin entries in other chains have swappable configurations.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a686136 and c7da787.

📒 Files selected for processing (6)
  • packages/rest-api/src/constants/bridgeMap.ts (2 hunks)
  • packages/synapse-constants/src/constants/bridgeMap.ts (3 hunks)
  • packages/synapse-interface/constants/bridgeMap.ts (2 hunks)
  • packages/widget/src/constants/bridgeMap.ts (2 hunks)
  • packages/widget/src/constants/bridgeable.ts (6 hunks)
  • packages/widget/src/constants/chains.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/synapse-constants/src/constants/bridgeMap.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Build (1.22.x)
  • GitHub Check: Deploy to Vercel (synapse-interface)
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: changesets-integrity-checker
  • GitHub Check: test
  • GitHub Check: lint
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (13)
packages/widget/src/constants/bridgeable.ts (3)

440-441: LGTM! USDC token configuration for new chains.

The USDC token configuration for BERACHAIN and UNICHAIN is consistent with other chains, using 6 decimals which is the standard for USDC.

Also applies to: 459-460


1305-1306: LGTM! WETH token configuration for new chains.

The WETH token configuration for BERACHAIN and UNICHAIN is consistent with other chains, using 18 decimals which is the standard for ERC20 tokens.

Also applies to: 1319-1320


815-815: LGTM! ETH token configuration for UNICHAIN.

The ETH token configuration for UNICHAIN follows the standard pattern used for other L2 chains, using ZeroAddress for the native ETH token and 18 decimals.

Also applies to: 829-829

packages/widget/src/constants/chains.ts (3)

555-556: LGTM!

The new chains are correctly added to the CHAINS object, maintaining consistency with the existing pattern.


510-529:

✅ Verification successful

Add missing blockTime property documentation.

While the configuration is correct, consider adding a comment explaining the 1000ms blockTime value for better maintainability.

  networkName: 'Unichain',
  networkUrl: 'https://mainnet.unichain.org',
+ // Average block time: 1 second
  blockTime: 1000,

Also, let's verify the RPC endpoints and explorer URL.


🏁 Script executed:

#!/bin/bash
# Check if the RPC endpoints and explorer are accessible
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://mainnet.unichain.org
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://unichain-rpc.publicnode.com
curl -s -o /dev/null -w "%{http_code}" https://uniscan.xyz

Length of output: 1164


Minor Documentation Update Approved – Endpoints Verified

The change to add a comment explaining the blockTime value is a simple, maintainability improvement. The provided diff snippet with the comment addition:

  networkName: 'Unichain',
  networkUrl: 'https://mainnet.unichain.org',
+ // Average block time: 1 second
  blockTime: 1000,

has been implemented. Additionally, the RPC endpoints (https://mainnet.unichain.org and https://unichain-rpc.publicnode.com) and the explorer URL (https://uniscan.xyz) were verified via curl tests and are responding as expected.


489-508:

✅ Verification successful

Verify BERACHAIN RPC endpoints and explorer URL.

The configuration looks good, but let's verify the endpoints are operational.


🏁 Script executed:

#!/bin/bash
# Check if the RPC endpoints and explorer are accessible
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://rpc.berachain.com
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://berachain-rpc.publicnode.com
curl -s -o /dev/null -w "%{http_code}" https://berascan.com

Length of output: 1168


Endpoint Verification for BERACHAIN Passed

The RPC endpoints (https://rpc.berachain.com and https://berachain-rpc.publicnode.com) both return a valid chain ID (0x138de), and the explorer URL (https://berascan.com) successfully returns HTTP 200. There are no issues with the configuration.

packages/rest-api/src/constants/bridgeMap.ts (2)

584-606: LGTM! New token entries for UNICHAIN (130) are well-structured.

The token configurations for USDC, WETH, and ETH follow the established pattern and include all necessary fields with correct decimal places and RFQ bridging setup.


1886-1901: LGTM! New token entries for BERACHAIN (80094) are well-structured.

The token configurations for WETH and USDC.e follow the established pattern and include all necessary fields with correct decimal places and RFQ bridging setup.

packages/synapse-interface/constants/bridgeMap.ts (3)

584-606: LGTM! New chain ID 130 entries are well-configured.

The token entries for UNICHAIN (130) follow consistent patterns:

  • Correct decimal values (6 for USDC, 18 for WETH/ETH)
  • Proper RFQ prefixes in origin/destination arrays
  • Empty swappable arrays are acceptable for a new chain

1886-1901: LGTM! New chain ID 80094 entries are well-configured.

The token entries for BERACHAIN (80094) follow consistent patterns:

  • Correct decimal values (18 for WETH, 6 for USDC.e)
  • Proper RFQ prefixes in origin/destination arrays
  • Empty swappable arrays are acceptable for a new chain

489-583:

❓ Verification inconclusive

Verify removal of BNB/WBNB references in chain 56.

The BNB and WBNB token entries have been removed. Let's verify there are no lingering references to these tokens in other entries.

Run this script to check for any remaining BNB references in chain 56:


🏁 Script executed:

#!/bin/bash
# Description: Check for any remaining BNB references in chain 56 entries

# Test: Search for BNB references in origin/destination arrays
echo "Checking for BNB references in chain 56..."
rg -U "'BNB'" -A 5 -B 5

# Test: Search for WBNB address references in swappable arrays
echo "Checking for WBNB address references..."
rg -i "bb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" -A 5 -B 5

Length of output: 274


BNB/WBNB References Removal Verification

After executing the verification scripts, no occurrences of "BNB" in the origin/destination arrays or the specific WBNB address (bb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) in the swappable arrays were found for chain 56. This suggests that the BNB and WBNB token entries have been successfully removed.

However, the absence of output from the automated search means that the verification relies solely on these queries. Please perform a manual check of packages/synapse-interface/constants/bridgeMap.ts to ensure there are no residual references that might have been missed.

packages/widget/src/constants/bridgeMap.ts (2)

886-901: Verify the BERACHAIN token configurations.

The new BERACHAIN (80094) token configurations follow the established patterns. Both WETH and USDC.e have consistent decimal places (18 and 6 respectively) and appropriate RFQ origin/destination mappings.


584-606:

❓ Verification inconclusive

Verify the UNICHAIN token configurations.

The new UNICHAIN (130) token configurations look consistent with the established patterns. However, note that WETH has only origin but no destination set, which differs from other chains' WETH configurations that typically have both.

Run this script to check WETH configurations across chains:


🏁 Script executed:

#!/bin/bash
# Description: Check WETH configurations across chains to verify if missing destination is intentional
rg -A 5 "WETH.*origin.*RFQ.ETH"

Length of output: 33


Action Required: Verify UNICHAIN WETH Configuration

The new UNICHAIN (chain ID '130') token configuration is generally consistent with established patterns. However, the WETH token here specifies only an origin (['RFQ.ETH']) with an empty destination array, which deviates from similar WETH configurations on other chains that typically include both origin and destination values.

  • Please manually verify whether the absence of a destination for WETH on UNICHAIN is intentional.
  • Compare with other chain entries to ensure consistency or update the configuration as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants