Abstract
With the rapid development of blockchain, smart contract technology has been widely applied. However, the correctness and security of smart contracts face significant challenges. Vulnerabilities like the DAO exploit and Parity multi-signature wallet hacks have led to losses in the hundreds of millions of dollars. This project presents a vulnerability detection system for Ethereum smart contracts. The system generates a control flow graph (CFG) from assembly instruction sequences, then performs symbolic execution and vulnerability constraint solving. It detects common vulnerabilities such as integer overflow/underflow, reentrancy, and unchecked call return values with high accuracy, providing automated vulnerability reports.
Introduction
Smart contracts are self-executing programs on the blockchain that often manage millions of dollars in digital assets. Unlike traditional software, once a smart contract is deployed to the Ethereum network, its code is immutable—it cannot be "patched" in the traditional sense. Historical exploits have demonstrated that simple coding oversights can lead to catastrophic financial losses. As thousands of new contracts are deployed daily, manual auditing cannot keep pace. There is an urgent need for automated, high-accuracy tools that can scan contract bytecode for devastating security flaws before they are exploited.
Methodology
The proposed system utilizes a multi-stage pipeline to analyze contracts, capable of processing both source code and raw Ethereum Virtual Machine (EVM) bytecode.
The detection process follows these key steps:
- Decompilation: The system translates EVM bytecode into a sequence of opcodes (assembly-level instructions).
- Control Flow Graph (CFG) Generation: It maps out all possible execution paths, identifying jumps, loops, and branches.
- Symbolic Execution: Instead of concrete execution, the system uses "symbols" to represent variables. It traverses the CFG using a Depth-First Search (DFS) approach, building a mathematical model of every reachable state.
- Constraint Solving (Z3): Symbolic paths are converted into logical constraints. The Z3 solver—a state-of-the-art theorem prover—determines if any input could trigger a "vulnerability state."
The tool specifically targets three major vulnerability types: Reentrancy (checking for call instructions providing >2,300 gas), Integer Overflow/Underflow, and Unchecked Call Return Values. By focusing on EVM bytecode rather than Solidity source code, the tool can analyze any contract currently live on the blockchain, even if the developers haven't made their source code public.
Experimental Results
The system was evaluated using the awesome-buggy-erc20-tokens dataset, containing 1,552 smart contracts with known security flaws.
Key results include:
- Detection Performance: The tool identified vulnerabilities in 1,320 contracts, achieving an overall accuracy of 85.1%.
- Manual Verification: A manual audit of 20 flagged contracts confirmed 100% accuracy for those specific reports, including a confirmed integer overflow at address
0x0b76...c02A. - Vulnerability Distribution: "Unchecked call return value" was the most frequently detected bug, followed by "Integer overflow," with "Reentrancy" being the least common in this dataset.
Conclusion and Future Work
This research demonstrates the effectiveness of symbolic execution and constraint solving in securing the blockchain ecosystem. While the system currently supports 117 out of 142 EVM instructions, future work will focus on expanding this set to eliminate "blind spots." Additionally, the researchers aim to address "path explosion" in complex contracts and explore the automation of "suggested fixes" for developers based on the generated vulnerability reports.
Summary updated