On this page
Back to: L2 Developer Path
0
Objective: stop overpaying for computation — as a user today, as a builder tomorrow.
Every EVM operation has a price. Users optimize by *when* and *how* they transact; builders optimize by writing less work into contracts.
Concept: where gas actually goes
Storage writes dominate (20,000 gas per fresh slot vs 100 for arithmetic). Loops over unbounded arrays, redundant checks, and chatty cross-contract calls are the classic wasters. On L2s, data posting dominates instead — different bottleneck, same discipline.
Hands-on lab (free)
- Compare gas used by a simple transfer vs a swap vs an NFT mint on an explorer — feel the 10-100x spreads.
- Toggle a wallet’s fee settings (low/market/aggressive) on testnet; watch confirmation times differ.
- For builders: pack two
uint256into one slot pattern, or cache array length outside loops — measure the difference on a testnet deploy.
Safety checklist
- Lowballing gas on time-sensitive DeFi exits (liquidations, claims) costs more than it saves.
- “Gas tokens” and refund gimmicks are mostly dead — ignore them.
- On L2s, watch the *data* component; blob congestion is the new fee spike.
Related glossary
Next lesson: reading L2Beat like an auditor.
Course: L2 Developer Path Lesson 8 of 10