megaeth-developer
MegaETHでの開発全般を網羅し、ウォレット操作からコントラクトデプロイ、デバッグまでを効率的に支援するSkill。
📜 元の英語説明(参考)
End-to-end MegaETH development playbook (Feb 2026). Covers wallet operations, token swaps (Kyber Network), eth_sendRawTransactionSync (EIP-7966) for instant receipts, JSON-RPC batching, real-time mini-block subscriptions, storage-aware contract patterns (Solady RedBlackTreeLib), MegaEVM gas model, WebSocket keepalive, bridging from Ethereum, and debugging with mega-evme. Use when building on MegaETH, managing wallets, sending transactions, or deploying contracts.
🇯🇵 日本人クリエイター向け解説
MegaETHでの開発全般を網羅し、ウォレット操作からコントラクトデプロイ、デバッグまでを効率的に支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
MegaETH 開発スキル
このスキルが役立つ場面
ユーザーが以下を求めたときに、このスキルを使用します。
- MegaETH でのウォレットのセットアップと管理
- トランザクションの送信、残高の確認、トークン操作
- Kyber Network アグリゲーターを介したトークン交換
- MegaETH dApp フロントエンド (React / Next.js とリアルタイム更新)
- RPC 設定とトランザクションフローの最適化
- MegaEVM を考慮したスマートコントラクト開発
- ストレージの最適化 (高価な SSTORE コストの回避)
- ガス見積もりと手数料設定
- MegaETH トランザクションのテストとデバッグ
- WebSocket サブスクリプションとミニブロックストリーミング
- Ethereum から MegaETH への ETH ブリッジ
チェーン設定
| ネットワーク | チェーン ID | RPC | エクスプローラー |
|---|---|---|---|
| メインネット | 4326 | https://mainnet.megaeth.com/rpc |
https://mega.etherscan.io |
| テストネット | 6343 | https://carrot.megaeth.com/rpc |
https://megaeth-testnet-v2.blockscout.com |
デフォルトのスタック決定 (意見に基づく)
1. トランザクション送信: まず eth_sendRawTransactionSync
eth_sendRawTransactionSync(EIP-7966) を使用します — 10ms 未満でレシートを返しますeth_getTransactionReceiptのポーリングを不要にします- ドキュメント: https://docs.megaeth.com/realtime-api
2. RPC: Multicall よりも JSON-RPC バッチ処理
client.request([...])バッチ呼び出しを優先します- Multicall (
aggregate3) はキャッシュが難しく、整合性が弱いです - 遅いメソッド (
eth_getLogs) と速いメソッド (eth_call) をバッチ処理しないでください
3. WebSocket: キープアライブが必要
- 30秒ごとに
eth_chainIdを送信します - VIP エンドポイントごとに 50 接続、接続ごとに 10 サブスクリプション
- リアルタイムデータには
miniBlocksサブスクリプションを使用します
4. ストレージ: スロット再利用パターン
- SSTORE 0→非ゼロは 2M ガス × 乗数 (高価) のコストがかかります
- Solidity マッピングの代わりに Solady の RedBlackTreeLib を使用します
- 定数割り当てではなく、スロット再利用のために設計します
5. ガス: 可能であれば見積もりをスキップ
- ベース料金は 0.001 gwei で安定しており、EIP-1559 の調整はありません
eth_maxPriorityFeePerGasは無視します (0 を返します)- ラウンドトリップを節約するためにガス制限をハードコードします
- 常にリモートの
eth_estimateGasを使用します (MegaEVM のコストは標準 EVM と異なります)
6. デバッグ: mega-evme CLI
- 完全なトレースでトランザクションをリプレイします
- オペコードごとにガスをプロファイルします
- https://github.com/megaeth-labs/mega-evm
運用手順
1. タスクレイヤーを分類する
- フロントエンド/WebSocket レイヤー
- RPC/トランザクション レイヤー
- スマートコントラクト レイヤー
- テスト/デバッグ レイヤー
2. 適切なパターンを選択する
- フロントエンド: 単一の WebSocket → ユーザーにブロードキャスト (ユーザーごとの接続ではない)
- トランザクション: ローカルで署名 →
eth_sendRawTransactionSync→ 完了 - コントラクト: SSTORE パターンを確認し、揮発性データアクセス制限を回避する
- テスト: リプレイには mega-evme を使用し、
--skip-simulation付きの Foundry を使用する
3. MegaETH 固有の正確性で実装する
常に以下を明示的にします。
- チェーン ID (4326 メインネット、6343 テストネット)
- ガス制限 (可能であればハードコード)
- ベース料金 (0.001 gwei、バッファなし)
- ストレージコスト (新しいスロットは高価)
- 揮発性データ制限 (block.timestamp アクセス後 20M ガス)
4. 成果物の期待
変更を実装する際は、以下を提供してください。
- 変更された正確なファイル + 差分
- ビルド/テスト/デプロイのコマンド
- ストレージを多用する操作のガス料金に関するメモ
- 該当する場合は RPC 最適化に関するメモ
段階的開示 (必要に応じて読む)
- ウォレット操作: wallet-operations.md
- フロントエンドパターン: frontend-patterns.md
- RPC メソッドリファレンス: rpc-methods.md
- スマートコントラクトパターン: smart-contracts.md
- ストレージ最適化: storage-optimization.md
- ガスモデル: gas-model.md
- テストとデバッグ: testing.md
- セキュリティに関する考慮事項: security.md
- 参照リンク: resources.md
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
MegaETH Development Skill
What this Skill is for
Use this Skill when the user asks for:
- Wallet setup and management on MegaETH
- Sending transactions, checking balances, token operations
- Token swaps via Kyber Network aggregator
- MegaETH dApp frontend (React / Next.js with real-time updates)
- RPC configuration and transaction flow optimization
- Smart contract development with MegaEVM considerations
- Storage optimization (avoiding expensive SSTORE costs)
- Gas estimation and fee configuration
- Testing and debugging MegaETH transactions
- WebSocket subscriptions and mini-block streaming
- Bridging ETH from Ethereum to MegaETH
Chain Configuration
| Network | Chain ID | RPC | Explorer |
|---|---|---|---|
| Mainnet | 4326 | https://mainnet.megaeth.com/rpc |
https://mega.etherscan.io |
| Testnet | 6343 | https://carrot.megaeth.com/rpc |
https://megaeth-testnet-v2.blockscout.com |
Default stack decisions (opinionated)
1. Transaction submission: eth_sendRawTransactionSync first
- Use
eth_sendRawTransactionSync(EIP-7966) — returns receipt in <10ms - Eliminates polling for
eth_getTransactionReceipt - Docs: https://docs.megaeth.com/realtime-api
2. RPC: JSON-RPC batching over Multicall
- Prefer
client.request([...])batch calls - Multicall (
aggregate3) harder to cache, weaker consistency - Never batch slow methods (
eth_getLogs) with fast ones (eth_call)
3. WebSocket: keepalive required
- Send
eth_chainIdevery 30 seconds - 50 connections per VIP endpoint, 10 subscriptions per connection
- Use
miniBlockssubscription for real-time data
4. Storage: slot reuse patterns
- SSTORE 0→non-zero costs 2M gas × multiplier (expensive)
- Use Solady's RedBlackTreeLib instead of Solidity mappings
- Design for slot reuse, not constant allocation
5. Gas: skip estimation when possible
- Base fee stable at 0.001 gwei, no EIP-1559 adjustment
- Ignore
eth_maxPriorityFeePerGas(returns 0) - Hardcode gas limits to save round-trip
- Always use remote
eth_estimateGas(MegaEVM costs differ from standard EVM)
6. Debugging: mega-evme CLI
- Replay transactions with full traces
- Profile gas by opcode
- https://github.com/megaeth-labs/mega-evm
Operating procedure
1. Classify the task layer
- Frontend/WebSocket layer
- RPC/transaction layer
- Smart contract layer
- Testing/debugging layer
2. Pick the right patterns
- Frontend: single WebSocket → broadcast to users (not per-user connections)
- Transactions: sign locally →
eth_sendRawTransactionSync→ done - Contracts: check SSTORE patterns, avoid volatile data access limits
- Testing: use mega-evme for replay, Foundry with
--skip-simulation
3. Implement with MegaETH-specific correctness
Always be explicit about:
- Chain ID (4326 mainnet, 6343 testnet)
- Gas limit (hardcode when possible)
- Base fee (0.001 gwei, no buffer)
- Storage costs (new slots are expensive)
- Volatile data limits (20M gas after block.timestamp access)
4. Deliverables expectations
When implementing changes, provide:
- Exact files changed + diffs
- Commands to build/test/deploy
- Gas cost notes for storage-heavy operations
- RPC optimization notes if applicable
Progressive disclosure (read when needed)
- Wallet operations: wallet-operations.md
- Frontend patterns: frontend-patterns.md
- RPC methods reference: rpc-methods.md
- Smart contract patterns: smart-contracts.md
- Storage optimization: storage-optimization.md
- Gas model: gas-model.md
- Testing & debugging: testing.md
- Security considerations: security.md
- Reference links: resources.md