SolType:Solidity中算术溢出的细化类型
SolType: Refinement Types for Arithmetic Overflow in Solidity
摘要:
随着智能合约在金融交易中的采用,确保它们没有错误和安全漏洞变得越来越重要。在此上下文中特别相关的是算术溢出错误,因为整数通常用于表示帐户余额等金融资产。受这一观察的启发,本文提出了SolType,这是一种针对Solidity的细化类型系统,可用于防止智能合约中的算术溢出和不足。SolType允许开发人员添加细化类型注释,并使用它们来证明算术运算不会导致溢出和下溢。SolType包含丰富的细化术语词汇表,允许表达复杂数据结构的整数值和聚合属性之间的关系。此外,我们的实现,称为固体,采用了类型推断引擎,可以自动推断有用的类型注释,包括非平凡的合同不变式。为了评估我们的类型系统的有用性,我们使用Solid来证明总共120个智能合约的算术安全性。当在其全自动模式下使用时(即,使用Solid的类型推断功能),Solid能够消除86.3%用于防止溢出的冗余运行时检查。我们还将Solid与最先进的算术安全验证器VeriSmart进行了比较,结果表明Solid的误报率明显较低,同时在验证时间方面明显更快。
英文摘要:
As smart contracts gain adoption in financial transactions, it becomes increasingly important to ensure that they are free of bugs and security vulnerabilities. Of particular relevance in this context are arithmetic overflow bugs, as integers are often used to represent financial assets like account balances. Motivated by this observation, this paper presents SolType, a refinement type system for Solidity that can be used to prevent arithmetic over- and under-flows in smart contracts. SolType allows developers to add refinement type annotations and uses them to prove that arithmetic operations do not lead to over- and under-flows. SolType incorporates a rich vocabulary of refinement terms that allow expressing relationships between integer values and aggregate properties of complex data structures. Furthermore, our implementation, called Solid, incorporates a type inference engine and can automatically infer useful type annotations, including non-trivial contract invariants. To evaluate the usefulness of our type system, we use Solid to prove arithmetic safety of a total of 120 smart contracts. When used in its fully automated mode (i.e., using Solid's type inference capabilities), Solid is able to eliminate 86.3% of redundant runtime checks used to guard against overflows. We also compare Solid against a state-of-the-art arithmetic safety verifier called VeriSmart and show that Solid has a significantly lower false positive rate, while being significantly faster in terms of verification time.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。