一句话:对两万余个 Solidity 合约的循环进行实证研究,提出循环模式 DSL 与合成工具 Solis,可总结至少 56% 的循环。
本文关注智能合约中循环的使用方式及其对程序分析的影响。作者对部署在以太坊上的 20,000 多个 Solidity 合约进行实证研究,分析循环的语法与语义特征,以指导面向智能合约的程序分析研究。基于发现,提出一个小型领域特定语言(DSL),用于概括 Solidity 中常见的循环模式。为评估覆盖率,作者设计并实现了循环摘要合成工具链 Solis,能够为合约循环合成该 DSL 中的摘要。评估表明,至少 56% 的分析循环可用该 DSL 总结,其中 81% 的摘要与原循环完全等价。
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.