Characterizing Transaction-Reverting Statements in Ethereum Smart Contracts
Lu Liu, Lili Wei, Wuqi Zhang, Ming Wen, Yepang Liu, Shing-Chi Cheung
摘要
Smart contracts are programs stored on blockchains to execute transactions. When input constraints or security properties are violated at runtime, the transaction being executed by a smart contract needs to be reverted to avoid undesirable consequences. On Ethereum, the most popular blockchain that supports smart contracts, developers can choose among three transaction-reverting statements (i.e., require, if...revert, and if...throw) to handle anomalous transactions. While these transaction-reverting statements are vital for preventing smart contracts from exhibiting abnormal behaviors or suffering malicious attacks, there is limited understanding of how they are used in practice. In this work, we perform the first empirical study to characterize transaction-reverting statements in Ethereum smart contracts. We measured the prevalence of these statements in 3,866 verified smart contracts from popular dapps and built a taxonomy of their purposes via manually analyzing 557 transaction-reverting statements. We also compared template contracts and their corresponding custom contracts to understand how developers customize the use of transactionreverting statements. Finally, we analyzed the security impact of transaction-reverting statements by removing them from smart contracts and comparing the mutated contracts against the original ones. Our study led to important findings. For example, we found that transaction-reverting statements are commonly used to perform seven types of authority verifications or validity checks, and missing such statements may compromise the security of smart contracts. We also found that current smart contract security analyzers cannot effectively handle transaction-reverting statements when detecting security vulnerabilities. Our findings can shed light on further research in the broad area of smart contract quality assurance and provide practical guidance to smart contract developers on the appropriate use of transactionreverting statements.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 12 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Safeguarding Blockchain Ecosystem: Understanding and Detecting Attack Transactions on Cross-chain Bridges 引用了 The Art of The Scam: Demystifying Honeypots in Ethereum Smart Contracts
- ZEUS: Analyzing Safety of Smart Contracts 引用了 Making Smart Contracts Smarter
- The Art of The Scam: Demystifying Honeypots in Ethereum Smart Contracts 引用了 Securify: Practical Security Analysis of Smart Contracts
- Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts 引用了 ZEUS: Analyzing Safety of Smart Contracts
- Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts 引用了 Making Smart Contracts Smarter
- Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts 引用了 The Art of The Scam: Demystifying Honeypots in Ethereum Smart Contracts
- Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts 引用了 Securify: Practical Security Analysis of Smart Contracts
- Understanding Solidity Event Logging Practices in the Wild 引用了 Making Smart Contracts Smarter
- Understanding Solidity Event Logging Practices in the Wild 引用了 Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts
- Understanding Solidity Event Logging Practices in the Wild 引用了 Securify: Practical Security Analysis of Smart Contracts
- SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency Analysis 引用了 ZEUS: Analyzing Safety of Smart Contracts
- SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency Analysis 引用了 Making Smart Contracts Smarter
- SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency Analysis 引用了 Empirical review of automated analysis tools on 47, 587 Ethereum smart contracts
- SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency 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
- An Empirical Study of Malicious Code In PyPI EcosystemWenbo Guo, Zhengzi Xu, Chengwei Liu, Cheng Huang 等ASE 2023 · 31 次引用
- DeepInfer: Deep Type Inference from Smart Contract BytecodeKunsong Zhao, Zihao Li, Jianfeng Li, He Ye 等FSE 2023 · 24 次引用
- SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency AnalysisZeqin Liao, Sicheng Hao, Yuhong Nan, Zibin ZhengISSTA 2023 · 22 次引用
- Safeguarding Blockchain Ecosystem: Understanding and Detecting Attack Transactions on Cross-chain BridgesJiajing Wu, Kaixin Lin, Dan Lin, Bozhao Zhang 等WWW 2025 · 20 次引用
- Understanding Solidity Event Logging Practices in the WildLantian Li, Yejian Liang, Zhihao Liu, Zhongxing YuFSE 2023 · 13 次引用
它引用的 Paper8
- 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 次引用
- Empirical review of automated analysis tools on 47, 587 Ethereum smart contractsThomas Durieux, João F. Ferreira, Rui Abreu, Pedro CruzICSE 2020 · 373 次引用
- The Art of The Scam: Demystifying Honeypots in Ethereum Smart ContractsChristof Ferreira Torres, Mathis Steichen, Radu StateUSENIX Security 2019 · 239 次引用
相关 Paper
- Demystifying Invariant Effectiveness for Securing Smart ContractsZhiyang Chen, Ye Liu, Sidi Mohamed Beillahi, Yi Li 等FSE 2024 · 15 次引用
- Abusing the Ethereum Smart Contract Verification Services for Fun and ProfitPengxiang Ma, Ningyu He, Yuhua Huang, Haoyu Wang 等NDSS 2024
- VERISMART: A Highly Precise Safety Verifier for Ethereum Smart ContractsSunbeom So, Myungho Lee, Jisu Park, Heejo Lee 等S&P 2020 · 133 次引用
- A Mixed-Methods Study of Security Practices of Smart Contract DevelopersTanusree Sharma, Kyrie Zhixuan Zhou, Andrew Miller, Yang WangUSENIX Security 2023
- eTainter: detecting gas-related vulnerabilities in smart contractsAsem Ghaleb, Julia Rubin, Karthik PattabiramanISSTA 2022 · 57 次引用
