Appendices

Syntax cheat sheet, keywords and reserved words, global variables & functions reference, version history, learning resources and 12-week study plan.

Appendices

A. Syntax cheat sheet B. Keywords and reserved words contract, interface, library, abstract, struct, enum, event, error, modifier, function, constructor, receive, fallback, type, using, import, pragma

public, external, internal, private pure, view, payable, constant, immutable, transient

is, virtual, override, super, this storage, memory, calldata (transient for state vars)

if, else, for, while, do, break, continue, return, try, catch, revert, emit, unchecked, assembly

bool, int, uint, intN, uintN, address, bytes, bytesN, string, mapping, fixed, ufixed

new, delete, indexed, anonymous, returns, true, false, wei, gwei, ether, seconds, minutes, hours, days, weeks, global, layout, at Reserved for future use

after, alias, apply, auto, byte, case, copyof, default, define, final, implements, in, inline, let, macro, match, mutable, null, of, partial, promise, reference, relocatable, sealed, sizeof, static, supports, switch, typedef, typeof, var

C. Global variables & functions reference Returns / effect address — immediate caller uint256 — wei sent bytes calldata — full calldata bytes4 — selector address — transaction originator uint256 — effective gas price

block.number, block.timestamp, block.chainid block.basefee, block.blobbasefee, block.gaslimit, block.prevrandao address payable

blockhash(uint256) / blobhash(uint256) abi.encode, abi.encodePacked, abi.encodeWithSelector, abi.encodeWithSignature, abi.encodeCall bytes memory abi.decode(bytes, (T...))

bytes.concat(...), string.concat(...) keccak256, sha256

ecrecover(bytes32, uint8, bytes32, bytes32) address (0 on error) addmod(x, y, k), mulmod(x, y, k)

require(bool[, string | error]), assert(bool), revert(...) selfdestruct(address payable) address.balance, .code, .codehash uint256, bytes memory, bytes32 (bool, bytes memory)

payable.transfer(uint256) / .send(uint256) revert / bool (2300 gas)

type(C).name, .creationCode, .runtimeCode type(T).min, type(T).max T.wrap, T.unwrap f.selector, f.address function selector / contract address of external function event topic or error selector D. Version history early mainstream; emit (0.4.21), constructor keyword (0.4.22) explicit data locations and visibility, address payable, stricter typing

virtual/override, abstract, try/catch, receive/fallback

now removed, call options {value: }, no constructor visibility, finney/szabo removed checked arithmetic, unchecked, ABI coder v2 default custom errors, bytes.concat user-defined value types

abi.encodeCall, string.concat, file-level using for prevrandao, named mapping params, selfdestruct deprecated Shanghai default (PUSH0) file-level events, auto-unchecked loop increments

Cancun: tstore/tload, mcopy, blobhash, blobbasefee Cancun default EVM require with custom errors transient state variables custom storage layout (layout at), experimental EOF Prague default EVM

Osaka support, deprecations ahead of 0.9 E. Learning resources

Solidity documentation — docs.soliditylang.org (language reference, style guide, security considerations).

Ethereum.org developer docs; EIPs at eips.ethereum.org.

Foundry Book (getfoundry.sh), Hardhat docs (hardhat.org), OpenZeppelin docs, viem.sh, wagmi.sh.

Interactive & courses Solidity by Example (solidity-by-example.org).

Cyfrin Updraft (free Solidity, Foundry, security, and assembly courses).

CryptoZombies (gamified beginner course).

Speedrun Ethereum / Scaffold-ETH 2 (build-and-ship challenges).

RareSkills (Solidity, gas optimization, Yul, ZK) blog and books.

Security practice Ethernaut (OpenZeppelin), Damn Vulnerable DeFi, Capture the Ether (archived), Paradigm CTF archives.

Solodit, rekt.news, Code4rena/Sherlock/Cantina reports, Secureum, Trail of Bits "Building Secure Contracts".

*Mastering Ethereum* — Andreas M. Antonopoulos & Gavin Wood (O'Reilly; free on GitHub).

*Hands-On Smart Contract Development with Solidity and Ethereum* — Kevin Solorio, Randall Kanna & David H. Hoover (O'Reilly).

*Solidity Programming Essentials* — Ritesh Modi (Packt).

*Mastering Blockchain* — Imran Bashir (Packt).

*The Book of Gas Optimization* and *Ultimate Solidity Interview Questions* — RareSkills (free online).

*How to DeFi: Advanced* — CoinGecko (DeFi concepts).

Reference code to read OpenZeppelin Contracts, Solady, Uniswap v2/v3/v4, Aave v3, Compound v3 (Comet), Morpho Blue, Safe, eth-infinitism account-abstraction.

F. 12-week study plan Blockchain, EVM, accounts, gas; Remix deploy HelloWorld to Sepolia

Types, data locations, control flow, globals Part I exercises Functions, modifiers, events, errors Bank with custom errors and events

Ether transfers, inheritance, interfaces, libraries escrow + library-based utilities

UDVTs, ABI, contract creation; Foundry basics CREATE2 factory with tests; Part II exercises

Low-level calls, storage layout, gas optimization gas-optimized refactor with snapshots Assembly/Yul, proxies & upgradeability UUPS upgrade with storage checks

Token standards, EIP-712, permit, ERC-4626, ERC-4337 ERC-20 + ERC-721 + vault Security deep dive; Ethernaut levels exploit + fix tests for 5 vulnerability classes

Fuzz, invariant, fork testing; Slither; formal verification intro invariant suite; Part III exercises DeFi, NFTs, DAOs, oracles, L2s AMM or staking project

Frontend, deployment, verification; capstone capstone deployed, verified, with frontend 🎓 Final Words

Solidity is small enough to learn in weeks but deep enough to master over years, because the language is only half the craft — the other half is the adversarial, immutable, gas-metered environment it runs in. Write simple code, lean on audited libraries, test with fuzzing and invariants, think like an attacker, and treat every deployment as permanent. Read real protocols, play security CTFs, ship small projects to testnets, and contribute to open source. The EVM ecosystem keeps evolving — transient storage, account abstraction, EIP-7702, new L2s, and the upcoming Solidity 0.9 — so keep reading release notes and EIPs. Build carefully, and build things worth trusting.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

error Unauthorized(address caller);              // file-level error
type Amount is uint256;                          // user-defined value type

interface ICounter { function count() external view returns (uint256); }

library L { function double(uint256 x) internal pure returns (uint256) { return x * 2; } }

abstract contract Base { function _hook() internal virtual; }

contract CheatSheet is Base, ICounter {
    using L for uint256;

    // --- Types & state ---
    enum State { Idle, Running }
    struct User { address addr; uint96 balance; }
    uint256 public constant FEE = 30;             // compile-time constant
    address public immutable owner;               // set in constructor
    uint256 public count;                         // storage
    bool transient busy;                          // transient storage (0.8.28+)
    mapping(address => User) public users;
    uint256[] public list;
    State public state;

    // --- Events ---
    event Updated(address indexed by, uint256 value);

    // --- Modifiers ---
    modifier onlyOwner() { if (
…