A High-Level Metamodel for Developing Smart Contracts on the Ethereum Virtual Machine

  • Gislainy Velasco UFG
  • Noeli Antonia Vaz UFG / UEG
  • Sergio T. Carvalho UFG

Resumo


The development of smart contracts presents significant challenges compared to traditional software development, such as the immutability of the blockchain and the limitation of program size. These challenges can lead to human errors and the existence of vulnerabilities that may be exploited by malicious individuals, resulting in substantial financial losses. Contract developers face language and infrastructure constraints and insufficient information on interface patterns and implementation specifications. Existing proposals are often challenging to understand, with complex formal verifications requiring expertise in this approach. This article proposes using Model-Driven Engineering (MDE), employing a metamodel for contract development and code generation for the corresponding platform. The metamodel proposed in this study referred to as the High-Level Metamodel for Smart Contract (HLM-SC), is an abstraction applicable to contract development in various contexts. HLM-SC consists of a set of metaclasses allowing the declaration of essential elements for constructing a contract on the Ethereum Virtual Machine (EVM). A graphical tool has been developed to facilitate contract modeling following HLM-SC specifications. Additionally, the model generated from the tool is transformed into Solidity code. This approach aims to overcome developers’ limitations, offering a more understandable and efficient approach to building smart contracts on the blockchain.

Referências

Achour, I., Idoudi, H., and Ayed, S. (2021). Automatic Generation of Access Control for Permissionless Blockchains: Ethereum Use Case. In 2021 IEEE 30th WETICE, pages 45–50.

Ait Hsain, Y., Laaz, N., and Mbarki, S. (2021). Ethereum’s Smart Contracts Construction and Development using Model Driven Engineering Technologies: a Review. Procedia Computer Science, 184:785–790. The 12th ANT / The 4th EDI40 / Affiliated Workshops.

Angelis, J. and Ribeiro da Silva, E. (2019). Blockchain adoption: A value driver perspective. Business Horizons, 62(3):307–314.

Ben Slama Souei, W., El Hog, C., Sliman, L., Ben Djemaa, R., and Ben Amor, I. A. (2021). Towards a Uniform Description Language for Smart Contract. In 2021 IEEE 30th WETICE, pages 57–62.

Boubeta-Puig, J., Rosa-Bilbao, J., and Mendling, J. (2021). CEPchain: A graphical model-driven solution for integrating complex event processing and blockchain. Expert Systems with Applications, 184:115578.

Chirtoaca, D., Ellul, J., and Azzopardi, G. (2020). A Framework for Creating Deployable Smart Contracts for Non-fungible Tokens on the Ethereum Blockchain. In 2020 IEEE DAPPS, pages 100–105.

Corradini, F., Marcelletti, A., Morichetta, A., Polini, A., Re, B., and Tiezzi, F. (2022). Engineering Trustable and Auditable Choreography-Based Systems Using Blockchain. ACM Trans. Manage. Inf. Syst., 13(3).

Dharanikota, S., Mukherjee, S., Bhardwaj, C., Rastogi, A., and Lal, A. (2021). Celestial: A smart contracts verification framework. In 2021 FMCAD, pages 133–142.

Feist, J., Grieco, G., and Groce, A. (2019). Slither: A Static Analysis Framework for Smart Contracts. In 2019 IEEE/ACM 2nd WETSEB, pages 8–15.

Ferreira, J. F., Cruz, P., Durieux, T., and Abreu, R. (2020). Smart-Bugs: A Framework to Analyze Solidity Smart Contracts. In 2020 35th IEEE/ACM ASE, pages 1349–1352.

Garamvölgyi, P., Kocsis, I., Gehl, B., and Klenik, A. (2018a). Towards Model-Driven Engineering of Smart Contracts for Cyber-Physical Systems. In 2018 48th Annual IEEE/IFIP DSN-W), pages 134–139.

Garamvölgyi, P., Kocsis, I., Gehl, B., and Klenik, A. (2018b). Towards model-driven engineering of smart contracts for cyber-physical systems. In 2018 48th Annual IEEE/IFIP DSN-W, pages 134–139.

Guida, L. and Daniel, F. (2019). Supporting Reuse of Smart Contracts through Service Orientation and Assisted Development. In 2019 IEEE DAP-PCON, pages 59–68.

Hamdaqa, M., Met, L. A. P., and Qasse, I. (2022). iContractML 2.0: A domain-specific language for modeling and deploying smart contracts onto multiple blockchain platforms. Information and Software Technology, 144:106762.

Hamdaqa, M., Metz, L. A. P., and Qasse, I. (2020). IContractML: A Domain-Specific Language for Modeling and Deploying Smart Contracts onto Multiple Blockchain Platforms. In Proceedings SAM ’20, page 34–43. Association for Computing Machinery.

Iovino, L., Pierantonio, A., and Malavolta, I. (2012). On the Impact Significance of Metamodel Evolution in MDE. J. Object Technol., 11(3):3–1.

Jiao, J., Lin, S.-W., and Sun, J. (2020). A Generalized Formal Semantic Framework for Smart Contracts. In Fundamental Approaches to Software Engineering: 23rd FASE 2020/ETAPS 2020, Proceedings, page 75–96. Springer-Verlag.

Jurgelaitis, M., čeponienė, L., and Butkienė, R. (2022a). Solidity code generation from uml state machines in model-driven smart contract development. IEEE Access, 10:33465–33481.

Jurgelaitis, M., čeponienė, L., and Butkienė, R. (2022b). Solidity Code Generation From UML State Machines in Model-Driven Smart Contract Development. IEEE Access, 10:33465–33481.

Khan, A. G., Zahid, A. H., Hussain, M., Farooq, M., Riaz, U., and Alam, T. M. (2019). A journey of web and blockchain towards the industry 4.0: An overview. In 2019 International Conference on Innovative Computing (ICIC), pages 1–7.

Kudo, T. N., Bulcão-Neto, R. F., and Vincenzi, A. M. R. (2020). Metamodel Quality Requirements and Evaluation (MQuaRE). arXiv preprint arXiv:2008.09459.

Li, Z., Zhou, Y., Guo, S., and Xiao, B. (2021). SolSaviour: A Defending Framework for Deployed Defective Smart Contracts. In ACSAC ’21, page 748–760. Association for Computing Machinery.

Qasse, I., Mishra, S., and Hamdaqa, M. (2021). iContractBot: A Chatbot for Smart Contracts’ Specification and Code Generation. In 2021 IEEE/ACM 3rd BotSE, pages 35–38.

Rodrigues da Silva, A. (2015). Model-driven engineering: A survey supported by the unified conceptual model. Computer Languages, Systems Structures, 43:139–155.

Santiago, L., Abijaude, J., and Greve, F. (2021). A framework to generate smart contracts on the fly. In Proceedings SBES ’21, SBES ’21, page 410–415. Association for Computing Machinery.

Seidewitz, E. (2003). What models mean. IEEE Software, 20(5):26–32.

Zeng, Q., He, J., Zhao, G., Li, S., Yang, J., Tang, H., and Luo, H. (2022). EtherGIS: A Vulnerability Detection Framework for Ethereum Smart Contracts Based on Graph Learning Features. In 2022 IEEE 46th COMPSAC, pages 1742–1749.
Publicado
24/05/2024
VELASCO, Gislainy; VAZ, Noeli Antonia; CARVALHO, Sergio T.. A High-Level Metamodel for Developing Smart Contracts on the Ethereum Virtual Machine. In: WORKSHOP EM BLOCKCHAIN: TEORIA, TECNOLOGIAS E APLICAÇÕES (WBLOCKCHAIN), 6. , 2024, Niterói/RJ. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2024 . p. 97-110. DOI: https://doi.org/10.5753/wblockchain.2024.3409.