Hitchhiker’s Guide to the EVM
summary
Practical EVM gas rules: avoid persistent storage when the data is never read again and emit events instead of storage, which in an example saves ~25,000 gas; prefer s_store/s_load alternatives like constants or immutables to cut repeated loads (example: 2.5k gas → 450); minimize reads by caching storage to memory (small examples save ~500 gas); account for EIP‑2929 cold/warm access; and pack structs (32‑byte slots, use uint96 and reorder fields) to halve slot usage.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:30Topics
- 1:27Gas Golfing
- 4:29Dont Store
- 6:32Use Constants
- 8:27Make it Obvious
- 9:35Dont ReadWrite Too Often
- 12:41Pack Your structs
- 14:00Structure
- 14:41Storage
- 16:25Uint 96
- 17:26Two Slots
- 18:54Recap
- 19:51Outro
related talks
19mThe Art of Huff
28mSigVM: Enabling Event-Driven Execution for Truly Decentralized Smart Contracts
16mImagining a world with Ethereum
28mSolidity Best Practices - 10 Tips
21mScaffold-Eth, OpenZeppelin, and EVM Optimization
14mEVM - Cosmos Convergence Research From Security
30mPractical Zero Knowledge Proofs
50mBlockchain and Smart contracts
