Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ Creating wallets, key safety, multisig, account abstraction.
### [Layer 2s](https://ethskills.com/l2s/SKILL.md)
L2 landscape, bridging, deployment differences.
- Base is the cheapest major L2. Arbitrum has the deepest DeFi liquidity.
- MegaETH produces 10ms mini blocks — 100x faster than any other L2. Real-time onchain apps.
- Celo is NOT an L1 anymore — migrated to OP Stack L2 in March 2025.
- Polygon zkEVM is being shut down. Do not build on it.
- The dominant DEX on each L2 is NOT Uniswap (Aerodrome on Base, Velodrome on Optimism).
- The dominant DEX on each L2 is NOT Uniswap (Aerodrome on Base, Velodrome on Optimism, Kumbaya on MegaETH).

### [Standards](https://ethskills.com/standards/SKILL.md)
ERC-20, ERC-721, ERC-8004, EIP-7702, x402.
Expand Down Expand Up @@ -148,4 +149,5 @@ Pre-ship audit checklist for a reviewer agent.
| Auditing a smart contract | `audit/` |
| Monitoring / analytics | `indexing/` |
| Building AI agent infra | `standards/`, `wallets/`, `tools/` |
| Real-time / low-latency apps | `l2s/`, `gas/`, `addresses/` |
| Choosing a chain | `l2s/`, `gas/` |
15 changes: 15 additions & 0 deletions addresses/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ description: Verified contract addresses for major Ethereum protocols across mai
| Arbitrum | `0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9` | ✅ Verified |
| Optimism | `0x94b008aA00579c1307B0EF2c499aD98a8ce58e58` | ✅ Verified |
| Base | `0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2` | ✅ Verified |
| MegaETH | `0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb` | ✅ Verified |

### DAI (MakerDAO)
| Network | Address | Status |
Expand All @@ -49,6 +50,7 @@ description: Verified contract addresses for major Ethereum protocols across mai
| Arbitrum | `0x82aF49447D8a07e3bd95BD0d56f35241523fBab1` | ✅ Verified |
| Optimism | `0x4200000000000000000000000000000000000006` | ✅ Verified |
| Base | `0x4200000000000000000000000000000000000006` | ✅ Verified |
| MegaETH | `0x4200000000000000000000000000000000000006` | ✅ Verified |

---

Expand All @@ -61,6 +63,7 @@ description: Verified contract addresses for major Ethereum protocols across mai
| Arbitrum | `0x5979D7b546E38E414F7E9822514be443A4800529` | ✅ Verified |
| Optimism | `0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb` | ✅ Verified |
| Base | `0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452` | ✅ Verified |
| MegaETH | `0x601aC63637933D88285A025C685AC4e9a92a98dA` | ✅ Verified |

### Lido — Staking & Withdrawal
| Contract | Address | Status |
Expand Down Expand Up @@ -457,6 +460,18 @@ The leading native DEX on zkSync Era. Multiple router and factory versions.

Source: [docs.syncswap.xyz](https://docs.syncswap.xyz/syncswap/smart-contracts/smart-contracts)

### Kumbaya (MegaETH) — Dominant DEX

The most liquid DEX on MegaETH with an integrated launchpad. Sub-cent swap costs with 10ms mini block latency.

| Contract | Address | Status |
|----------|---------|--------|
| SwapRouter02 | `0xE5BbEF8De2DB447a7432A47EBa58924d94eE470e` | ✅ Verified |
| QuoterV2 | `0x1F1a8dC7E138C34b503Ca080962aC10B75384a27` | ✅ Verified |
| UniversalRouter | `0xAAB1C664CeaD881AfBB58555e6A3a79523D3e4C0` | ✅ Verified |

Pool init code hash: `0x851d77a45b8b9a205fb9f44cb829cceba85282714d2603d601840640628a3da7`

### Morpho Blue (Base)

Permissionless lending protocol. Deployed on Base and Ethereum, but **NOT on Arbitrum** as of February 2026 (despite the vanity CREATE2 address).
Expand Down
54 changes: 53 additions & 1 deletion building-blocks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,59 @@ Pendle splits yield-bearing assets into principal and yield components:
- **Stylus:** Write smart contracts in Rust/C++/WASM alongside EVM (10-100x gas savings for compute-heavy operations)
- **Orbit:** Launch custom L3 chains (47 live on mainnet)

See `addresses/SKILL.md` for all verified protocol addresses (GMX, Pendle, Camelot, Aerodrome, Velodrome, SyncSwap, Morpho).
See `addresses/SKILL.md` for all verified protocol addresses (GMX, Pendle, Camelot, Aerodrome, Velodrome, SyncSwap, Kumbaya, Morpho).

### MegaETH DeFi
- **Dominant DEX: Kumbaya** — most liquid DEX on MegaETH with an integrated launchpad. SwapRouter02: `0xE5BbEF8De2DB447a7432A47EBa58924d94eE470e`.
- **10ms mini blocks** enable real-time order book DEXes and HFT strategies that aren't viable on other L2s.
- **Sub-cent swap costs** — base fee is fixed at 0.001 gwei.

### MegaETH-Specific Patterns

MegaETH's 10ms mini blocks and multidimensional gas model require different patterns than other L2s.

**Instant receipts — skip polling:**
```javascript
// eth_sendRawTransactionSync (EIP-7966) returns receipt in <10ms
// No need for eth_getTransactionReceipt polling loops
const receipt = await client.request({
method: 'realtime_sendRawTransaction',
params: [signedTx]
});
// receipt is already confirmed — no waiting
```

**WebSocket mini block streaming:**
```javascript
// Subscribe to mini blocks for real-time event processing
// 100 mini blocks per EVM block — 10ms granularity
const ws = new WebSocket('wss://mainnet.megaeth.com/ws');
ws.send(JSON.stringify({
jsonrpc: '2.0', method: 'eth_subscribe',
params: ['miniBlocks'], id: 1
}));
// CRITICAL: send eth_chainId keepalive every 30 seconds
```

**Gas patterns:**
- Base fee is fixed at 0.001 gwei — no EIP-1559 spikes. Skip `eth_maxPriorityFeePerGas` (returns 0).
- Hardcode gas limits when possible to save an `eth_estimateGas` round-trip.
- But always use remote `eth_estimateGas` for new contracts — MegaEVM gas costs differ from standard EVM (multidimensional: compute gas + storage gas).
- SSTORE 0→non-zero is expensive (2M gas × multiplier). Design for storage slot reuse, not constant allocation.

**Storage optimization:**
- Max contract size is **512 KB** (vs 24 KB on Ethereum) — room for larger contracts.
- Use Solady's `RedBlackTreeLib` instead of Solidity mappings for slot reuse.
- Transient storage (`TSTORE`/`TLOAD`) is available and cheap.

**Multicall batching:**
- Use `Multicall3.aggregate3()` to batch read calls — 4-5x faster than sequential `eth_call`.
- Multicall3 is at the standard address: `0xcA11bde05977b3631167028862bE2a173976CA11`.

**Debugging:**
- [mega-evme](https://github.com/megaeth-labs/mega-evm) — replay transactions with full traces, profile gas by opcode.

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.

mega-evme - Is that a typo?

@0xBreadguy 0xBreadguy Mar 31, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nope! (although the link should go deeper)

https://github.com/megaeth-labs/mega-evm/tree/main/bin/mega-evme

"A command-line tool for executing and debugging EVM bytecode, similar to go-ethereum's evm command. This tool provides a convenient way to test, debug, and replay EVM transactions with full control over the execution environment."


**Deep dive:** For comprehensive MegaETH development patterns (Foundry config, Privy headless signing, ERC-7710 delegations, MegaNames, USDm, and more), see the [awesome-megaeth-ai](https://github.com/0xBreadguy/awesome-megaeth-ai) repo and the [MegaETH developer skill](https://github.com/0xBreadguy/megaeth-ai-developer-skills).

## Discovery Resources

Expand Down
14 changes: 7 additions & 7 deletions gas/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ description: Current Ethereum gas prices, transaction costs, and the real econom

## Mainnet vs L2 Costs (Early 2026)

| Action | Mainnet (0.1 gwei) | Arbitrum | Base | zkSync | Scroll |
|--------|---------------------|----------|------|--------|--------|
| ETH transfer | $0.004 | $0.0003 | $0.0003 | $0.0005 | $0.0004 |
| ERC-20 transfer | $0.013 | $0.001 | $0.001 | $0.002 | $0.001 |
| Swap | $0.036 | $0.003 | $0.002 | $0.005 | $0.004 |
| NFT mint | $0.030 | $0.002 | $0.002 | $0.004 | $0.003 |
| ERC-20 deploy | $0.240 | $0.020 | $0.018 | $0.040 | $0.030 |
| Action | Mainnet (0.1 gwei) | Arbitrum | Base | MegaETH | zkSync | Scroll |
|--------|---------------------|----------|------|---------|--------|--------|
| ETH transfer | $0.004 | $0.0003 | $0.0003 | $0.0001 | $0.0005 | $0.0004 |
| ERC-20 transfer | $0.013 | $0.001 | $0.001 | $0.001 | $0.002 | $0.001 |
| Swap | $0.036 | $0.003 | $0.002 | $0.001 | $0.005 | $0.004 |
| NFT mint | $0.030 | $0.002 | $0.002 | $0.001 | $0.004 | $0.003 |
| ERC-20 deploy | $0.240 | $0.020 | $0.018 | $0.01 | $0.040 | $0.030 |

**Key insight:** Mainnet is now cheap enough for most use cases. L2s are 5-10x cheaper still.

Expand Down
28 changes: 28 additions & 0 deletions l2s/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ description: Ethereum Layer 2 landscape — Arbitrum, Optimism, Base, zkSync, Sc
| **Linea** | ZK | $0.003-0.006 | 2s | 30-60min | 59144 |
| **zkSync Era** | ZK | $0.003-0.008 | 1s | 15-60min | 324 |
| **Scroll** | ZK | $0.002-0.005 | 3s | 30-120min | 534352 |
| **MegaETH** | Optimistic (EigenDA) | $0.001 | 10ms (mini) / 1s (EVM) | 7 days | 4326 |
| ~~Polygon zkEVM~~ | ~~ZK~~ | — | — | — | ~~1101~~ |

⚠️ **Polygon zkEVM is being discontinued (announced June 2025).** Do not start new projects there. Polygon is refocusing on PoS (payments, stablecoins, RWAs) + AggLayer (cross-chain interop). MATIC → POL token migration ~85% complete.
Expand Down Expand Up @@ -70,6 +71,7 @@ description: Ethereum Layer 2 landscape — Arbitrum, Optimism, Base, zkSync, Sc
| Maximum EVM compatibility | **Scroll or Arbitrum** | Bytecode-identical |
| Mobile / real-world payments | **Celo** | MiniPay, sub-cent fees, Africa/LatAm focus |
| MEV protection | **Unichain** | TEE-based priority ordering, private mempool |
| Real-time apps / HFT / gaming | **MegaETH** | 10ms mini blocks, 10B gas/block, real-time streaming API |
| Rust smart contracts | **Arbitrum** | Stylus (WASM VM alongside EVM, 10-100x gas savings) |
| Stablecoins / payments / RWA | **Polygon PoS** | $500M+ monthly payment volume, 410M+ wallets |

Expand All @@ -84,6 +86,17 @@ description: Ethereum Layer 2 landscape — Arbitrum, Optimism, Base, zkSync, Sc
- Do NOT use gas-price bidding strategies on Unichain — they're pointless
- **Flashblocks:** Currently 1s blocks, roadmap to 250ms sub-blocks

### MegaETH
- **Launched:** March 2025. Chain ID 4326.
- **Type:** Real-time L2 with EigenDA for data availability.
- **Key innovation: 10ms mini blocks.** MegaETH produces mini blocks every ~10ms and standard EVM blocks every ~1s. The fastest block production of any L2, enabling real-time onchain applications (order books, games, streaming).
- **Realtime API:** Custom JSON-RPC extensions beyond standard Ethereum. `realtime_sendRawTransaction` returns receipts instantly. WebSocket subscriptions for mini blocks enable sub-second event streaming.
- **Capacity:** 10 billion gas per EVM block (vs Ethereum's 60M). Max contract size 512 KB (vs Ethereum's 24 KB).
- **MegaEVM differences:** Multidimensional gas model (compute gas + storage gas). Base intrinsic gas is 60,000 (not 21,000). Base fee is 0.001 gwei (effectively fixed — EIP-1559 adjustment is disabled).
- **EIP-7702:** Live on MegaETH.
- **Primary DEX:** Kumbaya — most liquid DEX on MegaETH with an integrated launchpad.
- **Testnet:** Chain ID 6343, RPC `https://carrot.megaeth.com/rpc`, faucet at https://megaeth.com/faucet.

### Celo
- **Was:** Independent L1 blockchain (2020-2025)
- **Now:** OP Stack L2 on Ethereum — **migrated March 26, 2025** (block 31056500)
Expand Down Expand Up @@ -117,6 +130,18 @@ Members contribute **15% of sequencer revenue** to the Optimism Collective. Cros
- Arbitrum's `block.number` returns L1 block number, not L2.
- **Unichain:** Transactions are priority-ordered by time, not gas. Don't waste gas on priority fees.

### MegaETH
✅ EVM-compatible — standard Solidity contracts deploy without changes.

**Gotchas:**
- **Multidimensional gas:** Transactions consume both compute gas and storage gas. Base intrinsic gas is 60,000 (not 21,000). Gas estimation tools may underestimate.
- **Base fee is 0.001 gwei** — effectively fixed, EIP-1559 adjustment is disabled. Don't hardcode gas assumptions from other chains.
- **Max contract size is 512 KB** (vs 24 KB on Ethereum) — large contracts that don't fit on mainnet can deploy here.
- **Mini blocks (10ms):** Use the Realtime API (`realtime_sendRawTransaction`, WebSocket mini block subscriptions) to take advantage of sub-second latency. Standard `eth_*` RPCs work normally but don't expose mini block granularity.
- **`SELFDESTRUCT` is disabled** (not just deprecated like on Ethereum).

For Foundry configuration, MegaEVM-specific testing patterns, and comprehensive development guides, see the [MegaETH developer skill](https://github.com/0xBreadguy/megaeth-ai-developer-skills) and [awesome-megaeth-ai](https://github.com/0xBreadguy/awesome-megaeth-ai).

### ZK Rollups
- **zkSync Era:** Must use `zksolc` compiler. No `EXTCODECOPY` (compile-time error). 65K instruction limit. Non-inlinable libraries must be pre-deployed. Native account abstraction (all accounts are smart contracts).
- **Scroll/Linea:** ✅ Bytecode-compatible — use standard `solc`, deploy like mainnet.
Expand All @@ -134,6 +159,7 @@ Members contribute **15% of sequencer revenue** to the Optimism Collective. Cros
| Optimism | `https://mainnet.optimism.io` | https://optimistic.etherscan.io |
| Unichain | `https://mainnet.unichain.org` | https://uniscan.xyz |
| Celo | `https://forno.celo.org` | https://celoscan.io |
| MegaETH | `https://mainnet.megaeth.com/rpc` | https://mega.etherscan.io |
| zkSync | `https://mainnet.era.zksync.io` | https://explorer.zksync.io |
| Scroll | `https://rpc.scroll.io` | https://scrollscan.com |
| Linea | `https://rpc.linea.build` | https://lineascan.build |
Expand Down Expand Up @@ -181,6 +207,7 @@ forge create src/MyContract.sol:MyContract \
| Base | Sepolia | 84532 | https://faucet.quicknode.com/base/sepolia |
| Optimism | Sepolia | 11155420 | https://faucet.optimism.io |
| Unichain | Sepolia | 1301 | https://faucet.unichain.org |
| MegaETH | Testnet | 6343 | https://megaeth.com/faucet |

## Further Reading

Expand All @@ -191,6 +218,7 @@ forge create src/MyContract.sol:MyContract \
- **Optimism:** https://docs.optimism.io
- **Unichain:** https://docs.unichain.org
- **Celo:** https://docs.celo.org
- **MegaETH:** https://docs.megaeth.com
- **zkSync:** https://docs.zksync.io
- **Scroll:** https://docs.scroll.io
- **Polygon:** https://docs.polygon.technology
1 change: 1 addition & 0 deletions ship/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ If "what if nobody calls it?" breaks your system, you have a design problem. Fix
| **Base** | Coinbase distribution, smart wallets, account abstraction | Consumer apps, social, onboarding non-crypto users, high-frequency micro-payments |
| **Arbitrum** | Deepest L2 DeFi liquidity, Stylus (Rust contracts) | DeFi protocols that need to compose with existing Arbitrum liquidity |
| **Optimism** | RetroPGF, Superchain ecosystem | Public goods, OP Stack ecosystem plays |
| **MegaETH** | 10ms mini blocks, 10B gas/block, real-time streaming | Real-time apps, order books, games, HFT, anything needing sub-second latency |
| **zkSync / Scroll** | ZK proofs, native account abstraction | Privacy features, ZK-native applications |

**Don't pick an L2 because "mainnet is expensive." Pick an L2 because its superpower fits your app.**
Expand Down