Solidity Tutorial
The Ultimate Solidity Course
Who is this course for?
This course is for experienced programmers. If you don’t already know how to code, we suggest picking up Python or JavaScript first then coming back.
If you are new to Solidity, start at the beginning.
However, Solidity developers of all levels can benefit from the resources here in the later sections discuss very advanced topics such as how Tornado Cash works. We also have the only protocol walkthrough of the Compound V3 codebase.
The only paid bootcamp with a free curriculum
Other bootcamps charge hundreds, sometimes thousands of dollars just to see their curriculum. At RareSkills, we believe the entire community benefits when high quality education is freely available. And by free we mean truly free not gated with an email we can monetize later.
The work is truly a public good.
We do hope you will sign up for our bootcamp though! You’ll get time with instructors and a community who have secured billions of dollars in TLV (total locked value).
RareSkills quality
Although this is not a smart contract security course per se, smart contract security researchers regularly refer to the resources here. Our philosophy is that security comes from deeply understanding what you are doing.
Therefore, we don’t create a large list of topics just for the sake of it. We deeply examine non-obvious issues that even experienced Solidity engineers sometimes miss; having taught many through our Solidity Bootcamp we know where the knowledge gaps frequently lie.
Deep understanding should be the expectation for anyone writing code than manages other people’s crypto. As such, our tutorials prioritize generating strong mental models even if it takes more effort to do so.
Finally, we encourage you to compare our tutorials with others on the same subject (and those generated by an AI chatbot).
We are sure you will be impressed at the level of depth, comprehensiveness, and clarity our articles achieve.
Beginner Solidity Tutorial
No email required! This is for experienced programmers who want to get to the point quickly and immediately practice the information they just gained in a highly optimized topic order. We emphasize the unexpected and unusual aspects of the Solidity language while glossing over things we can reasonably assume to be obvious to a competent developer. Aside from an occasional humorous remark, we’ve made the tutorials as short as possible (but not shorter). Although this is a solidity beginner tutorial, it is intended for experienced coders.
There is a distinction between knowing a language, and knowing a domain. Knowing Python doesn’t make you a data scientist, knowing Javascript doesn’t make you a frontend developer, and knowing Kotlin does not make you an Android developer. Similarly, knowing Solidity does not make you an Ethereum smart contract developer. However, Solidity is a prerequisite for developing smart contracts.
18. Application binary interface (ABI encoding)
31. Units of Ethereum: wei, gwei, and ether
Getting Started
Your First Solidity Projects
At this point, you now have enough knowledge to build smart contract projects end to end. If you are new to Solidity we strongly recommend you build these projects, not skip them. You can only learn so much by reading tutorials, some knowledge can only be acquired with practice.

Professional Solidity Style Guide

Common Solidity Beginner Mistakes

Solidity Beginner Projects
Intermediate Topics
Token ERCs, Integers in Depth, and Others
If you already know some Solidity but are ready to move to the next level, this is the section to start.

Detecting if an address is a smart contract

Solidity Function Selector

ERC-721 design and security issues

ERC-1155

ERC-4626

ERC-721 Enumerable

ERC-1363

Signed Integers

Solidity Staticcall EIP-214

OpenZeppelin Ownable2Step

Testing internal functions

Solidity events

Solidity gasleft()

Where to find reentrancy attacks

Generate a random number in Solidity
DeFi Primitives
Design Patterns Used Everywhere
Some building blocks and design patterns occur so frequently in DeFi applications that they are best studied directly. Don’t just read these tutorials, practice the problems at the end.

The staking algorithm of MasterChef and Synthetix

Fixed Point Arithmetic

Flashloans

Chainlink Price Feeds

How DeFi Interest Rates Work
Uniswap V2 Walkthrough
The most forked DeFi protocol
Uniswap V2 is the most forked protocol in DeFi and has inspired several more. The Uniswap V2 Book is a line-by-line examination of the protocol.

Architecture

Price Impact of a Swap

Swap Function

Mint and Burn Functions

Protocol mintFee

TWAP Oracle

UniswapV2Library

Routers

Building a Uniswap V2 Clone
Delegatecalls and Proxies
The web’s most comprehensive resource on upgradeable smart contracts

ABI Encoding

Low-level call in Solidity

Delegatecall

ERC-1967

ERC-7201

Transparent Upgradeable Proxy

Beacon Proxies

Clones

Metaproxy Clones

Nodelegatecall
Solidity Governance
How DAOs coordinate onchain

ERC-20 Votes

Solidity Governance
Compound V3 Walkthrough
Explore the codebase of the most influential lending protocol
Compound V2 is the most forked lending protocol, but it is no longer used, so our walkthrough focuses on Compound V3. Nearly every modern lending protocol takes inspiration from Compound, so if you completely understand the codebase, you will easily be able to understand other DeFi lending protocols.

Architechture of Compound V3

Compound V3 Interest Per Second

Principal vs Present Value and Interest Rate Indexes

cUSDC V3 (Comet) as a non-standard Rebasing Token. CometExt.sol

Collateral, Liquidations, and Reserves in Compound V3

Compound V3 Rewards

UniswapV2Library

Routers

Bulkers in Compound V3
Gas Optimization
The Ultimate guide to improving smart contract efficiency

Ethereum access list transactions

Ultimate List of Solidity Gas Optimization Tricks
Low Level Programming and Bytecode
What happens behind the Solidity compiler
Our Yul Course on Udemy

Smart contract metadata

Smart contract creation cost

Smart contract creation code

EIP 150 and the 63/64 rule for gas
Testing Beyond Unit Testing
Tools to secure your smart contracts
Mistakes in smart contracts can be extremely costly. Therefore, employing as many tools as possible will maximize your chances of success against bugs and hackers.

Invariant Testing in Foundry

Mutation Testing
Advanced Topics in Solidity
For those further on in their Solidity journey

Second Preimage Attack

Precompiled smart contracts

RSA Signatures in Solidity
Tornado Cash Walkthrough
The most in-depth guide to the most significant mixer
