Blockchain uses cryptographic proof to replace trusted third parties to ensure the correctness of the information, allowing any two willing parties to transact directly with each other. Smart contracts are pieces of code that reside inside the blockchains and can be triggered to execute any transaction when specifically predefined conditions are satisfied. Being commonly used for commercial transactions in blockchain makes the security of smart contracts particularly important. Over the last few years, we have seen a great deal of academic and practical interest in detecting and repairing the vulnerabilities in smart contracts developed for the Ethereum blockchain. In this paper, we conduct an empirical study on historical bug fixing versions of 46 real-world smart contracts projects from Github, providing a multi-faceted discussion. In this paper, we mainly explore the following four questions: File Type and Amount, Fix Complexity, Bug distribution, and Fix Patches. By analyzing the file type, amount, and fix complexity, we find that about 80% of the bug-related commits modified no more than one solidity source file to fix bugs. Up to 80% of bugs in solidity source files can be fixed by less than three fix actions. Modification is the mostly used fix action, which involves three lines of code on average. By using the analysis tool Mythril to detect the vulnerabilities, we find that nearly 20% of the solidity files in our dataset had or have had vulnerabilities. We finally find that the developers may not put much attention to fixing vulnerabilities reported by Mythril completely or avoid introducing them again. Because vulnerabilities that have a high repair percentage usually have a high rate to be introduced again.
翻译:屏障链使用加密证据替换信任的第三方, 以确保信息的正确性, 允许任何两个愿意的当事人直接相互交易。 智能合同是块块链内存在的代码, 当特定预设条件得到满足时可以触发执行任何交易。 块链中通常用于商业交易, 使得智能合同的安全变得特别重要。 过去几年里, 我们发现在发现和修复为 Eexium 块链开发的智能合同中的弱点方面存在大量学术和实践兴趣, 以确保信息的正确性。 在本文中, 我们对Github 的46个真实世界智能合同项目的历史错误修复版本进行了实证性研究, 提供了多面的讨论。 在本文中, 我们主要探讨以下四个问题: 文件类型和数量、 固定复杂度、 错误分布和修正补补丁。 通过分析文件类型、 数量和精密性, 我们发现大约80%的与错误有关的承诺 只在一个固性源文件中被修改过, 才能修复错误。 在固性源文件中, 高达80%的错误可以被完全地固定下来, 而不是三次修正动作。 。 修改后, 通常会使用高的动作 。 。 。