paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Demystifying the Composition and Code Reuse in Solidity Smart Contracts

揭秘 Solidity 智能合约的组成与代码复用
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 论文是 Solidity 智能合约的大规模实证与代码复用研究,属于经验软件工程/区块链安全,与用户关注的 PL→AI、AI→PL、浮点程序分析、贝叶斯程序分析等核心方向没有直接交集。虽然标签包含程序分析与安全,但其方法并非静态分析形式化、LLM/Agent 工具或相关交叉研究。引用 29 inbox
Kairan Sun, Zhengzi Xu, Chengwei Liu, Kaixuan Li, Yang Liu
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:通过大规模实证分析揭示 Solidity 智能合约的子合约组成、代码复用特征及常见开发模式。

Solidity 智能合约开发常依赖第三方包等外部来源以降低成本,但缺乏标准化包管理器,给下游应用的安全保障带来困难。已有研究多关注代码克隆,未考察外部组件如何引入,合约组成与特征仍不清晰。本文对超过 35 万个 Solidity 智能合约开展实证研究,分析其组成、代码复用并识别常见开发模式。结果发现:典型合约约含 10 个子合约,其中逾 80% 来自外部;自研子合约中约 50% 的独特函数占比不足 10%,函数级复用普遍;外部子合约中约 35% 是标准/协议接口模板,但子合约类型使用不一致;并提取出 61 种频繁复用的开发模式,为安全高效开发提供洞见。

问题
现有研究仅关注代码克隆,未揭示 Solidity 智能合约的组成结构、外部组件引入方式及代码复用特征。
方法
对超过 35 万个 Solidity 智能合约进行大规模实证分析,考察子合约组成、代码复用并挖掘开发模式。
评估
基于 35 万余个真实合约的统计分析,报告子合约来源、独特函数占比、接口比例等指标,并提取 61 种频繁复用模式。
原文摘要(Abstract)

As the development of Solidity smart contracts has increased in popularity, the reliance on external sources such as third-party packages increases to reduce development costs. However, despite the use of external sources bringing flexibility and efficiency to the development, they could also complicate the process of assuring the security of downstream applications due to the lack of package managers for standardized ways and sources. While previous studies have only focused on code clones without considering how the external components are introduced, the compositions of a smart contract and their characteristics still remain puzzling. To fill these gaps, we conducted an empirical study with over 350,000 Solidity smart contracts to uncover their compositions, conduct code reuse analysis, and identify prevalent development patterns. Our findings indicate that a typical smart contract comprises approximately 10 subcontracts, with over 80% of these originating from external sources, reflecting the significant reliance on third-party packages. For self-developed subcontracts, around 50% of the subcontracts have less than 10% unique functions, suggesting that code reuse at the level of functions is also common. For external subcontracts, though around 35% of the subcontracts are interfaces to provide templates for standards or protocols, an inconsistency in the use of subcontract types is also identified. Lastly, we extracted 61 frequently reused development patterns, offering valuable insights for secure and efficient smart contract development.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{SunXLLL23,
  title = {Demystifying the Composition and Code Reuse in Solidity Smart Contracts},
  author = {Kairan Sun and Zhengzi Xu and Chengwei Liu and Kaixuan Li and Yang Liu},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616270}
}