SolType: refinement types for arithmetic overflow in solidity
Bryan Tan, Benjamin Mariano, Shuvendu K. Lahiri, Isil Dillig, Yu Feng
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 12 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Towards Finding Accounting Errors in Smart Contracts 引用了 VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts
- Towards Finding Accounting Errors in Smart Contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Towards Finding Accounting Errors in Smart Contracts 引用了 Making Smart Contracts Smarter
- Towards Finding Accounting Errors in Smart Contracts 引用了 Securify: Practical Security Analysis of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts 引用了 VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts 引用了 VerX: Safety Verification of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts 引用了 Securify: Practical Security Analysis of Smart Contracts
- Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based Reasoning 引用了 Towards Finding Accounting Errors in Smart Contracts
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts 引用了 Making Smart Contracts Smarter
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts 引用了 Securify: Practical Security Analysis of Smart Contracts
- ZEUS: Analyzing Safety of Smart Contracts 引用了 Making Smart Contracts Smarter
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 ZEUS: Analyzing Safety of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 VerX: Safety Verification of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis 引用了 Securify: Practical Security Analysis of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts 引用了 Making Smart Contracts Smarter
引用它的顶会 Paper12
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program AnalysisYuqiang Sun, Daoyuan Wu, Yue Xue, Han Liu 等ICSE 2024 · 131 次引用
- Certifying Zero-Knowledge Circuits with Refinement TypesJunrui Liu, Ian Kretz, Hanzhi Liu, Bryan Tan 等S&P 2024 · 30 次引用
- Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based ReasoningBrian Zhang, Zhuo ZhangNeurIPS 2024 · 12 次引用
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart ContractsHan Liu, Daoyuan Wu, Yuqiang Sun, Haijun Wang 等USENIX Security 2024 · 11 次引用
- Towards Finding Accounting Errors in Smart ContractsBrian ZhangICSE 2024 · 8 次引用
它引用的 Paper7
- Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena 等CCS 2016 · 2,306 次引用
- Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais 等CCS 2018 · 1,108 次引用
- ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 次引用
- VerX: Safety Verification of Smart ContractsAnton Permenev, Dimitar Dimitrov, Petar Tsankov, Dana Drachsler-Cohen 等S&P 2020 · 251 次引用
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart ContractsSunbeom So, Myungho Lee, Jisu Park, Heejo Lee 等S&P 2020 · 133 次引用
相关 Paper
- Automated Inference on Financial Security of Ethereum Smart ContractsWansen Wang, Wenchao Huang, Zhaoyi Meng, Yan Xiong 等USENIX Security 2023
- Learning Contract Invariants Using Reinforcement LearningJunrui Liu, Yanju Chen, Bryan Tan, Isil Dillig 等ASE 2022 · 17 次引用
- VarLifter: Recovering Variables and Types from Bytecode of Solidity Smart ContractsYichuan Li, Wei Song, Jeff HuangOOPSLA 2024 · 6 次引用
- Verifying Economic Security of Smart Contracts via Unintended ReturnYi Rong, Xupeng Li, Ronghui GuOOPSLA 2026
- SmartIFSyn: Automated Information Flow Security Policy Synthesis for Smart ContractsYinghao Wu, Miaomiao Zhang, Fu Song, John W. Baugh Jr.FSE 2026
