Title |
Solidity code generation from UML state machines in model-driven smart contract development / |
Authors |
Jurgelaitis, Mantas ; Ceponiene, Lina ; Butkiene, Rita |
DOI |
10.1109/ACCESS.2022.3162227 |
Full Text |
|
Is Part of |
IEEE Access.. Piscataway, NJ : IEEE. 2022, vol. 10, p. 33465-33481.. ISSN 2169-3536 |
Keywords [eng] |
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 |
Abstract [eng] |
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. |
Published |
Piscataway, NJ : IEEE |
Type |
Journal article |
Language |
English |
Publication date |
2022 |
CC license |
|