arrow
Return

Automating Comment Generation for Smart Contract from Bytecode

delete2025-02-23
delete0
delete
OA
AI
J
Jianhang Xiang
Z
Zhipeng Gao
鲍
鲍凌峰 (Lingfeng Bao)
X
Xing Hu
J
Jiayuan Chen
X
Xin Xia
DOI:10.1145/3699597delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Recently, smart contracts have played a vital role in automatic financial and business transactions. To help end users without programming background to better understand the logic of smart contracts, previous studies have proposed models for automatically translating smart contract source code into their corresponding code summaries. However, in practice, only 13% of smart contracts deployed on the Ethereum blockchain are associated with source code. The practical usage of these existing tools is significantly restricted. Considering that bytecode is always necessary when deploying smart contracts, in this article, we first introduce the task of automatically generating smart contract code summaries from bytecode. We propose a novel approach, named Smart Contract Bytecode Translator (SMARTBT) for automatically translating smart contract bytecode into fine-grained natural language description directly. Two key challenges are posed for this task: structural code logic hidden in bytecode and the huge semantic gap between bytecode and natural language descriptions. To address the first challenge, we transform bytecode into Control-Flow Graph (CFG) to learn code structural and logic details. Regarding the second challenge, we introduce an information retrieval component to fetch similar comments for filling the semantic gap. Then, the structural input and semantic input are used to build an attentional sequence-to-sequence neural network model. The copy mechanism is employed to copy rare words directly from similar comments, and the coverage mechanism is employed to eliminate repetitive outputs. The automatic evaluation results show that SMARTBT outperforms a set of baselines by a large margin, and the human evaluation results show the effectiveness and potential of SMARTBT in producing meaningful and accurate comments for smart contract code from bytecode directly.
Keywords:
Smart Contract
Bytecode
Automatic Comment Generation

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

 
 ohio state university
Scholars:
3.9K
Papers: 2.6K
Citations: 5
Cited Papers

Cited Papers

Effects of a restrictive fluid regimen in pediatric patients undergoing major abdominal surgery
err2014-12-11
err0
PREAI
errSahatsa Mandee; Wassana Butmangkun; Naiyana Aroonpruksakul; Niramol Tantemsapya; Benno von Bormann; Suwannee Suraseranivongse
errShare
errSave
Homeobox Gene Involvement in Normal Hematopoiesis and in the Pathogenesis of Childhood Leukemias
err2017-01-01
err0
PREAI
errMaria Adamaki; Maria Goulielmaki; Ioannis Christodoulou; Spiros Vlahopoulos; Vassilis Zoumpourlis
errShare
errSave
Caveolin-1 and -2 regulate cell motility in castration-resistant prostate cancer
err2018-10-01
err0
errOAAI
errToyoharu Kamibeppu; Koji Yamasaki; Kozue Nakahara; Takahiro Nagai; Naoki Terada; Hiromasa Tsukino; Shoichiro Mukai; Toshiyuki Kamoto
errShare
errSave
errShare
errSave
Spectral restoration for femtosecond spectral interferometry with attosecond accuracy
err2010-04-29
err0
PREAI
errMichael K. Yetzbacher; Trevor L. Courtney; William K. Peters; Katherine A. Kitney; Eric Ryan Smith; David M. Jonas
errShare
errSave
errShare
errSave
Semantic clustering: Identifying topics in source code
err2007-03-01
err343
PREAI
errKuhn, Adrian; Ducasse, Stephane; Girba, Tudor
errShare
errSave
researcher View more