Master Solidity from first principles through hands-on projects
This repository is a comprehensive Solidity education platform designed to take you from complete beginner to production-ready smart contract developer through 47 progressively complex mini-projects.
This repository contains a complete Solidity learning curriculum built with Foundry, covering everything from basic datatypes to building full DeFi protocols.
solidity-edu/
βββ README.md # This file - high-level overview
βββ foundry/ # Main learning directory (47 mini-projects)
β βββ README.md # Complete curriculum guide & navigation
β βββ 01-datatypes-and-storage/
β βββ 02-functions-and-payable/
β βββ ... (47 projects total)
β βββ 50-defi-capstone/
βββ edu.md # Combined educational content from all projects
βββ .env.example # Environment variable template
βββ LICENSE # MIT License
-
Install Foundry:
curl -L https://foundry.paradigm.xyz | bash foundryup -
Clone the repository:
git clone <repo-url> cd solidity-edu
-
Set up environment:
cp .env.example .env # Uses default Anvil accounts for local development -
Install dependencies:
cd foundry forge install
- Start here: Read
foundry/README.mdfor the complete curriculum guide - Begin learning: Navigate to
foundry/01-datatypes-and-storage/ - Follow along: Each project has its own README with learning objectives
- Track progress: Use the progress tracker in
foundry/README.md
The curriculum is organized into 5 tracks:
-
Beginner Foundations (Projects 1-10)
- Datatypes, storage, functions, events, modifiers
- Learn Solidity basics and EVM fundamentals
-
Intermediate Concepts (Projects 11-20)
- Reentrancy, ETH transfers, oracles, encoding
- Master security patterns and advanced features
-
Token Standards (Projects 22-30)
- ERC-20, ERC-721, ERC-1155, soulbound tokens
- Implement all major token standards from scratch
-
Security & Attacks (Projects 31-40)
- Reentrancy, overflow, MEV, oracle manipulation
- Learn attack vectors and defense strategies
-
DeFi Engineering (Projects 11, 42-50)
- ERC-4626 vaults, yield strategies, flash loans
- Build production-grade DeFi protocols
Total: 47 projects, ~140-190 hours of learning
Note: Projects 21, 24, and 41 are not included in the sequence.
- First Principles: Understand why Solidity works the way it does
- Security First: Learn vulnerabilities and attack vectors from day 1
- Production Ready: Use industry-standard tools (Foundry, OpenZeppelin)
- Comprehensive: Every project includes skeleton code, tests, solutions, and deployment scripts
- Deep Documentation: Extensive inline comments explaining computer science concepts
- Comparative Learning: Compare Solidity with TypeScript, Go, Rust, and Python
- Gas Awareness: Every lesson discusses computational costs and optimizations
-
foundry/README.md - Complete curriculum guide
- 47-project breakdown
- Learning tracks and paths
- Quick reference for Foundry commands
- Navigation and progress tracking
-
edu.md - Combined educational content
- All 47 project READMEs in one file
- Searchable reference for concepts
- Great for offline reading or printing
Each project directory contains:
README.md- Project-specific learning objectives and taskssrc/- Skeleton contracts and solution implementationstest/- Test suites and solution testsscript/- Deployment scripts and examples
- Solidity ^0.8.20 - Smart contract programming language
- Foundry - Development framework
- Forge - Testing and building
- Cast - Interacting with contracts
- Anvil - Local Ethereum node
- OpenZeppelin - Audited contract libraries
- Solmate - Gas-optimized primitives
- Start with Project 01 (Datatypes & Storage)
- Follow the curriculum sequentially through Project 10
- Use the "Complete Beginner" track in
foundry/README.md - Estimated time: 3-6 months (part-time)
- Review Projects 01-05 quickly for Solidity-specific concepts
- Jump to areas of interest (tokens, NFTs, vaults, security)
- Use the "Experienced Developer" track in
foundry/README.md - Estimated time: 2-4 months (part-time)
- Want to build a token? β Projects 01-05, 08, 22-23
- Want to build an NFT? β Projects 01-05, 09, 25-30
- Want to build a vault? β Projects 01-05, 11, 20, 42-50
- Want to learn security? β Projects 01-10, 11, 31-40
See foundry/README.md for detailed learning paths.
# Test everything
cd foundry
forge test
# Test specific project
cd foundry/01-datatypes-and-storage
forge test
# Test with verbose output
forge test -vvv
# Test with gas reporting
forge test --gas-report# Build all contracts
cd foundry
forge build
# Build with sizes (check 24KB limit)
forge build --sizes
# Force rebuild
forge build --forceAfter completing this curriculum, you will:
β Understand EVM internals and gas mechanics β Write production-grade Solidity with security best practices β Implement all major ERC standards (20, 721, 1155, 4626) β Master Foundry for testing, fuzzing, and deployment β Recognize and prevent common attack vectors β Optimize contracts for gas efficiency β Design upgradeable systems with proxy patterns β Build complex DeFi protocols β Conduct security audits and code reviews β Understand MEV, front-running, and economic exploits
Found a bug or have a suggestion? Please open an issue or pull request!
Guidelines:
- Add tests for any new features
- Follow existing code style (
forge fmt) - Update documentation
- Ensure all tests pass:
forge test
MIT License - Learn freely, build responsibly.
See LICENSE for details.
- Foundry Book: https://book.getfoundry.sh/
- Solidity Docs: https://docs.soliditylang.org/
- OpenZeppelin: https://docs.openzeppelin.com/
- Ethereum.org: https://ethereum.org/en/developers/docs/
- Smart Contract Security: https://consensys.github.io/smart-contract-best-practices/
- Read
foundry/README.mdfor the complete curriculum guide - Start with Project 01:
cd foundry/01-datatypes-and-storage - Join the community and share your progress!
Remember: Smart contracts control real value. Test extensively, audit professionally, and never deploy experimental code to mainnet with funds at risk.
Security is not optional. Gas optimization comes after correctness.
Happy learning! π