arrow
Return

Solidity Code Generation From UML State Machines in Model-Driven Smart Contract Development

delete2022-01-01
delete14
delete
OA
AI
M
Mantas Jurgelaitis *
L
Lina Čeponienė
R
Rita Butkienė
DOI:10.1109/ACCESS.2022.3162227delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
For the development of blockchain smart contracts, a structured approach based on the principles of the Model Driven Architecture can be beneficial and facilitate the implementation of smart contracts. This paper presents such an approach, which, in combination with Unified Modeling Language (UML) Class and State machine diagrams, allows the smart contract structure and behavior logic to be modeled in several abstraction layers. This paper delves into details on how the model-to-model transformations from the specified Blockchain Platform Independent Model (PIM) with specified state-like behavior can be used to produce a Solidity Platform Specific Model (PSM). Subsequently, we elaborate on how the Solidity PSM is used for Solidity smart contract code generation by employing model-to-text transformations. The paper also demonstrates the process of our proposed transformations and code generation using smart contract code examples from Solidity documentation. Based on the examples, a Blockchain PIM is specified and transformed to Solidity PSM, which is then used for Solidity smart contract code generation. The generated smart contract code is then compiled, deployed on the Ethereum blockchain JavaScript virtual machine, and compared to the original smart contract code in terms of Solidity code metrics, similarity scores, and execution costs. The evaluation results indicate that our approach could be successfully used to model and later generate smart contract code.
Keywords:
Unified modeling language
Smart contracts
Codes
Blockchains
Contracts
Solid modeling
Standards
Blockchain
model driven architecture
model-driven development
smart contracts
solidity
state machine
unified modeling language

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
9.8W
Citations:
29.4W

Organization

K
Kaunas University of Technology
Scholars:
3.1K
Papers: 2.7K
Citations: 4