[Paper Review] SolidityCheck : Quickly Detecting Smart Contract Problems Through Regular Expressions
This paper proposes SolidityCheck, a fast and accurate static analysis tool that uses regular expressions and program instrumentation to detect 20 types of smart contract vulnerabilities in Solidity source code, including critical issues like re-entrancy and integer overflow. It outperforms existing tools in detection efficiency and accuracy by leveraging source code semantics and precise pattern matching.
As a blockchain platform that has developed vigorously in recent years, Ethereum is different from Bitcoin in that it introduces smart contracts into blockchain.Solidity is one of the most mature and widely used smart contract programming language,which is used to write smart contracts and deploy them on blockchain. However, once the data in the blockchain is written, it cannot be modified. Ethereum smart contract is stored in the block chain, which makes the smart contract can no longer repair the code problems such as re-entrancy vulnerabilities or integer overflow problems. Currently, there still lacks of an efficient and effective approach for detecting these problems in Solidity. In this paper, we first classify all the possible problems in Solidity, then propose a smart contract problem detection approach for Solidity, namely SolidityCheck. The approach uses regular expressions to define the characteristics of problematic statements and uses regular matching and program instrumentation to prevent or detect problems. Finally, a large number of experiments is performed to show that SolidityCheck is superior to existing approaches.
Motivation & Objective
- To address the lack of efficient and accurate tools for detecting smart contract vulnerabilities in Solidity source code before deployment.
- To overcome limitations in existing tools that rely on bytecode analysis, which lose high-level semantic information and suffer from low efficiency.
- To improve detection accuracy by defining precise, regular expression-based patterns for problematic code constructs, especially for high-severity issues like re-entrancy and integer overflow.
- To provide developers with a fast, source-code-aware tool that enables early detection and easy modification of problematic code patterns.
- To establish a comprehensive, up-to-date classification of smart contract problems covering security, performance, and maintainability issues.
Proposed method
- The authors classify smart contract problems into three categories: security, performance, and hidden coding threats, identifying 20 specific problem types.
- They design regular expression patterns to precisely match problematic code constructs in Solidity source code, such as unsafe external calls or unchecked arithmetic operations.
- The approach combines regular expression matching with lightweight program instrumentation to enhance detection accuracy and reduce false positives.
- The tool is implemented as a static analysis engine that processes Solidity source files and reports detected issues with line-level precision.
- The method avoids costly lexical and grammatical analysis by directly matching syntactic patterns, significantly improving performance.
- The tool is evaluated using a large corpus of real-world smart contracts to validate effectiveness and efficiency.
Experimental results
Research questions
- RQ1Can regular expressions be effectively used to detect a broad range of smart contract vulnerabilities in Solidity source code with high precision?
- RQ2How does the performance of a regular expression-based approach compare to existing tools that rely on bytecode analysis or complex parsing?
- RQ3Can the proposed method detect critical vulnerabilities such as re-entrancy and integer overflow more accurately than prior tools?
- RQ4To what extent does the use of program instrumentation improve detection accuracy without sacrificing speed?
- RQ5Is the proposed classification of 20 smart contract problems comprehensive and practical for real-world smart contract development?
Key findings
- SolidityCheck successfully detects 20 distinct types of smart contract problems, including previously under-recognized or undetected issues.
- The tool outperforms existing approaches in detection efficiency, avoiding the performance overhead of full lexical and grammatical analysis.
- It accurately identifies high-risk vulnerabilities such as re-entrancy and integer overflow, which are critical for contract security.
- The use of regular expressions enables fast, scalable analysis while maintaining high precision in locating problematic code patterns.
- Experiments show that SolidityCheck reduces false positives and false negatives compared to tools like SmartCheck, which rely on complex parse trees.
- The tool demonstrates strong usability and scalability on real-world smart contract datasets, making it suitable for integration into development workflows.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.