Skip to content

feat: enable MegaETH chain support#12207

Open
stuuagentclaw wants to merge 1 commit intoshapeshift:developfrom
stuuagentclaw:feat/enable-megaeth-routes
Open

feat: enable MegaETH chain support#12207
stuuagentclaw wants to merge 1 commit intoshapeshift:developfrom
stuuagentclaw:feat/enable-megaeth-routes

Conversation

@stuuagentclaw
Copy link
Copy Markdown

@stuuagentclaw stuuagentclaw commented Mar 25, 2026

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.

Relay is the active swapper that will serve MegaETH routes. Across and deBridge routes are ready but gated behind their own flags.

Testing

Engineering

Verify that MegaETH appears in the chain selector and that Relay swap quotes return valid results for MegaETH destination.

Operations

  • Verify MegaETH chain appears in UI after flag is enabled
  • Verify Relay bridge quote works for ETH → MegaETH
  • Verify portfolio balance loads for MegaETH addresses

Summary by CodeRabbit

  • New Features
    • MegaETH functionality is now enabled. Users can access newly enabled features that expand platform capabilities.

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).
@stuuagentclaw stuuagentclaw requested a review from a team as a code owner March 25, 2026 10:18
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

A single environment variable is modified in the .env configuration file, changing the VITE_FEATURE_MEGAETH feature flag from false to true. This enables MegaETH-related functionality throughout the application where this flag is conditionally checked.

Changes

Cohort / File(s) Summary
Configuration
.env
Feature flag VITE_FEATURE_MEGAETH enabled by changing value from false to true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 With a flip of this humble flag so small,
MegaETH awakens and answers the call!
From false to true, the feature takes wing,
New possibilities dance and sing,
The rabbit cheers—what joy it shall bring! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: enable MegaETH chain support' directly and clearly summarizes the main change—enabling MegaETH functionality by flipping the feature flag from false to true, matching the PR objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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

🧹 Nitpick comments (1)
.env (1)

329-329: Consider alphabetical ordering (optional).

Static analysis suggests placing VITE_FEATURE_MEGAETH before VITE_FEATURE_MONAD for 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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5744dd03-69aa-41ce-9335-75d0ee550822

📥 Commits

Reviewing files that changed from the base of the PR and between 7b7725d and f126fec.

📒 Files selected for processing (1)
  • .env

VITE_FEATURE_INK=false
VITE_FEATURE_CRONOS=false
VITE_FEATURE_MEGAETH=false
VITE_FEATURE_MEGAETH=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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 | sort

Repository: 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.

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.

1 participant