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

34Citations
Citations of this article
59Readers
Mendeley users who have this article in their library.

This article is free to access.

Abstract

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.

Cite

CITATION STYLE

APA

Jurgelaitis, M., Ceponiene, L., & Butkiene, R. (2022). Solidity Code Generation From UML State Machines in Model-Driven Smart Contract Development. IEEE Access, 10, 33465–33481. https://doi.org/10.1109/ACCESS.2022.3162227

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free