Skip to content

Latest commit

 

History

272 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solidity-by-example 中文翻译

开源授权 GitHub stars GitHub watchers

follow on Twitter

简介

solidity-by-example 文档 简体中文翻译 项目
当前对照英文原站 v 0.8.26solidity-by-example.org)校对并补齐。

Solidity是一种编程语言,专门用于在以太坊区块链上编写智能合约。智能合约是一种自动执行的合约,它们旨在简化和加速各种交易,例如资产转移、投票和奖励分配。Solidity可以让开发人员创建这些合约,并在以太坊网络上部署和运行它们。

Solidity是一种类似于JavaScript的面向对象语言,具有与其他高级编程语言相似的语法和结构。它支持许多计算机科学概念,例如继承、封装和抽象,同时还提供了特定于区块链的功能,例如以太币转账和智能合约事件。

使用Solidity,开发人员可以构建去中心化应用程序(DApps),这些应用程序可以为用户提供更安全、更透明和更可靠的服务。由于Solidity具有向后兼容性,因此开发人员可以轻松地升级他们的智能合约以实现更好的性能和更丰富的功能。


solidity-by-example 是一个展示Solidity各种用法的仓库,本仓库是对于其英语版的翻译。

🔖 目录

顺序与英文原站一致。每篇译文开头有「对应英文原页」链接。黑客攻击请以 Unit5 为准(Unit2 中仍保留若干早期误放入「应用」的旧稿)。

基础

  1. Hello World
  2. 第一个应用
  3. 基本数据类型
  4. 变量
  5. 常量
  6. 不可变
  7. 读写状态变量
  8. 以太币和 Wei
  9. Gas 与 Gas Price
  10. 条件判断
  11. 循环语句
  12. 映射
  13. 数组
  14. 枚举
  15. 用户自定义值类型
  16. 结构体
  17. 数据位置
  18. 瞬时存储
  19. 函数
  20. View 和 Pure 函数
  21. 错误或异常
  22. 函数修饰符
  23. 事件
  24. 高级事件
  25. 构造函数
  26. 继承
  27. 继承状态变量的屏蔽
  28. 调用父合约
  29. 可见性
  30. 接口
  31. Payable
  32. 发送以太币
  33. 回退函数
  34. Call
  35. Delegatecall
  36. 函数选择器
  37. 调用其他合约
  38. 从合约创建合约
  39. Try / Catch
  40. 导入
  41. ABI 编码
  42. ABI 解码
  43. Keccak256 哈希
  44. 验证签名
  45. Gas 优化
  46. 位运算
  47. Unchecked Math
  48. 汇编变量
  49. 汇编条件语句
  50. 汇编循环
  51. 汇编错误
  52. 汇编数学运算

Unit2 应用

Unit3 测试

Unit4 DeFi

Unit5 黑客攻击及预防

Unit6 EVM

Unit7 Foundry

早期施工计划见 issues#2

更新日志

    2023/03/19-2023/06/26 完成  Hello World - Unchecked Math 板块翻译
                          完成  Application 部分的  Ether Wallet -  Precompute Contract Address with Create2 板块翻译
    2023/10/11-2023/10/12 对部分板块进行解释扩充和代码实例的加入
    2024/02/21 优化目录
    2024/06/21 完成 folder:应用,Unit5 黑客攻击及预防
               name:双向支付渠道 众筹基金、英式拍卖、荷兰式拍卖、 多调用,多委托调用,定时锁,汇编中的二进制求幂(应用),重入攻击(黑客攻击及预防)
    2026/08/25 对照 solidity-by-example.org v0.8.26 校对已有译文,
               补齐条件判断、瞬时存储、高级事件、Call/Delegatecall、汇编、
               ERC721/ERC1155、默克尔空投、63/64 Gas 规则、EVM、Foundry、
               Uniswap V3/V4 及其余 DeFi 等全部缺页;示例合约版本升至 0.8.26

❤️ 项目贡献者

永远感谢他们为本社区下项目所作出的贡献!

contrib graph


💐 赞助我们

通过Donate3

Donate3 To Me

Ethereum

                    0x663d5dafe4362927e6dab344e8953b0ad4439d3f

社群宗旨

永远关注知识和技术的进步,而不是价格

在此,我们希望为所有的对Web3未来感兴趣和欲为其“添砖加瓦”的朋友们一起,创造出更美好的Web3未来前景!

(详见关于我们

Star History

Star History Chart

⚠️ 免责声明

The organization that developed this project, "Web3Club", is currently a non-profit open source community, not a company or corporationand.

All translations of the project were developed by members and contributors to the project, and any content in the project is protected by an open source licence,

We always open source the original open source project in accordance with the license of the original open source project before translation.And in accordance with the requirements of the licence,the information of the original English project or the original author will be indicated in the following sections.

If you have any questions about licence or copyright, please read the LICENCE section below or contact us at web3clubCN@outlook.com


📖 LICENCE

Built by China Web3-Club contributors with heart.
Copyright © solidity-by-example.org@solidity-by-example
Chinese Translation copyright © 2023-2026   Web3-Club
ALL RIGHT RESERVED