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

08/22/2019
by   Zhipeng Gao, et al.
0

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 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%. SmartEmbed can be accessed at <http://www.smartembed.net>. A demo video of SmartEmbed is at <https://youtu.be/o9ylyOpYFq8>

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/07/2020

When Deep Learning Meets Smart Contracts

Ethereum has become a widely used platform to enable secure, Blockchain-...
research
01/20/2020

Checking Smart Contracts with Structural Code Embedding

Smart contracts have been increasingly used together with blockchains to...
research
04/13/2021

Coinbugs: Enumerating Common Blockchain Implementation-Level Vulnerabilities

A good amount of effort has been dedicated to surveying and systematizin...
research
09/01/2019

Refinement type contracts for verification of scientific investigative software

Our scientific knowledge is increasingly built on software output. User ...
research
10/21/2022

An Empirical Study on Real Bug Fixes in Smart Contracts Projects

Blockchain uses cryptographic proof to replace trusted third parties to ...
research
10/27/2018

Exploiting The Laws of Order in Smart Contracts

We investigate a family of bugs in blockchain-based smart contracts, whi...
research
08/21/2023

PrAIoritize: Learning to Prioritize Smart Contract Bugs and Vulnerabilities

Smart contract vulnerabilities and bugs have become a key concern for so...

Please sign up or login with your details

Forgot password? Click here to reset