SolType: refinement types for arithmetic overflow in solidity
Bryan Tan, Benjamin Mariano, Shuvendu K. Lahiri, Isil Dillig, Yu Feng
Abstract
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
12 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Towards Finding Accounting Errors in Smart Contracts cites VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts
- Towards Finding Accounting Errors in Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
- Towards Finding Accounting Errors in Smart Contracts cites Making Smart Contracts Smarter
- Towards Finding Accounting Errors in Smart Contracts cites Securify: Practical Security Analysis of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts cites 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 cites ZEUS: Analyzing Safety of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts cites VerX: Safety Verification of Smart Contracts
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart Contracts cites Securify: Practical Security Analysis of Smart Contracts
- Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based Reasoning cites Towards Finding Accounting Errors in Smart Contracts
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts cites Making Smart Contracts Smarter
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts cites Securify: Practical Security Analysis of Smart Contracts
- ZEUS: Analyzing Safety of Smart Contracts cites Making Smart Contracts Smarter
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis cites VERISMART: A Highly Precise Safety Verifier for Ethereum Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis cites ZEUS: Analyzing Safety of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis cites VerX: Safety Verification of Smart Contracts
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis cites Securify: Practical Security Analysis of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts cites Making Smart Contracts Smarter
Cited by top-tier papers12
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program AnalysisYuqiang Sun, Daoyuan Wu, Yue Xue, Han Liu et al.ICSE 2024 · 131 citations
- Certifying Zero-Knowledge Circuits with Refinement TypesJunrui Liu, Ian Kretz, Hanzhi Liu, Bryan Tan et al.S&P 2024 · 30 citations
- Detecting Bugs with Substantial Monetary Consequences by LLM and Rule-based ReasoningBrian Zhang, Zhuo ZhangNeurIPS 2024 · 12 citations
- Using My Functions Should Follow My Checks: Understanding and Detecting Insecure OpenZeppelin Code in Smart ContractsHan Liu, Daoyuan Wu, Yuqiang Sun, Haijun Wang et al.USENIX Security 2024 · 11 citations
- Towards Finding Accounting Errors in Smart ContractsBrian ZhangICSE 2024 · 8 citations
Builds on7
- Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena et al.CCS 2016 · 2,306 citations
- Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
- ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 citations
- VerX: Safety Verification of Smart ContractsAnton Permenev, Dimitar Dimitrov, Petar Tsankov, Dana Drachsler-Cohen et al.S&P 2020 · 251 citations
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart ContractsSunbeom So, Myungho Lee, Jisu Park, Heejo Lee et al.S&P 2020 · 133 citations
Related papers
- Automated Inference on Financial Security of Ethereum Smart ContractsWansen Wang, Wenchao Huang, Zhaoyi Meng, Yan Xiong et al.USENIX Security 2023
- Learning Contract Invariants Using Reinforcement LearningJunrui Liu, Yanju Chen, Bryan Tan, Isil Dillig et al.ASE 2022 · 17 citations
- VarLifter: Recovering Variables and Types from Bytecode of Solidity Smart ContractsYichuan Li, Wei Song, Jeff HuangOOPSLA 2024 · 6 citations
- 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
