WTF-Solidity README

The project's README from github.com/AmazingAng/WTF-Solidity. As one markdown file: README.md.

logo

:globe_with_meridians: English / Español / Português Brasileiro :globe_with_meridians:

WTF Solidity

我最近在重新学Solidity,巩固一下细节,也写一个“WTF Solidity极简入门”,供小白们使用(编程大佬可以另找教程),每周更新1-3讲。

路线图根据本仓库star数量来定:

入门

第1讲:三行代码HelloWeb3:代码 | 文章

第2讲:值类型:代码 | 文章

第3讲:函数 (external/internal/public/private, pure/view, payable):代码 | 文章

第4讲:函数输出(returns/return):代码 | 文章

第5讲:变量作用域和数据存储 (storage/memory/calldata):代码 | 文章

第6讲:数组(array)和结构体(struct):代码 | 文章

第7讲:映射(mapping):代码 | 文章

第8讲:变量初始值:代码 | 文章

第9讲:常量(constant/immutable):代码 | 文章

第10讲:控制流和插入排序:代码 | 文章

第11讲:构造函数(constructor)和修饰器(modifier):代码 | 文章

第12讲:事件(events):代码 | 文章

第13讲:继承:代码 | 文章

第14讲:抽象合约(abstract)和接口(interface):代码 | 文章

第15讲:异常(errors):代码 | 文章

进阶

第16讲:函数重载:代码 | 文章

第17讲:库合约(library):代码 | 文章

第18讲:Import:代码 | 文章

第19讲:接收ETH(fallback/receive):代码 | 文章

第20讲:发送ETH(transfer/send/call):代码 | 文章

第21讲:调用其他合约:代码 | 文章

第22讲:Call:代码 | 文章

第23讲:Delegatecall:代码 | 文章

第24讲:在合约中创建新合约:代码 | 文章

第25讲:Create2:代码 | 文章

第26讲:删除合约:代码 | 文章

第27讲:ABI编码解码:代码 | 文章

第28讲:Hash:代码 | 文章

第29讲:函数选择器(selector):代码 | 文章

第30讲:Try-Catch:代码 | 文章

应用

第31讲:ERC20:代码 | 文章

第32讲:代币水龙头:代码 | 文章

第33讲:空投合约:代码 | 文章

第34讲:ERC721:代码 | 文章

第35讲:荷兰拍卖:代码 | 文章

第36讲:Merkle Tree:代码 | 文章

第37讲:数字签名:代码 | 文章

第38讲:NFT交易所:代码 | 文章

第39讲:随机数:代码 | 文章

第40讲:ERC1155:代码 | 文章

第41讲:WETH:代码 | 文章

第42讲:分账:代码 | 文章

第43讲:线性释放:代码 | 文章

第44讲:代币锁:代码 | 文章

第45讲:时间锁:代码 | 文章

Degen

第46讲:代理合约:代码 | 文章

第47讲:可升级合约:代码 | 文章

第48讲:透明代理:代码 | 文章

第49讲:通用可升级代理UUPS:代码 | 文章

第50讲:多签钱包:代码 | 文章

第51讲:ERC4626 代币化金库:代码 | 文章

第52讲:EIP712 类型化数据签名:代码 | 文章

第53讲:ERC2612 ERC20Permit:代码 | 文章

第54讲:跨链桥:代码 | 文章

第55讲:多重调用:代码 | 文章

第56讲:去中心化交易所:代码 | 文章

第57讲:闪电贷:代码 | 文章

合约安全

S01:重入攻击:代码 | 文章

S02:选择器碰撞:代码 | 文章

S03:中心化:代码 | 文章

S04:权限管理:代码 | 文章

S05:整型溢出:代码 | 文章

S06:签名重放:代码 | 文章

S07:坏随机数:代码 | 文章

S08:绕过合约检查:代码 | 文章

S09:拒绝服务漏洞:代码 | 文章

S10:貔貅 Honeypot:代码 | 文章

S11:抢先交易:代码 | 文章

S12:tx.origin钓鱼:代码 | 文章

S13:未检查的低级调用:代码 | 文章

S14:操纵区块时间:代码 | 文章

S15:操纵预言机:代码 | 文章

S16:NFT重入攻击:代码 | 文章

S17:“跨服”重入攻击:文章

EVM 操作码

OP01:Hello Opcodes:代码 | 文章

OP02:Opcodes分类:代码 | 文章

OP03:堆栈指令:代码 | 文章

OP04:算术指令:代码 | 文章

OP05:比较指令:代码 | 文章

OP06:位级指令:代码 | 文章

OP07:内存指令:代码 | 文章

OP08:存储指令:代码 | 文章

OP09:控制流指令:代码 | 文章

OP10:区块信息指令:代码 | 文章

OP11:堆栈指令2:代码 | 文章

OP12:SHA3指令:代码 | 文章

OP13:账户指令:代码 | 文章

OP14:交易指令:代码 | 文章

OP15:Log指令:代码 | 文章

OP16:Return指令:代码 | 文章

OP17:Revert指令:代码 | 文章

OP18:Call指令:代码 | 文章

OP19:Delegatecall指令:代码 | 文章

OP20:Staticcall指令:代码 | 文章

OP21:Create指令:代码 | 文章

OP22:Create2指令:代码 | 文章

OP23:Selfdestruct指令:代码 | 文章

OP24:Gas指令:代码 | 文章

OP25:优化最小代理合约 EIP-7511:代码 | 文章

Solidity 内部规则

SI01:基础存储布局:代码 | 文章

SI02:映射和动态数组的存储布局:代码 | 文章

SI03:字节数组和字符串的存储布局:代码 | 文章

SI04:内存布局:代码 | 文章

SI05:ABI编码基础:代码 | 文章

SI06:动态类型的ABI编码:代码 | 文章

SI07:ABI编码公式:代码 | 文章

SI08:calldata/returndata的ABI编码:代码 | 文章

SI09:事件的ABI编码:代码 | 文章

SI10:Error的ABI编码:代码 | 文章

主题

开发工具

第1讲:Remix, 最易用的Solidity IDE 文章

第2讲:Infura, 连接链下与链上的桥梁 文章

第3讲:Ganache,搭建本地测试网络 文章

第4讲:Alchemy, 区块链API和节点基础设施 文章

第5讲:Dune,使用Dune可视化区块链数据 文章

第6讲:Hardhat,以太坊开发环境 文章

第7讲:Foundry,以Solidity为中心的开发工具包 代码 | 文章

第8讲:ZAN,节点服务和合约审计等Web3技术服务 文章

链上威胁分析

第1讲:工具篇 文章 | 英文文章

第2讲:热身篇 文章 | 英文文章

第3讲:漏洞概念验证-上篇 文章 | 英文文章

第4讲:漏洞概念验证-中篇 文章 | 英文文章

第5讲:漏洞概念验证-下篇 文章 | 英文文章

第6讲:Rugpull 分析 文章 | 英文文章

第7讲:Nomad 跨链桥事件分析 文章| 英文文章

NFT

第1讲:ERC721库:Address, Strings, Context 代码 | 文章

第2讲:ERC721相关接口 代码 | 文章

第3讲:ERC721主合约 代码 | 文章

第4讲:BAYC主合约和严重漏洞 代码 | 文章

第5讲:Loot 代码 | 文章

翻译

第1讲:MetaMask项目方给Solidity程序员的16个安全建议 文章

第2讲:深入EVM 文章

WTF贡献者

贡献者是WTF学院的基石

捐赠

参考

WTF-Solidity (AmazingAng/WTF-Solidity)

Searching Database…

What is this?WTF Solidity is a free, beginner-friendly tutorial series for learning Solidity (Ethereum smart contract language), organized into short lessons with code examples and articles, going from basics to advanced topics and contract security.
Is this a coding framework or a learning curriculum?It's a curated curriculum of short lessons, each with a code example and an accompanying article, not a library or framework you import into a project.
How is the material organized and where should a beginner start?Lessons are grouped into sections: Beginner basics (1-15), Advanced (16-30), Applications like ERC20/ERC721/airdrops (31-45), Degen topics like proxies and upgradeable contracts (46-57), Contract Security (S01-S17), EVM Opcodes (OP01-OP25), and Solidity Internals (SI01-SI10), plus special topics like dev tools and NFTs. A beginner should start at Lesson 1 'HelloWeb3' and work through numerically.
Do I need any special tools to follow along?No special tools are required to read the lessons; the dev-tools topic section separately covers tools like Remix, Hardhat, Foundry, and Ganache for actually running the Solidity code.
Is it actively updated and complete?It updates 1-3 lessons per week and some roadmap items like the teaching videos and community NFT are still unchecked/not done, so parts of the planned content are still pending.
Is this only in Chinese?No, it now supports English (and Spanish/Portuguese), alongside the original Chinese content.
Does it cover smart contract security and common exploits?Yes, a dedicated Contract Security section (S01-S17) covers reentrancy attacks, selector clashing, integer overflow, signature replay, honeypots, front-running, oracle manipulation, and more.
Are there lessons on EVM internals and bytecode?Yes, the EVM Opcodes section (OP01-OP25) and Solidity Internals section (SI01-SI10) dig into opcodes, storage layout, memory layout, and ABI encoding at a low level.
What real-world contract patterns does it teach?The Applications and Degen sections walk through building ERC20/ERC721/ERC1155 tokens, Dutch auctions, Merkle tree airdrops, digital signatures, upgradeable proxies (UUPS), multisig wallets, flash loans, and a decentralized exchange.
Is there an official website for this tutorial?Yes, the project has an official site at wtf.academy with additional content like course certification SBTs.
Creator
AmazingAng
Size
230.3 MB
Stars
14.1K
Updated
CommitOct 11
Age
4y
Commits · 90 Days