• Home
  • Search
  • Checking Smart Contracts With Structural Code Embedding
  • Open Access IconOpen Access
  • Cite Icon155
  • https://doi.org/10.1109/tse.2020.2971482Copy DOI Icon

Checking Smart Contracts With Structural Code Embedding

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Smart contracts have been increasingly used together with blockchains to automate financial and business transactions. However, many bugs and vulnerabilities have been identified in many contracts which raises serious concerns about smart contract security, not to mention that the blockchain systems on which the smart contracts are built can be buggy. Thus, there is a significant need to better maintain smart contract code and ensure its high reliability. In this paper, we propose an automated approach to learn characteristics of smart contracts in Solidity, which is useful for clone detection, bug detection and contract validation on smart contracts. Our new approach is based on word embeddings and vector space comparison. We parse smart contract code into word streams with code structural information, convert code elements (e.g., statements, functions) into numerical vectors that are supposed to encode the code syntax and semantics, and compare the similarities among the vectors encoding code and known bugs, to identify potential issues. We have implemented the approach in a prototype, named S <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">mart</small> E <sc xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">mbed</small> , <xref ref-type="fn" rid="fn1" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><sup>1</sup></xref> <fn id="fn1" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"><label>1.</label> The anonymous replication packages can be accessed at: <uri>https://drive.google.com/file/d/1kauLT3y2IiHPkUlVx4FSTda-dVAyL4za/view?usp=sharing</uri>. </fn> and evaluated it with more than 22,000 smart contracts collected from the Ethereum blockchain. Results show that our tool can effectively identify many repetitive instances of Solidity code, where the clone ratio is around 90 percent. Code clones such as type-III or even type-IV semantic clones can also be detected accurately. Our tool can identify more than 1000 clone related bugs based on our bug databases efficiently and accurately. Our tool can also help to efficiently validate any given smart contract against a known set of bugs, which can help to improve the users’ confidence in the reliability of the contract.

Similar Papers
  • Conference Article
  • Citations17

When deep learning meets smart contracts

  • Dec 21, 2020
  • Zhipeng Gao
  • Dissertation

On security and reliability of smart contracts: the applications of dynamic specification mining on solidity

  • Jan 01, 2023
  • Ye Liu
  • Research Article
  • Citations63

Code cloning in smart contracts: a case study on verified contracts from the Ethereum blockchain platform

  • Sep 09, 2020
  • Empirical Software Engineering
  • Masanari Kondo +4
  • Conference Article
  • Citations87

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

  • Sep 01, 2019
  • Zhipeng Gao +5
  • Research Article
  • Citations8

Automating Comment Generation for Smart Contract from Bytecode

  • Feb 23, 2025
  • ACM Transactions on Software Engineering and Methodology
  • Jianhang Xiang +5
  • PDF
  • Research Article
  • Citations14

Formal Analysis of Reentrancy Vulnerabilities in Smart Contract Based on CPN

  • May 09, 2023
  • Electronics
  • Yaqiong He +3
  • PDF
  • Research Article
  • Citations156

Smart Contract Security: A Software Lifecycle Perspective

  • Jan 01, 2019
  • IEEE Access
  • Yongfeng Huang +4
  • Conference Article
  • Citations17

Analysis of Source Code Duplication in Ethreum Smart Contracts

  • Mar 01, 2021
  • Giuseppe Antonio Pierro +1
  • Conference Article

Comprehensive Survey on Security and Reliability of Smart Contracts: Vulnerabilities, Verification Techniques, and Future Directions

  • Sep 18, 2025
  • Muralidhara S +1
  • Book Chapter
  • Citations41

Secure Smart Contract Generation Based on Petri Nets

  • Jan 01, 2020
  • Nejc Zupan +3
  • Research Article
  • Citations24

Vulnerable smart contract function locating based on Multi-Relational Nested Graph Convolutional Network

  • Jun 09, 2023
  • Journal of Systems and Software
  • Haiyang Liu +3
  • PDF
  • Research Article
  • Citations57

A Novel Machine Learning-Based Analysis Model for Smart Contract Vulnerability

  • Aug 10, 2021
  • Security and Communication Networks
  • Yingjie Xu +3
  • Single Report
  • Citations3

Smart Contract Vulnerabilities on the Ethereum Blockchain: A Current Perspective

  • May 01, 2020
  • Daniel Connelly
  • Research Article
  • Citations1

Clone Detection for Smart Contracts: How Far Are We?

  • Jun 19, 2025
  • Proceedings of the ACM on Software Engineering
  • Zuobin Wang +6
  • PDF
  • Research Article
  • Citations96

CBGRU: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model.

  • May 07, 2022
  • Sensors
  • Lejun Zhang +6
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.