megaeth

Guides MegaETH development with instant receipts, gas model, storage optimization, and ERC-7710 delegations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem, @metamask/smart-accounts-kit, and includes references (resource) components.

What problem does it solve? AI agents and developers routinely apply standard Ethereum assumptions to MegaETH that are wrong: intrinsic gas is 60,000 not 21,000, local gas simulation produces incorrect estimates, and new storage slots cost 2M+ gas. This Skill provides verified chain configuration, RPC methods, gas model details, and contract addresses so transactions and contracts work correctly on MegaETH the first time. ## Core Features & Use Cases - Real-time transaction submission: Use eth_sendRawTransactionSync (EIP-7966) for receipts in under 10ms instead of polling, plus mini-block WebSocket subscriptions and cursor-paginated log queries. - 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 expensive state growth. - Protocol integrations: Register and resolve MegaNames (.mega) domains, build ERC-7710 scoped delegations with caveat enforcers, deploy MetaMask smart accounts, and host on-chain sites via Warren Protocol. - Use Case: A developer deploying a contract to MegaETH mainnet gets the correct chain ID (4326), RPC endpoints, Foundry flags (--skip-simulation, no via_ir), and verified contract addresses without hallucinated values. ## Quick Start Ask the agent to set up a viem client for MegaETH mainnet and send a transaction using eth_sendRawTransactionSync with the correct 60,000 intrinsic gas.

Frequently Asked Questions about megaeth

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

FAQPage Schema
How do I send a transaction on MegaETH with instant receipts?

Use eth_sendRawTransactionSync (EIP-7966) with a pre-signed transaction to get 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.

What is the intrinsic gas cost for a MegaETH transaction?

MegaETH intrinsic gas is 60,000 (21K compute plus 39K storage), not the 21,000 used on Ethereum. A simple ETH transfer must set gas to at least 60,000 with a fixed base fee of 0.001 gwei and zero priority fee.

Why does Foundry gas estimation fail on MegaETH?

Foundry and Hardhat simulate with standard EVM opcode costs, which differ from MegaEVM, producing wrong estimates. Deploy with --skip-simulation and an explicit --gas-limit, or use remote eth_estimateGas against a MegaETH RPC endpoint.

How do I reduce storage gas costs on MegaETH?

New storage slots cost 2M+ gas scaled by a bucket multiplier, so reuse slots with Solady RedBlackTreeLib, circular buffers, or transient storage (EIP-1153). For large immutable data, SSTORE2 stores it as contract bytecode with free reads via EXTCODECOPY.

Can I use ERC-7710 delegations on MegaETH?

Yes, the MetaMask Delegation Framework works on MegaETH with deterministic contract addresses like DelegationManager at 0xdb9B1e94B5b69Df7e401DDbedE43491141047dB3. Create scoped delegations with caveat enforcers and redeem them via eth_sendRawTransactionSync for instant confirmation.

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

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