SmartEmbed: A Tool for Clone and Bug Detection in Smart Contracts through Structural Code Embedding

Zhipeng Gao, Vinoj Jayasundara, Lingxiao Jiang, Xin Xia, D. Lo, J. Grundy
{"title":"SmartEmbed: A Tool for Clone and Bug Detection in Smart Contracts through Structural Code Embedding","authors":"Zhipeng Gao, Vinoj Jayasundara, Lingxiao Jiang, Xin Xia, D. Lo, J. Grundy","doi":"10.1109/ICSME.2019.00067","DOIUrl":null,"url":null,"abstract":"Ethereum has become a widely used platform to enable secure, Blockchain-based financial and business transactions. However, a major concern in Ethereum is the security of its smart contracts. Many identified bugs and vulnerabilities in smart contracts not only present challenges to the maintenance of blockchain, but also lead to serious financial loses. There is a significant need to better assist developers in checking smart contracts and ensuring their reliability. In this paper, we propose a web service tool, named SmartEmbed, which can help Solidity developers to find repetitive contract code and clone-related bugs in smart contracts. Our tool is based on code embeddings and similarity checking techniques. By comparing the similarities among the code embedding vectors for existing solidity code in the Ethereum blockchain and known bugs, we are able to efficiently identify code clones and clone-related bugs for any solidity code given by users, which can help to improve the users' confidence in the reliability of their code. In addition to the uses by individual developers, SmartEmbed can also be applied to studies of smart contracts in a large scale. When applied to more than 22K solidity contracts collected from the Ethereum blockchain, we found that the clone ratio of solidity code is close to 90%, much higher than traditional software, and 194 clone-related bugs can be identified efficiently and accurately based on our small bug database with a precision of 96%.","PeriodicalId":106748,"journal":{"name":"2019 IEEE International Conference on Software Maintenance and Evolution (ICSME)","volume":"50 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-08-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"37","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 IEEE International Conference on Software Maintenance and Evolution (ICSME)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICSME.2019.00067","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 37

Abstract

Ethereum has become a widely used platform to enable secure, Blockchain-based financial and business transactions. However, a major concern in Ethereum is the security of its smart contracts. Many identified bugs and vulnerabilities in smart contracts not only present challenges to the maintenance of blockchain, but also lead to serious financial loses. There is a significant need to better assist developers in checking smart contracts and ensuring their reliability. In this paper, we propose a web service tool, named SmartEmbed, which can help Solidity developers to find repetitive contract code and clone-related bugs in smart contracts. Our tool is based on code embeddings and similarity checking techniques. By comparing the similarities among the code embedding vectors for existing solidity code in the Ethereum blockchain and known bugs, we are able to efficiently identify code clones and clone-related bugs for any solidity code given by users, which can help to improve the users' confidence in the reliability of their code. In addition to the uses by individual developers, SmartEmbed can also be applied to studies of smart contracts in a large scale. When applied to more than 22K solidity contracts collected from the Ethereum blockchain, we found that the clone ratio of solidity code is close to 90%, much higher than traditional software, and 194 clone-related bugs can be identified efficiently and accurately based on our small bug database with a precision of 96%.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
SmartEmbed:通过结构代码嵌入在智能合约中进行克隆和错误检测的工具
以太坊已经成为一个广泛使用的平台,可以实现安全的、基于区块链的金融和商业交易。然而,以太坊的一个主要问题是其智能合约的安全性。智能合约中许多已发现的bug和漏洞不仅给区块链的维护带来了挑战,而且还会导致严重的财务损失。有必要更好地帮助开发人员检查智能合约并确保其可靠性。在本文中,我们提出了一个名为SmartEmbed的web服务工具,它可以帮助Solidity开发人员在智能合约中找到重复的合约代码和与克隆相关的错误。我们的工具基于代码嵌入和相似性检查技术。通过比较以太坊区块链中现有稳固性代码的代码嵌入向量与已知bug的相似性,我们能够有效地识别用户给出的任何稳固性代码的代码克隆和克隆相关bug,从而有助于提高用户对其代码可靠性的信心。除了个人开发人员的使用外,SmartEmbed还可以应用于大规模的智能合约研究。应用于以太坊区块链收集的22K多份solid合约,我们发现solid代码的克隆率接近90%,远高于传统软件,并且基于我们的小bug数据库,可以高效准确地识别出194个与克隆相关的bug,准确率达到96%。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Same App, Different Countries: A Preliminary User Reviews Study on Most Downloaded iOS Apps Towards Better Understanding Developer Perception of Refactoring Decomposing God Classes at Siemens Self-Admitted Technical Debt Removal and Refactoring Actions: Co-Occurrence or More? A Validation Method of Self-Adaptive Strategy Based on POMDP
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1