Automating Comment Generation for Smart Contract from Bytecode

字节码 计算机科学 程序设计语言 源代码 智能合约 编码(集合论) 集合(抽象数据类型) 数据库事务 Java
作者
Jianhang Xiang,Zhipeng Gao,Lingfeng Bao,Xing Hu,J. Chen,Xin Xia
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
标识
DOI:10.1145/3699597
摘要

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 paper, we first introduce the task of automatically generating smart contract code summaries from bytecode. We propose a novel approach, named S mart BT ( Smart contract B ytecode T ranslator) 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 CFG (Control-Flow Graph) 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.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
拼搏绮梅完成签到,获得积分10
3秒前
香蕉觅云应助故意的觅珍采纳,获得10
4秒前
重要夏波发布了新的文献求助20
5秒前
RK_404完成签到,获得积分10
5秒前
busichuan发布了新的文献求助10
6秒前
6秒前
今后应助Arthur采纳,获得10
7秒前
正直的念梦完成签到,获得积分10
7秒前
大模型应助rowam采纳,获得10
8秒前
1313131完成签到,获得积分10
9秒前
Crisp完成签到 ,获得积分10
9秒前
10秒前
14秒前
15秒前
萧晓完成签到 ,获得积分10
17秒前
17秒前
蓝天应助lily采纳,获得10
17秒前
ZhangBin应助科研通管家采纳,获得10
17秒前
ding应助科研通管家采纳,获得10
17秒前
hoy完成签到 ,获得积分10
17秒前
Owen应助科研通管家采纳,获得10
17秒前
无忧应助科研通管家采纳,获得10
18秒前
包美莹完成签到 ,获得积分10
18秒前
18秒前
酷波er应助科研通管家采纳,获得10
18秒前
18秒前
18秒前
无忧应助科研通管家采纳,获得10
18秒前
18秒前
平淡初雪应助科研通管家采纳,获得10
18秒前
18秒前
英姑应助科研通管家采纳,获得10
18秒前
18秒前
18秒前
18秒前
今后应助科研通管家采纳,获得10
18秒前
18秒前
18秒前
无忧应助科研通管家采纳,获得10
18秒前
18秒前
高分求助中
Psychopathic Traits and Quality of Prison Life 1000
Chemistry and Physics of Carbon Volume 18 800
The formation of Australian attitudes towards China, 1918-1941 660
Signals, Systems, and Signal Processing 610
天津市智库成果选编 600
Forced degradation and stability indicating LC method for Letrozole: A stress testing guide 500
全相对论原子结构与含时波包动力学的理论研究--清华大学 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6451760
求助须知:如何正确求助?哪些是违规求助? 8263479
关于积分的说明 17608492
捐赠科研通 5516392
什么是DOI,文献DOI怎么找? 2903725
邀请新用户注册赠送积分活动 1880669
关于科研通互助平台的介绍 1722664