Demystifying Loops in Smart Contracts
Benjamin Mariano, Yanju Chen, Yu Feng, Shuvendu K. Lahiri, Isil Dillig
Abstract
This paper aims to shed light on how loops are used in smart contracts. Towards this goal, we study various syntactic and semantic characteristics of loops used in over 20,000 Solidity contracts deployed on the Ethereum blockchain, with the goal of informing future research on program analysis for smart contracts. Based on our findings, we propose a small domain-specific language (DSL) that can be used to summarize common looping patterns in Solidity. To evaluate what percentage of smart contract loops can be expressed in our proposed DSL, we also design and implement a program synthesis toolchain called Solis that can synthesize loop summaries in our DSL. Our evaluation shows that at least 56% of the analyzed loops can be summarized in our DSL, and 81% of these summaries are exactly equivalent to the original loop.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
12 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Improving Smart Contract Security with Contrastive Learning-based Vulnerability Detection cites ZEUS: Analyzing Safety of Smart Contracts
- Improving Smart Contract Security with Contrastive Learning-based Vulnerability Detection cites Making Smart Contracts Smarter
- Improving Smart Contract Security with Contrastive Learning-based Vulnerability Detection cites Securify: Practical Security Analysis of Smart Contracts
- SolType: refinement types for arithmetic overflow in solidity cites ZEUS: Analyzing Safety of Smart Contracts
- SolType: refinement types for arithmetic overflow in solidity cites VerX: Safety Verification of Smart Contracts
- SolType: refinement types for arithmetic overflow in solidity cites Making Smart Contracts Smarter
- SolType: refinement types for arithmetic overflow in solidity cites Securify: Practical Security Analysis of Smart Contracts
- ZEUS: Analyzing Safety of Smart Contracts cites Making Smart Contracts Smarter
- A study of inline assembly in solidity smart contracts cites Securify: Practical Security Analysis of Smart Contracts
- WASAI: uncovering vulnerabilities in Wasm smart contracts cites Making Smart Contracts Smarter
- Securify: Practical Security Analysis of Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts cites Making Smart Contracts Smarter
Cited by top-tier papers12
- Improving Smart Contract Security with Contrastive Learning-based Vulnerability DetectionYizhou Chen, Zeyu Sun, Zhihao Gong, Dan HaoICSE 2024 · 44 citations
- WASAI: uncovering vulnerabilities in Wasm smart contractsWeimin Chen, Zihan Sun, Haoyu Wang, Xiapu Luo et al.ISSTA 2022 · 43 citations
- SolType: refinement types for arithmetic overflow in solidityBryan Tan, Benjamin Mariano, Shuvendu K. Lahiri, Isil Dillig et al.POPL 2022 · 29 citations
- Automated transpilation of imperative to functional code using neural-guided program synthesisBenjamin Mariano, Yanju Chen, Yu Feng, Greg Durrett et al.OOPSLA 2022 · 27 citations
- A study of inline assembly in solidity smart contractsStefanos Chaliasos, Arthur Gervais, Benjamin LivshitsOOPSLA 2022 · 22 citations
Builds on4
- Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena et al.CCS 2016 · 2,306 citations
- Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
- ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 citations
- VerX: Safety Verification of Smart ContractsAnton Permenev, Dimitar Dimitrov, Petar Tsankov, Dana Drachsler-Cohen et al.S&P 2020 · 251 citations
Related papers
- SmartIFSyn: Automated Information Flow Security Policy Synthesis for Smart ContractsYinghao Wu, Miaomiao Zhang, Fu Song, John W. Baugh Jr.FSE 2026
- Synthesis-powered optimization of smart contracts via data type refactoringYanju Chen, Yuepeng Wang, Maruth Goyal, James Dong et al.OOPSLA 2022 · 14 citations
- Securing smart contract with runtime validationAo Li, Jemin Andrew Choi, Fan LongPLDI 2020 · 60 citations
- SolContractEval: A Benchmark for Evaluating Contract-Level Solidity Code GenerationZhifan Ye, Jiachi Chen, Zhenzhe Shao, Lingfeng Bao et al.ASE 2025
- Declarative smart contractsHaoxian Chen, Gerald Whitters, Mohammad Javad Amiri, Yuepeng Wang et al.FSE 2022 · 14 citations
