Lesson 1Common contract designs: Ownable, Pausable, ReentrancyGuard, Pull over Push payments, Checks-Effects-Interactions designDiscover basic smart contract designs that boost safety and ease of maintenance. You will build Ownable, Pausable, and ReentrancyGuard, and use Pull over Push and Checks-Effects-Interactions in practical payment processes for real applications.
Building and applying Ownable access controlPausable contracts and emergency haltsReentrancyGuard and defence against reentrancy attacksPull over Push payment flow planningChecks-Effects-Interactions top practicesLesson 2Safe maths and overflow safeguards in Solidity 0.8+: inbuilt checks versus clear libraries (OpenZeppelin SafeMath background)Examine how Solidity 0.8+ inbuilt overflow checks improved arithmetic safety. Compare past SafeMath-style libraries with current methods, and understand when unchecked sections are secure for cost-effective arithmetic tasks in Zambian Web3 setups.
Basics of integer overflow and underflowInbuilt arithmetic checks in Solidity 0.8+Old SafeMath libraries and shifting overApplying unchecked blocks safely for gasTesting arithmetic limits and edge situationsLesson 3State variables, storage versus memory, events, modifiers, and error management (require, revert, assert, custom errors)Master how Solidity keeps and reaches data with state variables, storage, memory, and calldata. Learn to send events, create reusable modifiers, and use require, revert, assert, and custom errors for straightforward error management in contracts.
State variables and storage positionsStorage versus memory versus calldata usePlanning and sending helpful eventsCreating reusable and secure modifiersRequire, revert, assert, and custom errorsLesson 4Function visibility and changeability: public, external, internal, private; view, pure, payableMake clear how function visibility and changeability impact security, gas, and ease of use. Learn when to pick public, external, internal, and private, and how view, pure, and payable affect state updates and value moves in smart contracts.
Public versus external function balancesInternal and private for wrapping upView and pure for read-only workPayable functions and ETH movesPlanning clear and secure APIsLesson 5Planning deposit/withdraw accounting: mapping(address => uint256) balances, events for deposits/withdrawals, managing multiple tokens versus single-token storesLearn to plan secure deposit and withdrawal processes using mappings, events, and token links. Compare single-token and multi-token stores, and manage edge cases like failed moves and odd token actions in practical Web3 vaults.
Mapping balances and accounting rulesSending events for deposits and withdrawalsSingle-token store planning and linksMulti-token stores and token labelsManaging failed moves and token odditiesLesson 6Testing smart contracts: unit testing ideas, setups, mocks for ERC-20 tokens, and test planning (arrange-act-assert)Learn to test smart contracts with a clear method. You will write unit tests, use setups and mocks for ERC-20 tokens, follow arrange-act-assert, and cover edge cases, failures, and event checks for reliable code.
Testing tools and project startArrange-Act-Assert test planningUsing setups for repeatable statesMocking ERC-20 tokens and actionsTesting failures, events, and edge casesLesson 7Solidity language basics: structure, types, visibility, inheritance, and compiler rules (0.8.x details)Build a strong understanding of Solidity structure, types, and visibility guidelines. Explore inheritance, links, compiler rules, and 0.8.x details like custom errors and better type safety for modern smart contract building in Zambia.
Source files, contracts, and basic structureValue types, reference types, and listsFunction and state variable visibilityInheritance, links, and abstract contractsCompiler rules and 0.8.x language shiftsLesson 8Contract upgrade basics and balances: proxy designs (transparent, UUPS) and when to skip upgrades for simple storesUnderstand when and how to upgrade contracts using proxy designs. Compare transparent and UUPS proxies, storage layout limits, and control risks, and see why simple stores might be safer without upgrade features in Web3.
Why upgrade contracts and when to skipTransparent proxy setup and rolesUUPS proxy design and upgrade functionsStorage layout matching and trapsSecurity and control risks of upgradesLesson 9Gas saving basics: storage layout, packing, reducing external calls, and using calldataLearn practical gas saving methods for Solidity contracts. You will check storage layout and packing, cut costly external calls, use calldata, and measure gas use to guide safe small improvements in efficiency.
Understanding gas costs and returnsStorage layout and variable packingReducing external and cross-contract callsUsing calldata for low-cost read-only inputsMeasuring and checking gas useLesson 10ERC-20 token standard deep look: links (IERC20), allowances, approve/transferFrom meanings, return value management and non-standard tokensDive deep into the ERC-20 standard, focusing on the IERC20 link, balances, allowances, and approve/transferFrom processes. Learn to manage return values, non-standard tokens, and safe interaction methods in working contracts.
IERC20 link and needed functionsBalances, totalSupply, and decimals managementApprove and transferFrom allowance processDealing with non-standard ERC-20 tokensSafe ERC-20 interactions with helper libraries