paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Identifying Solidity Smart Contract API Documentation Errors

识别 Solidity 智能合约 API 文档错误
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 该论文属于程序分析在智能合约 API 文档一致性检测中的应用,但未涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向,与应用静态分析于 ML/Agentic 程序的关注点也相距较远。引用 16 inbox
Chenguang Zhu, Ye Liu, Xiuheng Wu, Yi Li
crossref: 2026-09-12

AI 速览

一句话:提出 DocCon,基于预计算事实检测 Solidity 智能合约库 API 文档与代码的不一致。

智能合约开发者常依赖 OpenZeppelin 等 Solidity 库,其 API 文档是学习正确用法的重要来源,但文档维护困难,文档与代码不一致会误导开发者。论文提出 DocCon,针对 Solidity 智能合约库检测文档与代码之间的不一致。该方法采用基于事实的方式,从 API 代码和文档中预计算事实并存入数据库,再支持按不同严重程度查询不一致,如参数不匹配、缺失需求、过时描述等。作者在流行智能合约库上评估,DocCon 达到较好精度并适用于不同库;报告的 40 个错误中,29 个被库开发者确认,22 个已修复,表明其能发现高优先级文档问题。

问题
智能合约库的 API 文档难以持续维护,文档与代码不一致会给不熟悉 API 的开发者带来学习和使用障碍。
方法
提出 DocCon,采用基于事实的方法,从 API 代码和文档中预计算事实并存入数据库,再查询不同严重程度的文档-代码不一致。
评估
在流行 Solidity 智能合约库上检测高优先级 API 文档错误,报告 40 个错误,其中 29 个被确认、22 个被修复,显示较好精度与跨库适用性。
原文摘要(Abstract)

Smart contracts are gaining popularity as a means to support transparent, traceable, and self-executing decentralized applications, which enable the exchange of value in a trustless environment. Developers of smart contracts rely on various libraries, such as OpenZeppelin for Solidity contracts, to improve application quality and reduce development costs. The API documentations of these libraries are important sources of information for developers who are unfamiliar with the APIs. Yet, maintaining high-quality documentations is non-trivial, and errors in documentations may place barriers for developers to learn the correct usages of APIs. In this paper, we propose a technique, DocCon, to detect inconsistencies between documentations and the corresponding code for Solidity smart contract libraries. Our fact-based approach allows inconsistencies of different severity levels to be queried, from a database containing precomputed facts about the API code and documentations. DocCon successfully detected high-priority API documentation errors in popular smart contract libraries, including mismatching parameters, missing requirements, outdated descriptions, etc. Our experiment result shows that DocCon achieves good precision and is applicable to different libraries: 29 and 22 out of our reported 40 errors have been confirmed and fixed by library developers so far.

链接与引用

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

BibTeX
@inproceedings{paperbot7213,
  title = {Identifying Solidity Smart Contract API Documentation Errors},
  author = {Chenguang Zhu and Ye Liu and Xiuheng Wu and Yi Li},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3556963}
}