华东师范大学学报(自然科学版) ›› 2020, Vol. 2020 ›› Issue (5): 21-32.doi: 10.3969/j.issn.1000-5641.202091015

• 数据系统 • 上一篇    下一篇

面向以太坊的智能合约自动生成方法研究与实现

高一琛1, 赵斌2, 张召1   

  1. 1. 华东师范大学 数据科学与工程学院, 上海 200062;
    2. 南京师范大学 计算机科学与技术学院, 南京 210046
  • 收稿日期:2020-08-16 发布日期:2020-09-24
  • 通讯作者: 张召,女,副教授,硕士生导师,研究方向为区块链系统研发、海量数据管理与分析.E-mail:zhzhang@dase.ecnu.edu.cn E-mail:zhzhang@dase.ecnu.edu.cn
  • 基金资助:
    国家自然科学基金(U1811264, U1911203, 61972152)

Research and implementation of a smart automatic contract generation method for Ethereum

GAO Yichen1, ZHAO Bin2, ZHANG Zhao1   

  1. 1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China;
    2. School of Computer Science and Technology, Nanjing Normal University, Nanjing 210046, China
  • Received:2020-08-16 Published:2020-09-24

摘要: 基于以太坊的智能合约已经广泛应用于各个领域, 然而合约开发需要完备的专业领域知识和编程能力. 针对智能合约编程友好性, 本文提出了一种对于特定领域智能合约自动生成的方法. 实现了对于智能合约的聚类分析以及交易类智能合约基本函数代码的生成, 对于生成的代码采用BLEU以及SmartCheck进行检测, 得到了较好的检测结果. 采用MFC将生成的代码和UI控件链接, 为用户提供友好的智能合约编程页面, 实现智能合约的自动生成. 方法生成的智能合约代码有一定的准确性, 能够对智能合约的开发提供帮助. 最后, 通过一个案例分析验证了生成的智能合约的可用性.

关键词: 智能合约, 以太坊, 区块链

Abstract: Smart contracts based on Ethereum have been widely used across various fields. The programming of smart contracts, however, requires professional developers with expertise in a special programming language; in other words, the developers must have professional domain knowledge in addition to programming ability. In this paper, a method for the automated generation of smart contracts for specific domains is proposed with the aim addressing the programming friendliness of smart contracts. The paper introduces cluster analysis of smart contracts and establishes the basic functional code for transactional type smart contracts. MFC is used to link the generated code with UI control and provide users with a friendly smart contract programming page; hence, the automatic generation of smart contracts is realized, thereby reducing the difficulty and cost of contract programming. Finally, a case study is presented to verify the availability of the generated smart contract.

Key words: smart contract, Ethereum, blockchain

中图分类号: