Research Brief: Automating User Notice Generation for Smart Contract Functions

Source:上海高等研究院英文网

Smart contracts have obtained much attention and are crucial for automatic financial and business transactions. As Turing-complete programs, they are first compiled into bytecode and then executed on the Blockchain platform. 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, the research group led by Dr Xiaohu Yang proposes a new approach SMARTDOC to generate user notice for smart contract functions automatically. The 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. The group also integrate the Pointer mechanism to copy words from the input source code instead of generating words during the prediction process. The project extracts 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), the group exploits 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 generated user notice, the group also conducts 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.

The work was accepted by the 36th IEEE/ACM International Conference

Automated Software Engineering 2021 (ASE 2021), and to learn more please visit Automating User Notice Generation for Smart Contract Functions (ASE 2021 - Research Papers) - ASE 2021 (researchr.org).


About Professor Yang

        Xiaohu Yang is a jointly appointed professor at College of Computer Science & Technology and SIAS, Zhejiang University. He is the Director of Blockchain Research Center and Vice Director of Computer Software Institute at Zhejiang University.

        He is the co-founder of State Street Zhejiang University Technology Center, a joint research center set up in 2001 by State Street Corporation and Zhejiang University, for advanced research and development of global financial software systems and technologies. Since then, he has been leading the Technology Center, and brought it up from 15 people to more than thousand people up-to-date. 

        His research interests include software engineering, blockchain, and cloud computing. He received the B.S. degree, the M.S. degree and the Ph.D. degree all in computer science at Zhejiang University in 1988, 1990, and 1993 respectively.


About SIAS

        Shanghai Institute for Advanced Study of Zhejiang University (SIAS) is a jointly launched new institution of research and development by Shanghai Municipal Government and Zhejiang University in June, 2020. The platform represents an intersection of technology and economic development, serving as a market leading trail blazer to cultivate a novel community for innovation amongst enterprises. 

        SIAS is seeking top talents working on the frontiers of computational sciences who can envision and actualize a research program that will bring out new solutions to areas include, but not limited to, Artificial Intelligence, Computational Biology, Computational Engineering and Fintech.