Skip to content

wesleymassine/solidity-reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

52 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Solidity Complete Reference

From Zero to Professional Developer

Solidity License Status CI

The most comprehensive Solidity learning resource - 33 complete files covering 100% of professional development skills


๐Ÿ“– About This Repository

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

๐Ÿ“š Complete File List

# 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
18 Testing.sol Foundry testing: unit, fuzz, invariant, fork, ERC-4337 Professional
19 Deploy.sol Foundry scripts: deploy, verify, multisig, CI/CD, CREATE2 Professional
20 Integration.md Frontend: ethers.js v6, viem v2, wagmi, ERC-4337 gasless, SIWE Professional
21 DeFi.sol AMM math, flash loans, oracles, liquidations, MEV, governance Professional
22 L2.sol L2 architecture, opcode diffs, bridges, CCIP, LayerZero, zkSync Professional
23 FormalVerification.sol SMTChecker, Certora CVL, Echidna, Halmos, Gambit, invariant design Professional
24 Upgrades.sol Transparent/UUPS/Beacon/Diamond proxies, ERC-7201, storage gaps, slashing, timelocks Professional
25 EIP7702.sol EOA delegation (Pectra), session keys, EIP-1271, sponsored txs, vs ERC-4337 Expert
26 Intents.sol Intent architecture, Dutch auction (UniswapX), solvers, ERC-7521, cross-chain (ERC-7683) Expert
27 RWA.sol Real World Assets, ERC-3643/T-REX, identity registry, compliance modules, DvP, dividends Expert
28 ZKProofs.sol Groth16/PLONK/STARK, ZK coprocessors (Axiom/SP1), nullifiers, ZK airdrop, recursive proofs Expert
29 EigenLayer.sol Restaking, AVS design, operator registration, slashing conditions, EigenPod, rewards Expert
30 UniswapV4.sol Singleton PoolManager, hooks architecture, dynamic fees, TWAMM, limit orders, custom curves Expert
31 Governance.sol Governor + TimelockController, proposal lifecycle, vetoGuardian, Snapshot hybrid, NFT voting Expert
32 Tokenomics.sol Vesting (cliff/linear), Merkle airdrop, bonding curves, staking rewards, veToken, buyback/burn Expert
33 ModularAccounts.sol ERC-7579 modular smart accounts, module types, session keys, ECDSA validator, ERC-4337 + EIP-7702 stack Expert

๐Ÿ“‹ 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)


๐ŸŽฏ Quick Start

1. Clone the Repository

git clone https://github.com/wesleymassine/solidity-reference.git
cd solidity-reference

2. Compile Everything (verified in CI)

All 32 .sol files compile with Foundry and are checked on every push:

forge build          # compile all reference contracts
forge build --sizes  # also report deployed bytecode sizes

Config lives in foundry.toml (solc 0.8.30, via_ir, Cancun EVM). The files are self-contained โ€” no external dependencies to install.

3. Choose Your Learning Path

Beginner 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

Professional Path (3 weeks):

Testing.sol โ†’ Deploy.sol โ†’ Integration.md โ†’ DeFi.sol โ†’ L2.sol โ†’ FormalVerification.sol

Expert Path (3 weeks โ€” 2025/2026 trends):

Upgrades.sol โ†’ EIP7702.sol โ†’ Intents.sol โ†’ RWA.sol โ†’ ZKProofs.sol โ†’ EigenLayer.sol
โ†’ UniswapV4.sol โ†’ Governance.sol โ†’ Tokenomics.sol โ†’ ModularAccounts.sol

4. Study & Practice

  • 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

๐Ÿ‡ง๐Ÿ‡ท Brazilian Community

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


๐ŸŒŸ What Makes This Special

โœจ Comprehensive Coverage

  • 33 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

๐Ÿ”’ Security-First Approach

  • Vulnerable vs secure code comparisons
  • Real-world attack vectors explained
  • Prevention techniques for all common vulnerabilities

โšก Gas Optimization Focus

  • Professional optimization techniques
  • Before/after comparisons
  • Gas cost analysis

๐Ÿ“ Professional Quality

  • Production-ready code patterns
  • Industry standard practices
  • Real-world use cases

๐Ÿ› ๏ธ Development Tools

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

๐Ÿ” Security & Audit Tools

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

โšก Gas Optimization Tools

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

๐Ÿ“– Learning Resources

๐Ÿ“š Official Documentation

๐ŸŽฎ Interactive Learning & Challenges

๐ŸŽฅ Video Courses (Professional Level)

๐Ÿ“ฐ Newsletters & Blogs

๐Ÿ” Security Resources

๐Ÿ’ผ Professional Development

๐Ÿข Audit Firms & Research

๐Ÿ‘ฅ Communities

๐ŸŽฏ Next Steps After This Repository

  1. Build Real Projects: Token, NFT marketplace, DAO, DeFi protocol
  2. Participate in Audits: Code4rena, Sherlock, Immunefi
  3. Read Audit Reports: Study how professionals find vulnerabilities
  4. Contribute to Open Source: OpenZeppelin, Aave, Uniswap
  5. Stay Updated: Follow Ethereum Improvement Proposals (EIPs)
  6. Network: Join Discord/Telegram groups, attend ETHGlobal hackathons

๐ŸŽ“ Topics Covered

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

๐Ÿ’ก Professional Checklist

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

๐Ÿค Contributing

Contributions are welcome! If you find any issues or have suggestions:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -m 'Add some improvement')
  4. Push to the branch (git push origin feature/improvement)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • OpenZeppelin for security patterns
  • Solidity documentation team
  • Ethereum developer community
  • All contributors to this repository

๐Ÿ“Š Stats

  • 33 Complete Files (NEW: ModularAccounts.sol (ERC-7579), Upgrades.sol, EIP7702.sol, Intents.sol, RWA.sol, ZKProofs.sol, EigenLayer.sol, UniswapV4.sol, Governance.sol, Tokenomics.sol)
  • 22,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)
  • ERC-4337 Account Abstraction (2024/2026)
  • EIP-7702 EOA Delegation (Pectra 2025)
  • Intent-based transactions (UniswapX / ERC-7521 / ERC-7683)
  • Real World Assets (ERC-3643 T-REX, DvP settlement)
  • ZK Proofs & Coprocessors (Groth16, SP1, Axiom)
  • EigenLayer Restaking & AVS (operators, slashing, EigenPods)
  • Foundry Testing: unit, fuzz, invariant, fork
  • Brazilian Community Resources ๐Ÿ‡ง๐Ÿ‡ท

๐ŸŒ Connect


โญ 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).

About

Complete Solidity reference with 17 educational files covering beginner to professional level. Includes security patterns, gas optimization, design patterns, and Brazilian community resources. MIT licensed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors