journal article·2025-05-27Open access

ErrorExplainer: Automated Extraction of Error Contexts from Smart Contracts

JongHyup Lee

Applied Sciences· Volume 15· Issue 11

Abstract

A persistent semantic gap separates the low-level revert data emitted by smart contracts from the high-level explanations Web3 users need when a transaction fails. Existing automated analyzers treat such reverts as hints of hidden vulnerabilities and do not tell users what actually went wrong. To close this gap and give users useful feedback, I present ErrorExplainer, an automated error-explanation framework rather than another bug detector. ErrorExplainer takes a novel two-phase approach. A lightweight static analysis of verified source code lifts every transaction-reverting statement into a canonical error representation of an origin function, a guard condition, and an expected error message. At runtime, when a failure occurs, ErrorExplainer first checks the invariant part of the error data with the error representation of the called function. If no hit appears, it expands the candidates to call traces until a match is found and then shows the matched record as a clear, human-readable explanation. The evaluation results show that ErrorExplainer could effectively identify 6284 normalized error records from a reverting-related dataset of SC-Bench. The high information completeness (0.952) and matching fitness (0.954 and 0.604 at the function and trace levels, respectively) indicate that the extracted error context of ErrorExplainer can provide more understandable information to users on failed operations.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Blockchain Technology Applications and Security · Ethics and Social Impacts of AI · FinTech, Crowdfunding, Digital Finance

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Mathematical Finance, Gachon University, Seongnam 13120, Republic of Korea

References (30)

Show source-provided references
1. User experience framework for understanding user experience in blockchain services10.1016/j.ijhcs.2021.102733 ↗
2. Panicker, Y., Soremekun, E., Sun, S., and Chattopadhyay, S. (2024). End-user Comprehension of Transfer Risks in Smart Contracts. arXiv.10.1145/3706598.3713887 ↗
3. Waas, M. (2025, May 25). Downsizing Contracts to Fight the Contract Size Limit. Available online: https://ethereum.org/en/developers/tutorials/downsizing-contracts-to-fight-the-contract-size-limit/.
4. Vogelsteller, F., and Buterin, V. (2025, May 25). ERC-20: Token Standard. Available online: https://eips.ethereum.org/EIPS/eip-20.
5. Xia, S., He, M., Song, L., and Zhang, Y. (2025, May 25). SC-Bench: A Large-Scale Dataset for Smart Contract Auditing. Available online: http://arxiv.org/abs/2410.06176.
6. (2025, May 25). Etherscan. Available online: https://etherscan.io.
7. Wood, G. (2025, May 25). Ethereum: A Secure Decentralised Generalised Transaction Ledger. Available online: https://ethereum.github.io/yellowpaper/paper.pdf.
8. Team, S.C. (2025, May 25). Solidity 0.8.25 Documentation: Error Handling. Available online: https://docs.soliditylang.org/en/v0.8.25/control-structures.html.
9. Liu, L., Wei, L., Zhang, W., Wen, M., Liu, Y., and Cheung, S.C. (2021, January 15–19). Characterizing transaction-reverting statements in ethereum smart contracts. Proceedings of the 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE), Melbourne, Australia.10.1109/ASE51524.2021.9678597 ↗
10. Yan, K., Zhang, X., and Diao, W. (2024, January 14–18). Stealing trust: Unraveling blind message attacks in web3 authentication. Proceedings of the 2024 on ACM SIGSAC Conference on Computer and Communications Security, Salt Lake City, UT, USA.10.1145/3658644.3670323 ↗
11. Zelenka, B., Carchrae, T., and Naumenko, G. (2025, May 25). ERC-1066: Status Codes. Available online: https://eips.ethereum.org/EIPS/eip-1066.
12. Bond, F., and de Souza, R.R. (2025, May 25). ERC-838: ABI Specification for REVERT Reason String. Available online: https://eips.ethereum.org/EIPS/eip-838.
13. García, E., Giordano, F., and Croubois, H. (2025, May 25). ERC-6093: Custom Errors for Commonly-Used Tokens. Available online: https://eips.ethereum.org/EIPS/eip-6093.
14. Entriken, W., Shirley, D., Evans, J., and Sachs, N. (2025, May 25). ERC-721: Non-Fungible Token Standard. Available online: https://eips.ethereum.org/EIPS/eip-721.
15. Radomski, W., Cooke, A., Castonguay, P., Therien, J., Binet, E., and Sandford, R. (2025, May 25). ERC-1155: Multi Token Standard. Available online: https://eips.ethereum.org/EIPS/eip-1155.
16. Zelenka, B., and Cooper, J. (2025, May 25). ERC-1444: Localized Messaging with Signal-to-Text. Available online: https://eips.ethereum.org/EIPS/eip-1444.
17. Meisami, S., and Bodell, W.E. (2025, May 25). A Comprehensive Survey of Upgradeable Smart Contract Patterns. Available online: https://arxiv.org/abs/2304.03405.
18. Ethereum Foundation (2025, May 25). Ethereum JSON-RPC API Specification. Available online: https://ethereum.org/en/developers/docs/apis/json-rpc/.
19. Li, X., Yang, J., Chen, J., Tang, Y., and Gao, X. (2024, January 13–17). Characterizing ethereum upgradable smart contracts and their security implications. Proceedings of the ACM Web Conference 2024, Singapore.10.1145/3589334.3645640 ↗
20. Palladino, S., and Francisco Giordano, H.C. (2025, May 25). EIP-1967: Upgradeable Proxy Storage Slots. Available online: https://eips.ethereum.org/EIPS/eip-1967.
21. (2025, May 25). OpenZeppelin. OpenZeppelin Contract Library. Available online: https://docs.openzeppelin.com/contracts/5.x/.
22. Nadolinski, E., and Spagnuolo, F. (2025, May 25). Proxy Patterns. Available online: https://blog.openzeppelin.com/proxy-patterns/.
23. (2025, May 25). Crytic. Slither, the Smart Contract Static Analyzer. Available online: https://github.com/crytic/slither.
24. Ethereum Foundation (2025, May 25). web3.py: A Python Library for Interacting with Ethereum. Available online: https://github.com/ethereum/web3.py.
25. Liao, Z., Hao, S., Nan, Y., and Zheng, Z. (2023, January 17–21). SmartState: Detecting state-reverting vulnerabilities in smart contracts via fine-grained state-dependency analysis. Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis, Seattle, WA, USA.10.1145/3597926.3598111 ↗
26. Jiang, B., Liu, Y., and Chan, W.K. (2018, January 3–7). Contractfuzzer: Fuzzing smart contracts for vulnerability detection. Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, Montpellier, France.10.1145/3238147.3238177 ↗
27. Mitropoulos, C., Kechagia, M., Maschas, C., Ioannidis, S., Sarro, F., and Mitropoulos, D. (2024). Charting The Evolution of Solidity Error Handling. arXiv.10.1145/3674805.3686686 ↗
28. Mitropoulos, C., Kechagia, M., Maschas, C., Ioannidis, S., Sarro, F., and Mitropoulos, D. (2024, January 24–25). Broken Agreement: The Evolution of Solidity Error Handling. Proceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, Barcelona, Spain.10.1145/3674805.3686686 ↗
29. Luu, L., Chu, D.H., Olickel, H., Saxena, P., and Hobor, A. (2016, January 24–28). Making smart contracts smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria.10.1145/2976749.2978309 ↗
30. Smashing ethereum smart contracts for fun and real profit