paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automating User Notice Generation for Smart Contract Functions

自动化生成智能合约函数的用户须知
ASE 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)2021匹配度 2/10 · 该论文属于程序语言与机器学习交叉中的代码摘要/自然语言生成任务,与用户关注的静态分析、Agentic 程序分析、浮点程序分析、贝叶斯程序分析以及 LLM/Agent 改进形式化验证等核心方向没有直接关系。其方法也偏向传统 Transformer+指针机制,未涉及用户关心的 LLM/Agent 与静态分析结合。引用 23 inbox
Xing Hu, Zhipeng Gao, Xin Xia, David Lo, Xiaohu Yang
crossref: 2026-09-12

AI 速览

一句话:提出SMARTDOC,结合Transformer、指针机制与Java迁移学习,自动生成智能合约函数的用户须知。

智能合约函数的用户须知能帮助终端用户理解交易行为与金融风险,但开发中常因时间或动机不足而缺失。本文提出SMARTDOC,自动为Solidity函数生成用户须知。方法利用Transformer学习源码表示并生成自然语言描述,同时引入Pointer机制从源码复制词汇;针对收集的7,878个〈函数, 用户须知〉对规模有限的问题,采用在特性相近的Java代码上预训练的迁移学习。实验表明,SMARTDOC能有效生成用户须知并显著优于现有方法;人工评估在自然度、信息量和相似性三方面也优于基线。

问题
智能合约函数的用户须知常因开发时间或动机不足而缺失,终端用户难以理解函数对应的交易语义并识别金融风险。
方法
SMARTDOC用Transformer学习Solidity源码表示并生成自然语言描述,引入Pointer机制复制源码词汇,并利用Java代码预训练进行迁移学习以缓解数据不足。
评估
从54,739个Solidity智能合约中抽取7,878个〈函数, 用户须知〉对进行自动评估,并开展人工评估,从自然度、信息量和相似性三方面与基线比较,结果显示SMARTDOC显著优于现有方法。
原文摘要(Abstract)

Smart contracts have obtained much attention and are crucial for automatic financial and business transactions. For end-users who have never seen the source code, they can read the user notice shown in end-user client to understand what a transaction does of a smart contract function. However, due to time constraints or lack of motivation, user notice is often missing during the development of smart contracts. For end-users who lack the information of the user notices, there is no easy way for them to check the code semantics of the smart contracts. Thus, in this paper, we propose a new approach SMARTDOC to generate user notice for smart contract functions automatically. Our tool can help end-users better understand the smart contract and aware of the financial risks, improving the users’ confidence on the reliability of the smart contracts. SMARTDOC exploits the Transformer to learn the representation of source code and generates natural language descriptions from the learned representation. We also integrate the Pointer mechanism to copy words from the input source code instead of generating words during the prediction process. We extract 7,878 〈function, notice〉 pairs from 54,739 smart contracts written in Solidity. Due to the limited amount of collected smart contract functions (i.e., 7,878 functions), we exploit a transfer learning technique to utilize the learned knowledge to improve the performance of SMARTDOC. The learned knowledge obtained by the pre-training on a corpus of Java code, that has similar characteristics as Solidity code. The experimental results show that our approach can effectively generate user notice given the source code and significantly outperform the state-of-the-art approaches. To investigate human perspectives on our generated user notice, we also conduct a human evaluation and ask participants to score user notice generated by different approaches. Results show that SMARTDOC outperforms baselines from three aspects, naturalness, informativeness, and similarity.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot6590,
  title = {Automating User Notice Generation for Smart Contract Functions},
  author = {Xing Hu and Zhipeng Gao and Xin Xia and David Lo and Xiaohu Yang},
  booktitle = {ASE},
  year = {2021},
  doi = {10.1109/ase51524.2021.9678552}
}