paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Consolidating Smart Contracts with Behavioral Contracts

用行为契约强化智能合约
PLDI 8(PLDI)2024匹配度 3/10 · 论文属于程序语言与软件工程中的设计契约、运行时监控方向,与用户关注的静态分析、LLM/Agent 交叉、浮点程序分析或贝叶斯程序分析均无直接关系;仅在形式化规约与验证这一宽泛 PL 主题上有弱关联。引用 6 inbox
Guannan Wei, Danning Xie, Wuqi Zhang, Yongwei Yuan, Zhuo Zhang
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出 Solidity 语言扩展 ConSol,支持将行为契约附加到一等地址并在调用时监控违约,实现模块化的智能合约规约与验证。

智能合约在去中心化金融中广泛使用,其可靠性至关重要,但静态检查合约的丰富属性十分困难,动态验证因此更具实用前景。现有动态验证方法未能让程序员清晰表达组件之间的接口,尤其难以刻画代表不透明合约实例的地址行为。本文主张以“契约式设计”补充智能合约开发,并设计 Solidity 语言扩展 ConSol,提供模块化的规约与监控系统,同时覆盖功能性行为与潜在的地址行为。其核心能力是将规约附加到一等地址上,并在调用这些地址时监控违约。作者用 20 个真实案例评估 ConSol,展示其在表达关键条件与阻止攻击方面的有效性,并与手工插入断言修复的程序比较 gas 开销,表明仅引入边际开销。通过行为契约分离规约与实现,ConSol 帮助程序员编写更健壮、可读的智能合约。

问题
智能合约语言缺乏语言级机制来清晰表达组件接口与不透明合约地址的行为规约,静态检查丰富属性困难,现有动态验证方法也缺少模块化规约的支持。
方法
设计并实现 Solidity 语言扩展 ConSol,提供行为契约,允许将规约附加到一等地址,并在跨地址调用时进行运行时监控以捕获违约。
评估
在 20 个真实世界案例上评估 ConSol 表达关键条件与阻止攻击的有效性,并测量其效率与 gas 开销,与手工插入断言修复的程序进行比较。
原文摘要(Abstract)

Ensuring the reliability of smart contracts is of vital importance due to the wide adoption of smart contract programs in decentralized financial applications. However, statically checking many rich properties of smart contract programs can be challenging. On the other hand, dynamic validation approaches have shown promise for widespread adoption in practice. Nevertheless, as part of the programming environment for smart contracts, existing dynamic validation approaches have not provided programmers with a notion to clearly articulate the interface between components, especially for addresses representing opaque contract instances. We argue that the “design-by-contract” approach should complement the development of smart contract programs. Unfortunately, there is limited linguistic support for it in existing smart contract languages. In this paper, we design a Solidity language extension, ConSol, that supports behavioral contracts. ConSol provides programmers with a modular specification and monitoring system for both functional and latent address behaviors. The key capability of ConSol is to attach specifications to first-class addresses and monitor violations when invoking these addresses. We evaluate ConSol using 20 real-world cases, demonstrating its effectiveness in expressing critical conditions and preventing attacks. Additionally, we assess ConSol’s efficiency and compare gas consumption with programs fixed with manually inserted assertions, showing that our approach introduces only marginal gas overhead. By separating specifications and implementations using behavioral contracts, ConSol assists programmers in writing more robust and readable smart contracts.

链接与引用

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

BibTeX
@article{WeiXZYZ24,
  title = {Consolidating Smart Contracts with Behavioral Contracts},
  author = {Guannan Wei and Danning Xie and Wuqi Zhang and Yongwei Yuan and Zhuo Zhang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656416}
}