Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Gas is the EVM's resource meter — every opcode has a fixed or computed cost, and a transaction that runs out reverts entirely (but still pays for what was used). Understanding how gas is debited per-opcode is the foundation of all on-chain optimization work, and it's the only way to predict whether your contract will hit the block gas limit at scale.
Trace the gas debited by a single SSTORE and a single MSTORE.
cast estimate <addr> <calldata> for a transaction that writes one new storage slot and confirm the estimate is ≥22100 + base.transfer(uint256) call on an ERC20 — it's the SSTORE that updates the recipient balance.// Gas costs (post-Berlin, Berlin/London/Shanghai):
ADD // 3
MLOAD // 3 + memory expansion
MSTORE // 3 + memory expansion
SLOAD cold // 2100 (EIP-2929)
SLOAD warm // 100
SSTORE new // 22100 (zero -> non-zero)
SSTORE update // 5000 (non-zero -> non-zero)
SSTORE clear // refund: 4800 (non-zero -> zero), capped
CREATE // 32000 + bytecode cost
CALL // 100 base + EIP-2929 access + 2300 stipend if value transfer
LOG3 // 1500 + 256*topics + 8*databytes