Ruschioni, Luca;
Shuttleworth, Robert;
Neykova, Rumyana;
Re, Barbara;
Destefanis, Giuseppe;
(2025)
Micro-Patterns in Solidity Code.
In: Ali Babar, Muhammad and Tosun, Ayşe and Wagner, Stefan and Stray, Viktoria, (eds.)
EASE '25: Proceedings of the 29th International Conference on Evaluation and Assessment in Software Engineering.
(pp. pp. 305-315).
ACM (Association for Computing Machinery): New York, NY, United States.
Preview |
Text
Destefanis_3756681.3756934.pdf Download (1MB) | Preview |
Abstract
Solidity is the predominant programming language for blockchain-based smart contracts, and its characteristics pose significant challenges for code analysis and maintenance. Traditional software analysis approaches, while effective for conventional programming languages, often fail to address Solidity-specific features such as gas optimization and security constraints. This paper introduces micro-patterns - recurring, small-scale design structures that capture key behavioral and structural peculiarities specific to a language - for Solidity language and demonstrates their value in understanding smart contract development practices. We identified 18 distinct micro-patterns organized in five categories (Security, Functional, Optimization, Interaction, and Feedback), detailing their characteristics to enable automated detection. To validate this proposal, we analyzed a dataset of 23258 smart contracts from five popular blockchains (Ethereum, Polygon, Arbitrum, Fantom and Optimism). Our analysis reveals widespread adoption of micro-patterns, with 99% of contracts implementing at least one pattern and an average of 2.76 patterns per contract. The Storage Saver pattern showed the highest adoption (84.62% mean coverage), while security patterns demonstrated platform-specific adoption rates. Statistical analysis revealed significant platform-specific differences in adoption, particularly in Borrower, Implementer, and Storage Saver patterns.
| Type: | Proceedings paper |
|---|---|
| Title: | Micro-Patterns in Solidity Code |
| Event: | EASE '25: Evaluation and Assessment in Software Engineering |
| ISBN-13: | 9798400713859 |
| Open access status: | An open access version is available from UCL Discovery |
| DOI: | 10.1145/3756681.3756934 |
| Publisher version: | https://doi.org/10.1145/3756681.3756934 |
| Language: | English |
| Additional information: | © The Author(s), 2025. This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. https://creativecommons.org/licenses/by/4.0/ |
| Keywords: | Solidity, Smart Contract, Micro Pattern, Pattern Recognition, |
| UCL classification: | UCL UCL > Provost and Vice Provost Offices > UCL BEAMS UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science |
| URI: | https://discovery.ucl.ac.uk/id/eprint/10219517 |
Archive Staff Only
![]() |
View Item |

