Everwhy Open Everwhy
Computing

Could you write a program that thousands of computers run exactly the same way?

Solidity 101 · about 13 minutes a level

Learn to read and write Solidity, the main language for Ethereum smart contracts: its syntax and types, functions and visibility, modifiers and events, where data lives (storage, memory and calldata), and how contracts report errors. You'll test everything on a private chain in your browser or on your computer, and on a public test network with free test ether, then learn the security basics (reentrancy, access control and integer issues) and what an audit does. Everything in this class runs on test networks only, never with real money.

Open in Everwhy Continue on the web

Go deeper, level by level

  1. First contracts: Your first contract, Value types: integers, booleans and addresses, Functions and visibility
  2. Data and where it lives: Storage, memory and calldata, Arrays, bytes and strings, Mappings, Structs and enums
  3. Control flow and modifiers: Conditions, loops and gas, Function modifiers, Constructors, constant and immutable
  4. Events and errors: Events and logs, require, revert and assert, Custom errors and try/catch
  5. Ether, calls and inheritance: Receiving ether: payable, receive and fallback, Sending ether safely, Interfaces: talking to other contracts, Inheritance and libraries
  6. Testing on local and test networks: Tools: Remix, Hardhat and Foundry in outline, Writing unit tests, Deploying to a test network
  7. Security basics: Reentrancy and checks-effects-interactions, Access control, Integer issues: overflow, underflow and precision, More pitfalls: randomness, front-running and denial of service
  8. Audits and a small project: What an audit is, Static analysis, fuzzing and invariants, Project: plan a class poll contract, Project: build, test and deploy the poll on a test network

Every lesson shows its sources and how sure we are, and is checked by Everwhy.