Automating user notice generation for smart contract functions

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 t...

Full description

Saved in:
Bibliographic Details
Main Authors: HU, Xing, GAO, Zhipeng, XIA, Xin, LO, David, YANG, Xiaohu
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2021
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/6837
https://ink.library.smu.edu.sg/context/sis_research/article/7840/viewcontent/ase214.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-7840
record_format dspace
spelling sg-smu-ink.sis_research-78402022-02-07T11:28:05Z Automating user notice generation for smart contract functions HU, Xing GAO, Zhipeng XIA, Xin LO, David YANG, Xiaohu 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 endusers 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 hfunction, noticei 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. 2021-11-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/6837 https://ink.library.smu.edu.sg/context/sis_research/article/7840/viewcontent/ase214.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Smart Contract User Notice Generation Deep Learning Databases and Information Systems Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Smart Contract
User Notice Generation
Deep Learning
Databases and Information Systems
Software Engineering
spellingShingle Smart Contract
User Notice Generation
Deep Learning
Databases and Information Systems
Software Engineering
HU, Xing
GAO, Zhipeng
XIA, Xin
LO, David
YANG, Xiaohu
Automating user notice generation for smart contract functions
description 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 endusers 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 hfunction, noticei 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.
format text
author HU, Xing
GAO, Zhipeng
XIA, Xin
LO, David
YANG, Xiaohu
author_facet HU, Xing
GAO, Zhipeng
XIA, Xin
LO, David
YANG, Xiaohu
author_sort HU, Xing
title Automating user notice generation for smart contract functions
title_short Automating user notice generation for smart contract functions
title_full Automating user notice generation for smart contract functions
title_fullStr Automating user notice generation for smart contract functions
title_full_unstemmed Automating user notice generation for smart contract functions
title_sort automating user notice generation for smart contract functions
publisher Institutional Knowledge at Singapore Management University
publishDate 2021
url https://ink.library.smu.edu.sg/sis_research/6837
https://ink.library.smu.edu.sg/context/sis_research/article/7840/viewcontent/ase214.pdf
_version_ 1770576104924381184