feat: enable MegaETH chain support#12207
feat: enable MegaETH chain support#12207stuuagentclaw wants to merge 1 commit intoshapeshift:developfrom
Conversation
Enable VITE_FEATURE_MEGAETH feature flag to activate MegaETH (chainId 4326) as a supported chain in the app. MegaETH is already wired in: - RelaySwapper (PR shapeshift#11904 area) - AcrossSwapper (PR shapeshift#12144) - DebridgeSwapper (PR shapeshift#12143) Routes verified: - Relay: active, MegaETH chainId 4326 mapped - Across: 81 routes from 20 source chains (ETH, WETH, USDT) - deBridge: chain registered as 100000031 This enables the chain in the UI. Individual swapper availability depends on their respective feature flags (ACROSS_SWAP, DEBRIDGE_SWAP).
📝 WalkthroughWalkthroughA single environment variable is modified in the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.env (1)
329-329: Consider alphabetical ordering (optional).Static analysis suggests placing
VITE_FEATURE_MEGAETHbeforeVITE_FEATURE_MONADfor alphabetical consistency. However, this section appears to follow a chronological grouping rather than strict alphabetical order, so this is purely a cosmetic improvement.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.env at line 329, The .env contains VITE_FEATURE_MEGAETH which should be alphabetized relative to VITE_FEATURE_MONAD for consistency; reorder the keys so VITE_FEATURE_MEGAETH appears before VITE_FEATURE_MONAD (or apply alphabetical ordering across the VITE_FEATURE_* block) to maintain consistent key ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.env:
- Line 329: Remove the duplicate feature flag VITE_FEATURE_MEGAETH from the
mode-specific environment file so it’s only defined globally in the base .env;
locate the VITE_FEATURE_MEGAETH entry in the development env file (the
mode-specific env that mirrors base .env) and delete that line, leaving the
single global definition intact.
---
Nitpick comments:
In @.env:
- Line 329: The .env contains VITE_FEATURE_MEGAETH which should be alphabetized
relative to VITE_FEATURE_MONAD for consistency; reorder the keys so
VITE_FEATURE_MEGAETH appears before VITE_FEATURE_MONAD (or apply alphabetical
ordering across the VITE_FEATURE_* block) to maintain consistent key ordering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| VITE_FEATURE_INK=false | ||
| VITE_FEATURE_CRONOS=false | ||
| VITE_FEATURE_MEGAETH=false | ||
| VITE_FEATURE_MEGAETH=true |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if VITE_FEATURE_MEGAETH is defined in mode-specific .env files
echo "Checking for VITE_FEATURE_MEGAETH in mode-specific .env files..."
fd -t f '^\.env\.(development|production)$' --exec grep -H 'VITE_FEATURE_MEGAETH' {}Repository: shapeshift/web
Length of output: 347
🏁 Script executed:
#!/bin/bash
# Check for VITE_FEATURE_MEGAETH in mode-specific .env files (with -H flag for hidden files)
echo "Checking for VITE_FEATURE_MEGAETH in mode-specific .env files..."
grep -r 'VITE_FEATURE_MEGAETH' .env.development .env.production 2>/dev/null || echo "No overrides found"
echo ""
echo "Listing available .env files:"
find . -maxdepth 1 -name '.env*' -type f | sortRepository: shapeshift/web
Length of output: 267
Remove VITE_FEATURE_MEGAETH from .env.development to follow the global feature flag convention.
The change at line 329 in the base .env correctly enables MegaETH globally. However, .env.development also defines VITE_FEATURE_MEGAETH=true. When a feature flag is enabled globally in the base .env, the convention in this project is to remove it from mode-specific environment files to prevent configuration fragmentation. Remove the flag from .env.development to complete the global enablement.
🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 329-329: [UnorderedKey] The VITE_FEATURE_MEGAETH key should go before the VITE_FEATURE_MONAD key
(UnorderedKey)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.env at line 329, Remove the duplicate feature flag VITE_FEATURE_MEGAETH
from the mode-specific environment file so it’s only defined globally in the
base .env; locate the VITE_FEATURE_MEGAETH entry in the development env file
(the mode-specific env that mirrors base .env) and delete that line, leaving the
single global definition intact.
Description
Enable MegaETH (chainId 4326) as a supported chain by setting
VITE_FEATURE_MEGAETH=true.MegaETH chain support and swapper wiring were already completed in previous PRs:
This PR simply activates the chain in the UI. Individual swapper route availability depends on their respective feature flags (
VITE_FEATURE_ACROSS_SWAP,VITE_FEATURE_DEBRIDGE_SWAP).With Relay already active, users will be able to bridge to/from MegaETH immediately. When Across and deBridge flags are enabled separately, MegaETH will have 3 bridge routes competing for best price.
Risk
Low - feature flag change only. No new on-chain interactions, no new contracts, no code changes beyond .env.
Testing
Engineering
Verify that MegaETH appears in the chain selector and that Relay swap quotes return valid results for MegaETH destination.
Operations
Summary by CodeRabbit