System Development & Application
|
1502-1507

Research of smart contract automatic generation method based on code annotation optimization

Chen Yong
Hu Defeng
Xu Chao
Chen Nannan
School of Computer Science, Nanjing Audit University, Nanjing 211815, China

Abstract

To address the issues of low efficiency and frequent security vulnerabilities in smart contract development, this paper proposed a smart contract auto-generation method based on code comment optimization. Firstly, it constructed a smart contract clustering analysis model based on the semantic information of smart contract code associated annotations to achieve fast and accurate clustering of functions similar to smart contracts. Then, it divided the smart contract knowledge base into different levels such as the contract layer, function layer, and interface layer associated with the annotation. And based on the clustered code and annotation information, it constructed a diversified Prompt feature prompt statement dataset. Finally, it achieved automatic generation of smart contracts with specific needs based on the large language model ChatGLM2-6B and with the help of P-Tuning v2 fine-tuning technology. In order to test the effectiveness of this method, this paper conducted comparative experiments with existing methods using the bilingual translation quality assessment assistant tool BLEU and the code security detection tools Mythril and VaaS. Experimental results show that the average BLEU of the code generated by this method is increased by about 13%, and the code security is improved by about 6%. This method integrates code annotation information into the automatic generation of smart contracts, effectively improves the quality of smart contracts, and provides a new method for the efficient development of safe and reliable smart contracts.

Foundation Support

国家自然科学基金资助项目(71972102)
江苏省高等学校自然科学研究重大项目(20KJA520002)
江苏省高校优秀科技创新团队项目(2021)

Publish Information

DOI: 10.19734/j.issn.1001-3695.2023.09.0401
Publish at: Application Research of Computers Printed Article, Vol. 41, 2024 No. 5
Section: System Development & Application
Pages: 1502-1507
Serial Number: 1001-3695(2024)05-031-1502-06

Publish History

[2023-11-14] Accepted Paper
[2024-05-05] Printed Article

Cite This Article

陈勇, 胡德锋, 徐超, 等. 基于代码注释调优的智能合约自动生成方法 [J]. 计算机应用研究, 2024, 41 (5): 1502-1507. (Chen Yong, Hu Defeng, Xu Chao, et al. Research of smart contract automatic generation method based on code annotation optimization [J]. Application Research of Computers, 2024, 41 (5): 1502-1507. )

About the Journal

  • Application Research of Computers Monthly Journal
  • Journal ID ISSN 1001-3695
    CN  51-1196/TP

Application Research of Computers, founded in 1984, is an academic journal of computing technology sponsored by Sichuan Institute of Computer Sciences under the Science and Technology Department of Sichuan Province.

Aiming at the urgently needed cutting-edge technology in this discipline, Application Research of Computers reflects the mainstream technology, hot technology and the latest development trend of computer application research at home and abroad in a timely manner. The main contents of the journal include high-level academic papers in this discipline, the latest scientific research results and major application results. The contents of the columns involve new theories of computer discipline, basic computer theory, algorithm theory research, algorithm design and analysis, blockchain technology, system software and software engineering technology, pattern recognition and artificial intelligence, architecture, advanced computing, parallel processing, database technology, computer network and communication technology, information security technology, computer image graphics and its latest hot application technology.

Application Research of Computers has many high-level readers and authors, and its readers are mainly senior and middle-level researchers and engineers engaged in the field of computer science, as well as teachers and students majoring in computer science and related majors in colleges and universities. Over the years, the total citation frequency and Web download rate of Application Research of Computers have been ranked among the top of similar academic journals in this discipline, and the academic papers published are highly popular among the readers for their novelty, academics, foresight, orientation and practicality.


Indexed & Evaluation

  • The Second National Periodical Award 100 Key Journals
  • Double Effect Journal of China Journal Formation
  • the Core Journal of China (Peking University 2023 Edition)
  • the Core Journal for Science
  • Chinese Science Citation Database (CSCD) Source Journals
  • RCCSE Chinese Core Academic Journals
  • Journal of China Computer Federation
  • 2020-2022 The World Journal Clout Index (WJCI) Report of Scientific and Technological Periodicals
  • Full-text Source Journal of China Science and Technology Periodicals Database
  • Source Journal of China Academic Journals Comprehensive Evaluation Database
  • Source Journals of China Academic Journals (CD-ROM Version), China Journal Network
  • 2017-2019 China Outstanding Academic Journals with International Influence (Natural Science and Engineering Technology)
  • Source Journal of Top Academic Papers (F5000) Program of China's Excellent Science and Technology Journals
  • Source Journal of China Engineering Technology Electronic Information Network and Electronic Technology Literature Database
  • Source Journal of British Science Digest (INSPEC)
  • Japan Science and Technology Agency (JST) Source Journal
  • Russian Journal of Abstracts (AJ, VINITI) Source Journals
  • Full-text Journal of EBSCO, USA
  • Cambridge Scientific Abstracts (Natural Sciences) (CSA(NS)) core journals
  • Poland Copernicus Index (IC)
  • Ulrichsweb (USA)