Abstract
Smart contracts codify real-world transactions and automatically execute the terms of the contract when predefined conditions are met. This paper proposes SmartML, a modeling language for smart contracts that is platform independent and easy to comprehend. We detail its formal semantics and type system with a focus on its role in addressing security vulnerabilities. We show along a case study, how SmartML prevents reentrancy attacks, illustrating its efficacy in reinforcing the reliability and security of smart contracts within decentralized systems.
This work is funded by the ATHENE project “Model-centric Deductive Verification of Smart Contracts”.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
State variables in Solidity terminology.
- 2.
As a contract might be associated with multiple locations, by a slight abuse of notation we identify \(\langle \mathcal {S}(v),m_v\rangle \) with \({\langle \kappa _1,m_v\rangle ,\ldots ,\langle \kappa _n,m_v\rangle }\), where \(\mathcal {S}(v) = \{\kappa _1,\ldots ,\kappa _n\)}.
References
Aptos Blockchain. Official Website. https://aptos.dev/en
Diem Blockchain. Official Website. https://www.diem.com/en-us/
Ethereum. Official Website. https://ethereum.org/
Hyperledger Fabric. Official Website. https://www.hyperledger.org/projects/fabric
NXT. Official Website. https://nxt.org/
Sui Foundation. Official Website. https://sui.io/about
The Move Language. https://move-book.com/reference/
Abdellatif, T., Brousmiche, K.L.: Formal verification of smart contracts based on users and blockchain behaviors models. In: NTMS, pp. 1–5. IEEE (2018)
Bashir, I.: Mastering Blockchain. Packt Publishing (2017)
Cecchetti, E., Yao, S., Ni, H., Myers, A.C.: Compositional security for reentrant applications. In: SP, pp. 1249–1267. IEEE (2021)
Coblenz, M., et al.: Obsidian: typestate and assets for safer blockchain programming. arXiv preprint arXiv:1909.03523 (2019)
Das, A., Balzer, S., Hoffmann, J., Pfenning, F., Santurkar, I.: Resource-aware session types for digital contracts. In: 34th IEEE Computer Security Foundations Symposium, CSF 2021, pp. 1–16. IEEE (2021). https://doi.org/10.1109/CSF51468.2021.00004
Lahiri, S.K., Chen, S., Wang, Y., Dillig, I.: Formal specification and verification of smart contracts for azure blockchain. arxiv preprint arXiv:1812.08829 (2018)
Li, A., Choi, J.A., Long, F.: Securing smart contract with runtime validation. In: PLDI, pp. 438–453. ACM (2020)
Luu, L., Chu, D.H., Olickel, H., Saxena, P., Hobor, A.: Making Smart Contracts Smarter. In: CCS, pp. 254–269. ACM (2016)
Plotkin, G.D.: A structural approach to operational semantics. J. Log. Algebraic Methods Program. 60–61, 17–139 (2004)
Schrans, F., Hails, D., Harkness, A., Drossopoulou, S., Eisenbach, S.: Flint for safer smart contracts. arxiv preprint arXiv:1904.06534 (2019)
Sergey, I., Kumar, A., Hobor, A.: Scilla: a smart contract intermediate-level language. arXiv preprint arXiv:1801.00687 (2018)
Sergey, I., Nagaraj, V., Johannsen, J., Kumar, A., Trunov, A., Hao, K.C.: Safer smart contract programming with Scilla. Proc. ACM Program. Lang. 3(OOPSLA), 185:1–185:30 (2019). https://doi.org/10.1145/3360611
Siegel, D.: Understanding the DAO attack (2023). https://www.coindesk.com/learn/understanding-the-dao-attack/
Tan, B., Mariano, B., Lahiri, S.K., Dillig, I., Feng, Y.: SolType: refinement types for arithmetic overflow in solidity. Proc. ACM Program. Lang. 6(POPL), 1–29 (2022)
Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Buenzli, F., Vechev, M.T.: Securify: practical security analysis of smart contracts. arXiv preprint arXiv:1806.01143 (2018)
Veschetti, A., Bubel, R., Hähnle, R.: SmartML: towards a modeling language for smart contracts. arXiv preprint arXiv:2403.06622 (2024)
Wöhrer, M., Zdun, U.: Smart contracts: security patterns in the ethereum ecosystem and solidity. In: IWBOSE@SANER, pp. 2–8. IEEE (2018)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Veschetti, A., Bubel, R., Hähnle, R. (2025). A Formal Modeling Language for Smart Contracts. In: Madeira, A., Knapp, A. (eds) Software Engineering and Formal Methods. SEFM 2024. Lecture Notes in Computer Science, vol 15280. Springer, Cham. https://doi.org/10.1007/978-3-031-77382-2_6
Download citation
DOI: https://doi.org/10.1007/978-3-031-77382-2_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-77381-5
Online ISBN: 978-3-031-77382-2
eBook Packages: Computer ScienceComputer Science (R0)