写在前面:HiBlock区块链社区成立了翻译小组,翻译区块链相关的技术文档及资料,本文为Solidity文档翻译的第十二部分《已知bug列表》,特发布出来邀请solidity爱好者、开发者做公开的审校,您可以添加微信baobaotalk_com,验证输入“solidity”,然后将您的意见和建议发送给我们,也可以在文末“留言”区留言,有效的建议我们会采纳及合并进下一版本,同时将送一份小礼物给您以示感谢。

在下面,你可以找到一个 JSON 格式的列表,上面列出了 Solidity 编译器上一些已知的安全相关的 bug。 该文件被放置于 Github 仓库(https://github.com/ethereum/solidity/blob/develop/docs/bugs.json) 。 该列表可以追溯到 0.3.0 版本,只在此版本之前存在的 bug 没有被列入。

这里,还有另外一个 bugs_by_version.json 文件(https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json)。 该文件可用于查询特定的某个编译器版本会受哪些 bug 影响。

合约的源文件检查工具以及其他与合约交互的工具,需基于以下规则查阅上述 bug 列表文件:

  • 如果合约是用每日构建版本的编译器编译,而不是发布版本的编译器,那就有点可疑了。上述bug列表不跟踪未发布或每日构建版本的编译器。

  • 如果一个合约并不是由它被创建时点的最新版本编译器所编译的,那么这也是值得怀疑的。对于由其他合约创建的合约,您必须沿着创建链追溯最初交易,并使用该交易的日期作为创建日期。

  • 高度可疑的情况是,如果一份合约由一个包含已知 bug 的编译器编译,但在合约创建时,已修复了相应 bug 的新版编译器已经发布了。

下面这份包含已知 bug 的 JSON 文件实际上是一个对象数组,每个对象对应一个 bug,并包含以下的 keys :

name

赋予该 bug 的唯一的名字

summary

对该 bug 的简要描述

description

对该 bug 的详细描述

link

包含更多详尽信息的链接,可选

introduced

第一个包含该 bug 的编译器的发布版本,可选

fixed

第一个不再包含该 bug 的编译器的发布版本

publish

该 bug 被公开的日期,可选

severity

bug 的严重性: very low, low, medium, high。综合考虑了在合约测试中的可发现性、发生的可能性和被利用后的潜在损害。

conditions

触发该 bug 所需满足的条件。当前,这是一个包含了 optimizer 布尔值的对象,这意味着只有打开优化器选项时,才会触发该 bug。 如果没有给出任何条件,则意味着此 bug 始终存在。

[{"name": "OneOfTwoConstructorsSkipped","summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.","description": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored. There will be a compiler warning about the old-style constructor, so contracts only using new-style constructors are fine.","introduced": "0.4.22","fixed": "0.4.23","severity": "very low"},{"name": "ZeroFunctionSelector","summary": "It is possible to craft the name of a function such that it is executed instead of the fallback function in very specific circumstances.","description": "If a function has a selector consisting only of zeros, is payable and part of a contract that does not have a fallback function and at most five external functions in total, this function is called instead of the fallback function if Ether is sent to the contract without data.","fixed": "0.4.18","severity": "very low"},{"name": "DelegateCallReturnValue","summary": "The low-level .delegatecall() does not return the execution outcome, but converts the value returned by the functioned called to a boolean instead.","description": "The return value of the low-level .delegatecall() function is taken from a position in memory, where the call data or the return data resides. This value is interpreted as a boolean and put onto the stack. This means if the called function returns at least 32 zero bytes, .delegatecall() returns false even if the call was successuful.","introduced": "0.3.0","fixed": "0.4.15","severity": "low"},{"name": "ECRecoverMalformedInput","summary": "The ecrecover() builtin can return garbage for malformed input.","description": "The ecrecover precompile does not properly signal failure for malformed input (especially in the 'v' argument) and thus the Solidity function can return data that was previously present in the return area in memory.","fixed": "0.4.14","severity": "medium"},{"name": "SkipEmptyStringLiteral","summary": "If \"\" is used in a function call, the following function arguments will not be correctly passed to the function.","description": "If the empty string literal \"\" is used as an argument in a function call, it is skipped by the encoder. This has the effect that the encoding of all arguments following this is shifted left by 32 bytes and thus the function call data is corrupted.","fixed": "0.4.12","severity": "low"},{"name": "ConstantOptimizerSubtraction","summary": "In some situations, the optimizer replaces certain numbers in the code with routines that compute different numbers.","description": "The optimizer tries to represent any number in the bytecode by routines that compute them with less gas. For some special numbers, an incorrect routine is generated. This could allow an attacker to e.g. trick victims about a specific amount of ether, or function calls to call different functions (or none at all).","link": "https://blog.ethereum.org/2017/05/03/solidity-optimizer-bug/","fixed": "0.4.11","severity": "low","conditions": {"optimizer": true}},{"name": "IdentityPrecompileReturnIgnored","summary": "Failure of the identity precompile was ignored.","description": "Calls to the identity contract, which is used for copying memory, ignored its return value. On the public chain, calls to the identity precompile can be made in a way that they never fail, but this might be different on private chains.","severity": "low","fixed": "0.4.7"},{"name": "OptimizerStateKnowledgeNotResetForJumpdest","summary": "The optimizer did not properly reset its internal state at jump destinations, which could lead to data corruption.","description": "The optimizer performs symbolic execution at certain stages. At jump destinations, multiple code paths join and thus it has to compute a common state from the incoming edges. Computing this common state was simplified to just use the empty state, but this implementation was not done properly. This bug can cause data corruption.","severity": "medium","introduced": "0.4.5","fixed": "0.4.6","conditions": {"optimizer": true}},{"name": "HighOrderByteCleanStorage","summary": "For short types, the high order bytes were not cleaned properly and could overwrite existing data.","description": "Types shorter than 32 bytes are packed together into the same 32 byte storage slot, but storage writes always write 32 bytes. For some types, the higher order bytes were not cleaned properly, which made it sometimes possible to overwrite a variable in storage when writing to another one.","link": "https://blog.ethereum.org/2016/11/01/security-alert-solidity-variables-can-overwritten-storage/","severity": "high","introduced": "0.1.6","fixed": "0.4.4"},{"name": "OptimizerStaleKnowledgeAboutSHA3","summary": "The optimizer did not properly reset its knowledge about SHA3 operations resulting in some hashes (also used for storage variable positions) not being calculated correctly.","description": "The optimizer performs symbolic execution in order to save re-evaluating expressions whose value is already known. This knowledge was not properly reset across control flow paths and thus the optimizer sometimes thought that the result of a SHA3 operation is already present on the stack. This could result in data corruption by accessing the wrong storage slot.","severity": "medium","fixed": "0.4.3","conditions": {"optimizer": true}},{"name": "LibrariesNotCallableFromPayableFunctions","summary": "Library functions threw an exception when called from a call that received Ether.","description": "Library functions are protected against sending them Ether through a call. Since the DELEGATECALL opcode forwards the information about how much Ether was sent with a call, the library function incorrectly assumed that Ether was sent to the library and threw an exception.","severity": "low","introduced": "0.4.0","fixed": "0.4.2"},{"name": "SendFailsForZeroEther","summary": "The send function did not provide enough gas to the recipient if no Ether was sent with it.","description": "The recipient of an Ether transfer automatically receives a certain amount of gas from the EVM to handle the transfer. In the case of a zero-transfer, this gas is not provided which causes the recipient to throw an exception.","severity": "low","fixed": "0.4.0"},{"name": "DynamicAllocationInfiniteLoop","summary": "Dynamic allocation of an empty memory array caused an infinite loop and thus an exception.","description": "Memory arrays can be created provided a length. If this length is zero, code was generated that did not terminate and thus consumed all gas.","severity": "low","fixed": "0.3.6"},{"name": "OptimizerClearStateOnCodePathJoin","summary": "The optimizer did not properly reset its internal state at jump destinations, which could lead to data corruption.","description": "The optimizer performs symbolic execution at certain stages. At jump destinations, multiple code paths join and thus it has to compute a common state from the incoming edges. Computing this common state was not done correctly. This bug can cause data corruption, but it is probably quite hard to use for targeted attacks.","severity": "low","fixed": "0.3.6","conditions": {"optimizer": true}},{"name": "CleanBytesHigherOrderBits","summary": "The higher order bits of short bytesNN types were not cleaned before comparison.","description": "Two variables of type bytesNN were considered different if their higher order bits, which are not part of the actual value, were different. An attacker might use this to reach seemingly unreachable code paths by providing incorrectly formatted input data.","severity": "medium/high","fixed": "0.3.3"},{"name": "ArrayAccessCleanHigherOrderBits","summary": "Access to array elements for arrays of types with less than 32 bytes did not correctly clean the higher order bits, causing corruption in other array elements.","description": "Multiple elements of an array of values that are shorter than 17 bytes are packed into the same storage slot. Writing to a single element of such an array did not properly clean the higher order bytes and thus could lead to data corruption.","severity": "medium/high","fixed": "0.3.1"},{"name": "AncientCompiler","summary": "This compiler version is ancient and might contain several undocumented or undiscovered bugs.","description": "The list of bugs is only kept for compiler versions starting from 0.3.0, so older versions might contain undocumented bugs.","severity": "high","fixed": "0.3.0"}]
复制代码

延伸阅读:智能合约-Solidity官方文档(1)

安装Solidity编译器-Solidity官方文档(2)

根据例子学习Solidity-Solidity官方文档(3)

深入理解Solidity之源文件及合约结构——Solidity中文文档(4)

安全考量——Solidity中文文档(5)

合约的元数据——Solidity中文文档(6)

应用二进制接口(ABI) 说明——Solidity中文文档(7)

使用编译器——Solidity中文文档(8)

Yul语言及对象说明——Solidity中文文档(9)

风格指南——Solidity中文文档(10)

通用模式——Solidity中文文档(11)

点击“阅读原文”即可查看完整中文文档

:本文为solidity翻译的第十二部分《已知bug列表》,特发布出来邀请solidity爱好者、开发者做公开的审校,您可以添加微信baobaotalk_com,验证输入“solidity”,然后将您的意见和建议发送给我们,也可在文末“留言”区留言,或通过原文链接访问我们的Github。有效的建议我们会收纳并及时改进,同时将送一份小礼物给您以示感谢。

本文内容来源于HiBlock区块链社区翻译小组,感谢全体译者的辛苦工作。点击“阅读原文”即可查看完整中文文档。

线上课程推荐

线上课程:《8小时区块链智能合约开发实践》

培训讲师:《白话区块链》作者 蒋勇

课程原价:999元,现价 399元

更多福利:

  • @所有人,识别下图二维码转发课程邀请好友报名,即可获得报名费50%返利

  • @学员,报名学习课程并在规定时间内完成考试即可瓜分10000元奖金

点击“阅读原文”即可查看完整中文文档

已知bug列表——Solidity中文文档(12)相关推荐

  1. Yul语言及对象说明——Solidity中文文档(9)

    写在前面:HiBlock区块链社区成立了翻译小组,翻译区块链相关的技术文档及资料,本文为Solidity文档翻译的第九部分<Yul语言及对象说明>,特发布出来邀请solidity爱好者.开 ...

  2. 使用编译器——Solidity中文文档(8)

    写在前面:HiBlock区块链社区成立了翻译小组,翻译区块链相关的技术文档及资料,本文为Solidity文档翻译的第八部分<使用编译器>,特发布出来邀请solidity爱好者.开发者做公开 ...

  3. 风格指南——Solidity中文文档(10)

    写在前面:HiBlock区块链社区成立了翻译小组,翻译区块链相关的技术文档及资料,本文为Solidity文档翻译的第十部分<风格指南>,特发布出来邀请solidity爱好者.开发者做公开的 ...

  4. Solidity中文文档(内部)

    1. 值类型和引用类型 Solidity是一个静态类型的语言,在编译时需要明确指定变量的类型,主要分类值类型,引用类型. 值类型包括: 布尔 整形 地址 定长字节数组 有理数和整型 枚举类型 函数 值 ...

  5. mysql中文长方形_MySql 5.7 中文文档 - 12.16.9.2 使用最小边界矩形的空间关系函数 | Docs4dev...

    MySQL 提供了几个特定于 MySQL 的函数,用于测试两个几何g1和g2的最小边界矩形(MBR)之间的关系.返回值 1 和 0 分别 table 示 true 和 false. 本节稍后将描述根据 ...

  6. Solidity 最新 0.5.8 中文文档发布

    本文首发于深入浅出区块链社区 热烈祝贺 Solidity 最新 0.5.8 中文文档发布, 这不单是一份 Solidity 速查手册,更是一份深入以太坊智能合约开发宝典. 翻译说明 Solidity ...

  7. 【MOS】中文文档列表 - Oracle Database (文档 ID 1533057.1)

    中文文档列表 - Oracle Database (文档 ID 1533057.1) 类型: 状态: 上次主更新: 上次更新: ANNOUNCEMENT PUBLISHED 2017-2-23 201 ...

  8. Metalink Note:中文文档列表 - Oracle EBS (Enterprise Business Suite) [ID 1553829.1]

    Oracle中国的技术支持团队正在把一些常见Oracle EBS的Metalink Notes翻译成中文,这肯定会大大提升用户的使用体验,毕竟还是绝大多数用户,技术人员还是习惯阅读中文的技术文档. 大 ...

  9. Metalink Note 中文文档列表 - Oracle EBS Enterprise Business Suite

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! Orac ...

最新文章

  1. 有kotlin中的Android项目编译出现 Unresolved reference: R
  2. HDU - 2444 The Accomodation of Students(二分图判断+二分图最大匹配)
  3. python中带*(单星号)的变量和**(双星号)的变量
  4. 爬虫如何监听插件_NodeJS概述2-事件插件-简易爬虫
  5. 发布9个月直降2300!这款手机太惨了:卖完下架
  6. 计算机毕业设计中用Java实现商场库存清单案例
  7. 数字电路设计入门(fpga/asic)
  8. 为什么文本框里的字只显示一半_Word文本框文字显示不全、无法选择、不能编辑调整大小和跨页,怎么解决...
  9. Druid【部署 01】最新版本的(安装+启动服务+打开控制台+本地文件数据载入+数据查询)及(小内存服务器启动JVM参数调整)一次学会使用Druid的完整流程(已完成)
  10. MVX-Net论文解读
  11. saas和pass有啥区别
  12. Delphi第三方插件的安装
  13. qq机器人如何滑动验证码验证TxCaptchaHelper
  14. 谈谈对于企业级系统架构的理解—李平
  15. FSRNet: End-to-End Learning Face Super-Resolution with Facial Priors
  16. mysql数据转化为rdf_灏嗗叧绯绘暟鎹浆鎹负 RDF 鏍煎紡
  17. “巨亏成名”的魔鬼交易员,你知道几个?
  18. 做科研必备的良心网站
  19. 简单模拟 | 北邮OJ | 87. 日期
  20. 回忆我读过的计算机书籍

热门文章

  1. 彻底解决swf浏览器的缓存问题
  2. 浅谈Redis及其安装配置
  3. 一个人的MVP(微软全球最有价值专家),所有人的帮助!
  4. C# AutoMapper的简单扩展
  5. 本地如何使用phpstudy环境搭建多站点
  6. 【133天】尚学堂高淇Java300集视频精华笔记(71-72)
  7. Openwrt 刷机后配置WAN口,安装luci和设置中文、安装挂载USB存储。
  8. c#.net URL参数传递及在js中引用
  9. [原]职场中,要善于交换利益
  10. Springboot、Mybatis 事务示例