The most comprehensive Solidity learning resource - 17 complete files covering 100% of professional development skills
This repository contains a complete, professional-grade Solidity reference covering everything from basic syntax to advanced optimization techniques. Each file is extensively commented in English with real-world examples, security warnings, and professional best practices.
Perfect for:
- ๐ Complete beginners starting their blockchain journey
- ๐ป Intermediate developers wanting to fill knowledge gaps
- ๐ Professional developers seeking advanced optimization techniques
- ๐จโ๐ซ Educators looking for comprehensive teaching materials
| # | File | Topics Covered | Level |
|---|---|---|---|
| 1 | DataTypes.sol | All Solidity data types with examples | Beginner |
| 2 | Functions.sol | Complete function reference | Beginner |
| 3 | Inheritance.sol | Inheritance, abstracts, interfaces | Intermediate |
| 4 | Libraries.sol | Library patterns and usage | Intermediate |
| 5 | ControlFlow.sol | Loops, conditionals, error handling | Beginner |
| 6 | Globals.sol | Global variables, units, time | Beginner |
| 7 | Operators.sol | All operators and expressions | Beginner |
| 8 | EtherTransfer.sol | transfer/send/call methods | Intermediate |
| 9 | DataLocation.sol | storage/memory/calldata | Intermediate |
| 10 | Cryptography.sol | Hashing, signatures, verification | Advanced |
| 11 | Assembly.sol | Inline assembly (Yul) | Advanced |
| 12 | Patterns.sol | Design patterns | Advanced |
| 13 | Security.sol | Security & vulnerabilities | Advanced |
| 14 | GasOptimization.sol | Gas optimization techniques | Advanced |
| 15 | Standards.sol | ERC20, ERC721, ERC1155, ERC2981 | Advanced |
| 16 | Imports.sol | Project organization | Intermediate |
| 17 | BestPractices.sol | โญ Bad vs Good code patterns (Senior) | Professional |
๐ See README_ROADMAP.md for detailed learning path
โก See QUICK_REFERENCE.md for commands, patterns & quick lookup
๐๏ธ See PROJECTS.md for hands-on practical projects
๐ง๐ท See BRASIL.md for Brazilian developers guide (Portuguese)
git clone https://github.com/wesleymassine/solidity-reference.git
cd solidity-referenceBeginner Path (4 weeks):
DataTypes.sol โ Operators.sol โ ControlFlow.sol โ Functions.sol โ Globals.sol
Intermediate Path (4 weeks):
DataLocation.sol โ Inheritance.sol โ Libraries.sol โ EtherTransfer.sol โ Cryptography.sol
Advanced Path (4 weeks):
Assembly.sol โ Patterns.sol โ Security.sol โ GasOptimization.sol โ Standards.sol โ BestPractices.sol
- Open files in VS Code, Remix, or your favorite editor
- Read comments thoroughly
- Run examples in Remix IDE
- Modify code and experiment
- Build small projects using each concept
This project now includes complete resources for Brazilian developers:
- ๐ผ Job boards for Web3 positions in Brazil
- ๐ค Portuguese-speaking communities
- ๐ฐ Bounty & freelancing opportunities
- ๐ Learning resources in Portuguese
- ๐ Brazilian hackathons calendar
See BRASIL.md for complete guide in Portuguese
- 17 complete reference files covering all Solidity concepts
- Over 10,000 lines of extensively commented code
- 150+ practical examples demonstrating best practices
- NEW: Bad vs Good code comparisons for professional development
- Vulnerable vs secure code comparisons
- Real-world attack vectors explained
- Prevention techniques for all common vulnerabilities
- Professional optimization techniques
- Before/after comparisons
- Gas cost analysis
- Production-ready code patterns
- Industry standard practices
- Real-world use cases
| Tool | Purpose | Link |
|---|---|---|
| Remix IDE | Quick testing & learning | remix.ethereum.org |
| Hardhat | Professional development | hardhat.org |
| Foundry | Fast Solidity testing | getfoundry.sh |
| VS Code | Code editing | code.visualstudio.com |
| Metamask | Wallet for testing | metamask.io |
| Tool | Purpose | Link |
|---|---|---|
| Slither | Static analysis & vulnerability detection | github.com/crytic/slither |
| Mythril | Security analysis tool | github.com/ConsenSys/mythril |
| Echidna | Fuzzing & property testing | github.com/crytic/echidna |
| Manticore | Symbolic execution tool | github.com/trailofbits/manticore |
| Tenderly | Real-time monitoring & debugging | tenderly.co |
| OpenZeppelin Defender | Security operations platform | openzeppelin.com/defender |
| Tool | Purpose | Link |
|---|---|---|
| hardhat-gas-reporter | Track gas usage in tests | npm: hardhat-gas-reporter |
| Foundry Gas Snapshots | Compare gas usage across versions | Built into Foundry |
| eth-gas-reporter | Mocha reporter for gas costs | npm: eth-gas-reporter |
- Solidity Docs - Official language documentation
- Ethereum.org Developer Docs - Ethereum fundamentals
- OpenZeppelin Docs - Security patterns & contracts
- Consensys Best Practices - Security guide
- CryptoZombies - Interactive Solidity tutorial
- Ethernaut - Security challenges (18 levels)
- Damn Vulnerable DeFi - DeFi security challenges
- Capture The Ether - Security CTF challenges
- Secureum Bootcamp - Advanced security training
- Patrick Collins - Smart Contract Developer - Free comprehensive course
- Smart Contract Programmer - Advanced topics
- Cyfrin Updraft - Free professional courses
- Alchemy University - Web3 development
- Week in Ethereum - Weekly updates
- Immunefi Blog - Security & bug bounties
- Trail of Bits Blog - Security research
- OpenZeppelin Blog - Best practices
- Consensys Diligence - Audit reports
- SWC Registry - Smart Contract Weakness Classification
- Rekt News - DeFi hack analysis
- Blockchain Threat Intelligence - Security newsletter
- Solodit - Audit report database
- Code4rena - Competitive audits
- ChainLink Documentation - Oracles & automation
- The Graph Docs - Indexing & querying
- IPFS Docs - Decentralized storage
- Uniswap V3 Book - DeFi protocol deep dive
- MEV Research - MEV & transaction ordering
- Trail of Bits - Security auditing
- OpenZeppelin - Smart contract audits
- Consensys Diligence - Security services
- ChainSecurity - Audits & tools
- Certora - Formal verification
- Ethereum Stack Exchange - Q&A platform
- r/ethdev - Reddit community
- Discord: Foundry - Foundry support
- Discord: Hardhat - Hardhat support
- Twitter/X - Follow: #Solidity #EthDev #SmartContracts
- Build Real Projects: Token, NFT marketplace, DAO, DeFi protocol
- Participate in Audits: Code4rena, Sherlock, Immunefi
- Read Audit Reports: Study how professionals find vulnerabilities
- Contribute to Open Source: OpenZeppelin, Aave, Uniswap
- Stay Updated: Follow Ethereum Improvement Proposals (EIPs)
- Network: Join Discord/Telegram groups, attend ETHGlobal hackathons
Data Types & Basics
- Boolean, integers, addresses
- Fixed-size arrays, dynamic arrays
- Strings, bytes
- Mappings, structs, enums
- Constants, immutables
Functions & Control Flow
- Function visibility (public, private, external, internal)
- State mutability (pure, view, payable)
- Modifiers, events, errors
- Loops, conditionals
- Error handling (require, assert, revert, try-catch)
Advanced Concepts
- Inheritance patterns
- Abstract contracts & interfaces
- Libraries & using for
- Storage, memory, calldata
- Inline assembly (Yul)
Security & Best Practices
- Reentrancy protection
- Access control patterns
- Front-running prevention
- Signature verification
- Common vulnerabilities
Gas Optimization
- Storage packing
- Calldata optimization
- Loop techniques
- Batch operations
- Assembly optimization
Standards & Patterns
- ERC20, ERC721, ERC1155
- Factory pattern
- Proxy/Upgradeable contracts
- Design patterns
- Project organization
After completing this reference, you will be able to:
- โ Write secure, production-ready smart contracts
- โ Implement all major token standards (ERC20, ERC721, ERC1155)
- โ Optimize contracts for minimal gas costs
- โ Prevent common security vulnerabilities
- โ Use advanced patterns (proxy, factory, etc.)
- โ Write comprehensive tests
- โ Deploy to mainnet confidently
- โ Perform code reviews
- โ Read and understand complex protocols
Contributions are welcome! If you find any issues or have suggestions:
- Fork the repository
- Create your feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -m 'Add some improvement') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenZeppelin for security patterns
- Solidity documentation team
- Ethereum developer community
- All contributors to this repository
- 17 Complete Files (NEW: BestPractices.sol added!)
- 10,000+ Lines of Code
- 150+ Examples
- 15+ Design Patterns
- 20+ Security Topics
- 50+ Gas Optimization Techniques
- 15+ Bad vs Good Pattern Comparisons
- 15+ Practical Projects (Beginner to Professional)
- Brazilian Community Resources ๐ง๐ท
- Issues: GitHub Issues
- Discussions: GitHub Discussions
โญ If this repository helps you, please give it a star! โญ
Made with โค๏ธ for the Ethereum developer community ๐ง๐ท
โThis repo is a learning/reference resource (not audited production contracts).