arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.00650cs.SE
收藏

Solidity智能合约的自动化不变式生成

Automated Invariant Generation for Solidity Smart Contracts

Ye Liu, Chengxuan Zhang, Yi Li.

AI总结:

针对智能合约规范缺失导致正确性验证困难的问题,提出基于动态推断与静态验证的不变式生成框架INVCON+,能自动生成经过验证的高质量不变式规范以保护智能合约免受常见漏洞影响。

摘要:

智能合约是在区块链上运行的计算机程序,用于自动化执行用户间的交易。合约规范的缺失对智能合约的正确性验证构成了真正的挑战。程序不变式是在整个执行过程中始终保持的属性,刻画了程序行为的一个重要方面。在本文中,我们提出了一种新颖的不变式生成框架INVCON+,用于Solidity智能合约。INVCON+扩展现有的不变式检测器InvCon,基于动态推断和静态验证自动生成经过验证的合约不变式。与INVCON+不同,InvCon仅生成可能成立的不变式,这些不变式有很大概率成立,但仍未针对合约代码进行验证。特别是,INVCON+能够推断出更具表达力的不变式,以捕获合约代码更丰富的语义关系。我们在361个ERC20和10个ERC721真实世界合约,以及常见的ERC20漏洞基准上评估了INVCON+。实验结果表明,INVCON+高效地生成了高质量的不变式规范,可用于保护智能合约免受常见漏洞的影响。

英文摘要:

Smart contracts are computer programs running on blockchains to automate the transaction execution between users. The absence of contract specifications poses a real challenge to the correctness verification of smart contracts. Program invariants are properties that are always preserved throughout the execution, which characterize an important aspect of the program behaviors. In this paper, we propose a novel invariant generation framework, INVCON+, for Solidity smart contracts. INVCON+ extends the existing invariant detector, InvCon, to automatically produce verified contract invariants based on both dynamic inference and static verification. Unlike INVCON+, InvCon only produces likely invariants, which have a high probability to hold, yet are still not verified against the contract code. Particularly, INVCON+ is able to infer more expressive invariants that capture richer semantic relations of contract code. We evaluate INVCON+ on 361 ERC20 and 10 ERC721 real-world contracts, as well as common ERC20 vulnerability benchmarks. The experimental results indicate that INVCON+ efficiently produces high-quality invariant specifications, which can be used to secure smart contracts from common vulnerabilities.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑