megaeth

Implement MegaETH real-time blockchain applications with instant receipts, gas optimization, and delegations.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill megaeth-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: megaeth
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/megaeth
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill megaeth-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents and developers routinely apply standard Ethereum assumptions to MegaETH that are wrong: 21,000 intrinsic gas (actually 60,000), polling for receipts (instead of sub-10ms synchronous receipts), local gas simulation (MegaEVM opcode costs differ), and dynamic storage mappings (new slots cost 2M+ gas). This Skill provides verified chain configuration, RPC methods, gas model details, and contract patterns specific to MegaETH mainnet (chain ID 4326) and testnet. ## Core Features & Use Cases - Real-time transaction patterns: Use eth_sendRawTransactionSync (EIP-7966) for receipts in under 10ms, mini-block WebSocket subscriptions, and nonce pipelining for latency-sensitive apps. - Gas and storage optimization: Apply the dual gas model, SSTORE bucket multipliers, RedBlackTreeLib slot reuse, transient storage (EIP-1153), and SSTORE2 bytecode storage to avoid 2M+ gas per new slot. - Protocol integrations: Register and resolve MegaNames (.mega) domains, build ERC-7710 scoped delegations with caveat enforcers, host on-chain sites via Warren, and create MetaMask smart accounts. - Use Case: Deploy a Foundry contract to MegaETH with correct gas limits (--skip-simulation), wire a viem client with the correct chain definition, and submit transactions with instant receipts instead of polling. ## Quick Start Set up a viem client for MegaETH mainnet and send a transaction using eth_sendRawTransactionSync with 60,000 intrinsic gas and a fixed 0.001 gwei fee.

Frequently Asked Questions about megaeth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get instant transaction receipts on MegaETH?

Use eth_sendRawTransactionSync (EIP-7966) with a pre-signed transaction to receive a full receipt in under 10ms instead of polling. MegaETH also supports the equivalent realtime_sendRawTransaction method, but the EIP-7966 variant is preferred for cross-chain compatibility.

Why is my MegaETH transaction failing with intrinsic gas too low?

MegaETH intrinsic gas is 60,000 (21K compute plus 39K storage), not Ethereum's 21,000. Local simulation in Foundry or Hardhat uses standard EVM costs, so deploy with --skip-simulation and an explicit gas limit, or use remote eth_estimateGas.

How do I reduce storage gas costs on MegaETH?

New storage slots cost 2M+ gas scaled by a bucket multiplier. Reuse slots with Solady RedBlackTreeLib or circular buffers, use transient storage (EIP-1153) for temporary data, and store large immutable data as bytecode with SSTORE2 where reads are free.

What is the MegaETH chain ID and RPC endpoint for viem?

Mainnet uses chain ID 4326 with RPC https://mainnet.megaeth.com/rpc, and testnet uses chain ID 6343 with https://carrot.megaeth.com/rpc. Define them with viem's defineChain and set maxFeePerGas to 1000000 wei (0.001 gwei fixed base fee).

How do ERC-7710 delegations work on MegaETH?

Create scoped, revocable permissions with @metamask/smart-accounts-kit by building a delegation with caveat enforcers (spending limits, timestamps, call limits), signing it off-chain, and redeeming on-chain through the DelegationManager contract. Redeem with eth_sendRawTransactionSync for instant confirmation.

Why should I avoid via_ir in foundry.toml on MegaETH?

Enabling via_ir=true silently breaks return values, causing functions to return 0 with no compiler error. Use optimizer=true with optimizer_runs=200 instead for safe compilation targeting MegaEVM.