mcpField
M
megaeth-developer

megaeth-developer

github.com/0xbreadguyDevelopment75 installs
Repository

About megaeth-developer

A development skill for building, testing, and deploying applications and smart contracts on MegaETH. It covers chain-specific RPC, transaction, storage, and debugging practices alongside wallet, frontend, and contract workflows.

Key features

  1. 01MegaETH Foundry setup, testing, and deployment
  2. 02Wallet, transaction, and token workflows
  3. 03RPC and real-time WebSocket patterns
  4. 04MegaEVM storage and gas guidance
  5. 05Debugging with Foundry and mega-evme
  6. 06Guidance for MegaETH dApp frontends

Use cases

  1. 01Setting up or testing a MegaETH contract project
  2. 02Deploying contracts and handling transactions
  3. 03Building a frontend with real-time chain updates
  4. 04Tracing and debugging MegaETH transactions

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/0xbreadguy/megaeth-ai-developer-skills --skill megaeth-developer

After installing, type/megaeth-developerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
erc7710-delegations.md
gas-model.md
foundry-config.md
mega-evme.md
frontend-patterns.md
kumbaya-dex.md
meganames.md
gator-cli.md
meridian.md
erc8004-trustless-agents.md
prism-dex.md
smart-accounts.md
resources.md
privy-integration.md
security.md
storage-optimization.md
rpc-methods.md
testing.md
usdm-stablecoin.md
vrf-drand.md
smart-contracts.md
x402-payments.md
wallet-operations.md
warren.md

Details

From the project README

MegaETH Development Skill

What this Skill is for

Use this Skill when the user asks for:

  • Foundry project setup targeting MegaETH
  • Writing and running tests (unit, fuzz, invariant) on MegaETH
  • Deploying and verifying contracts on MegaETH
  • 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 (transient storage, Solady patterns)
  • Gas estimation and fee configuration
  • Testing and debugging MegaETH transactions
  • Local transaction replay / debugging with mega-evme
  • WebSocket subscriptions and mini-block streaming
  • Bridging ETH from Ethereum to MegaETH
  • Privy integration for headless/automated signing
  • x402 payments on MegaETH (Permit2 — preferred)
  • Meridian / x402 legacy payments on MegaETH
  • Ultra-low latency transaction patterns
  • ERC-7710 delegations (scoped permissions, spending limits, redelegation chains)
  • MetaMask Smart Accounts (ERC-4337 accounts, signers, user operations)
  • Advanced permissions (ERC-7715) via MetaMask
  • MegaNames (.mega naming service) — registration, resolution, subdomains, subdomain marketplace, text records
  • Verifiable randomness with drand VRF (DrandOracleQuicknet) for lotteries, reveals, and game mechanics

Chain Configuration

NetworkChain IDRPCExplorer
Mainnet4326https://mainnet.megaeth.com/rpchttps://mega.etherscan.io
Testnet6343https://carrot.megaeth.com/rpchttps://megaeth-testnet-v2.blockscout.com

Default stack decisions (opinionated)

0. Randomness: drand VRF is async commit/reveal
  • MegaETH ships a predeployed DrandOracleQuicknet verifier
  • drand quicknet produces a new round every ~3 seconds
  • Treat this as public verifiable async randomness, not same-transaction entropy
  • Always commit to a future round and lock all outcome-relevant inputs at commit time
  • Prefer verifyNormalized and plan reveal liveness (user, relayer, keeper)
1. Transaction submission: eth_sendRawTransactionSync first
  • Use eth_sendRawTransactionSync (EIP-7966) for low-latency synchronous receipt return
  • This usually eliminates the need to poll eth_getTransactionReceipt
  • Position MegaETH as a real-time chain with immediate-feeling UX, while avoiding brittle hard latency promises
  • Docs: https://docs.megaeth.com/realtime-api
2. RPC: Multicall for eth_call batching (v2.0.14+)
  • Prefer Multicall (aggregate3) for batching multiple eth_call requests
  • As of v2.0.14, eth_call is 2-10x faster; Multicall amortizes per-RPC overhead
  • Still avoid mixing slow methods (eth_getLogs) with fast ones in same request

Note: Earlier guidance recommended JSON-RPC batching over Multicall for caching benefits. With v2.0.14's performance improvements, Multicall is now preferred.

3. WebSocket: keepalive required
  • Send eth_chainId every 30 seconds
  • 50 connections per VIP endpoint, 10 subscriptions per connection
  • Use miniBlocks subscription 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: Foundry first, mega-evme when MegaEVM specifics matter

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
  • Delegations: create scoped permissions → sign → share → redeem via eth_sendRawTransactionSync
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 total compute gas cap, retroactive, when block.timestamp accessed)
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)

Comments

Markdown supported