Lesson 1Common contract patterns: Ownable, Pausable, ReentrancyGuard, Pull over Push payments, Checks-Effects-Interactions patternExplore foundational smart contract patterns wey go improve safety and maintainability. You go implement Ownable, Pausable, and ReentrancyGuard, and apply Pull over Push and Checks-Effects-Interactions for real payment flows.
Implementing and using Ownable access controlPausable contracts and emergency stopsReentrancyGuard and reentrancy attack defensePull over Push payment flow designChecks-Effects-Interactions best practicesLesson 2Safe math and overflow protections in Solidity 0.8+: built-in checks vs. explicit libraries (OpenZeppelin SafeMath history)Study how Solidity 0.8+ built-in overflow checks change arithmetic safety. Compare older SafeMath-style libraries with modern patterns, and learn when unchecked blocks dey safe for gas-efficient arithmetic operations.
Integer overflow and underflow fundamentalsBuilt-in arithmetic checks in Solidity 0.8+Legacy SafeMath libraries and migrationUsing unchecked blocks safely for gasTesting arithmetic edge cases and limitsLesson 3State variables, storage vs memory, events, modifiers, and error handling (require, revert, assert, custom errors)Master how Solidity stores and accesses data using state variables, storage, memory, and calldata. Learn to emit events, write reusable modifiers, and apply require, revert, assert, and custom errors for clear error handling.
State variables and storage slotsStorage vs memory vs calldata usageDesigning and emitting useful eventsWriting reusable and safe modifiersRequire, revert, assert, and custom errorsLesson 4Function visibility and mutability: public, external, internal, private; view, pure, payableClarify how function visibility and mutability affect security, gas, and usability. Learn when to use public, external, internal, and private, and how view, pure, and payable influence state changes and value transfers.
Public vs external function trade-offsInternal and private for encapsulationView and pure for read-only logicPayable functions and ETH transfersDesigning clear and safe APIsLesson 5Designing deposit/withdraw accounting: mapping(address => uint256) balances, events for deposits/withdrawals, handling multiple tokens vs single-token vaultsLearn how to design safe deposit and withdrawal flows using mappings, events, and token interfaces. Compare single-token and multi-token vaults, and handle edge cases like failed transfers and unexpected token behavior.
Mapping balances and accounting invariantsEmitting events for deposits and withdrawalsSingle-token vault design and interfacesMulti-token vaults and token identifiersHandling failed transfers and token quirksLesson 6Testing smart contracts: unit testing concepts, fixtures, mocks for ERC-20 tokens, and test structure (arrange-act-assert)Learn how to test smart contracts with a structured approach. You go write unit tests, use fixtures and mocks for ERC-20 tokens, follow arrange-act-assert, and cover edge cases, reverts, and event expectations.
Testing frameworks and project setupArrange-Act-Assert test structureUsing fixtures for repeatable stateMocking ERC-20 tokens and behaviorsTesting reverts, events, and edge casesLesson 7Solidity language basics: syntax, types, visibility, inheritance, and compiler pragmas (0.8.x specifics)Build a solid grasp of Solidity syntax, types, and visibility rules. Explore inheritance, interfaces, compiler pragmas, and 0.8.x specifics such as custom errors and improved type safety for modern smart contract development.
Source files, contracts, and basic syntaxValue types, reference types, and arraysFunction and state variable visibilityInheritance, interfaces, and abstract contractsCompiler pragmas and 0.8.x language changesLesson 8Contract upgradeability basics and trade-offs: proxy patterns (transparent, UUPS) and when to avoid upgrades for simple vaultsUnderstand when and how to upgrade contracts using proxy patterns. Compare transparent and UUPS proxies, storage layout constraints, and governance risks, and see why simple vaults may be safer without upgradeability.
Why upgrade contracts and when to avoid itTransparent proxy architecture and rolesUUPS proxy pattern and upgrade functionsStorage layout compatibility and pitfallsSecurity and governance risks of upgradesLesson 9Gas optimization basics: storage layout, packing, minimizing external calls, and using calldataLearn practical gas optimization techniques for Solidity contracts. You go analyze storage layout and packing, reduce expensive external calls, leverage calldata, and measure gas usage to guide safe micro-optimizations.
Understanding gas costs and refundsStorage layout and variable packingMinimizing external and cross-contract callsUsing calldata for cheap read-only inputsMeasuring and benchmarking gas usageLesson 10ERC-20 token standard deep dive: interfaces (IERC20), allowances, approve/transferFrom semantics, return value handling and non-standard tokensDive deep into the ERC-20 standard, focusing on the IERC20 interface, balances, allowances, and approve/transferFrom flows. Learn to handle return values, non-standard tokens, and safe interaction patterns in production contracts.
IERC20 interface and required functionsBalances, totalSupply, and decimals handlingApprove and transferFrom allowance workflowDealing with non-standard ERC-20 tokensSafe ERC-20 interactions with helper libraries