Are the smart contracts on Q&A site reliable?

Author:

Zhou Xiaocong1,Wang Quanqi1ORCID,Liu Yifan1,Chen Xiangping2,Huang Yuan3,Zheng Zibin3

Affiliation:

1. School of Computer Science and Engineering Sun Yat‐sen University Guangzhou China

2. The School of Journalism and Communication Sun Yat‐sen University Guangzhou China

3. School of Software Engineering Sun Yat‐sen University Zhuhai China

Abstract

AbstractEthereum, as a leading blockchain platform, has attracted a significant number of practitioners. These practitioners require a platform for communication and collaborative problem‐solving, which led to Ethereum Stack Exchange (ESE), a Q&A site dedicated to Ethereum‐related issues. While the Q&A site facilitates communication among practitioners, it also introduces new challenges. Practitioners adopt code snippets from Q&A sites to address problems encountered. However, the quality of code snippets on ESE remains largely unexplored. Vulnerabilities and gas‐inefficient patterns in ESE may spread to the code in Ethereum and threaten its regular operation. In this article, we conduct an empirical study investigating the distribution of vulnerabilities and gas‐inefficient patterns in ESE. Further, we analyze the potential impact of vulnerabilities and gas‐inefficient patterns from ESE on Ethereum. However, we encounter a problem during the vulnerability and gas‐inefficient pattern detection. Established smart contract analysis tools in the mainstream realm necessitate complete source code files for thorough analysis, while codes on ESE are often incomplete code snippets. To address this, we introduce the AST‐based code clone detection technique to construct detectable files corresponding to code snippets. This enables us to detect vulnerabilities and gas‐inefficient patterns in code snippets. In the end, our findings demonstrate that 11.18% of the contract‐level code snippets and 4.06% of function‐level code snippets in ESE have vulnerabilities. And 27.21% of contract‐level code snippets and 17.89% of function‐level code snippets contain gas‐inefficient patterns. The additional consumption caused by the gas‐inefficient pattern in ESE is approximately $1,695,002. Based on these findings, we provide recommendations for both ESE and its users, aiming to foster collaborative efforts and create a more reliable Q&A site for practitioners.

Funder

National Natural Science Foundation of China

Natural Science Foundation of Guangdong Province

Publisher

Wiley

Reference50 articles.

1. NakamotoS.Bitcoin: a peer‐to‐peer electronic cash system. Cryptography mailing list.2009.

2. Untangling Blockchain: A Data Processing View of Blockchain Systems

3. A detailed and real-time performance monitoring framework for blockchain systems

4. An overview on smart contracts: Challenges, advances and platforms

5. NakamotoW ButerinV.A Next Generation Smart Contract & Decentralized Application Platform; 2015: 1‐36. Ethereum White Paper.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3