SCAnoGenerator: Automatic Anomaly Injection for Ethereum Smart Contracts
Although many tools have been developed to detect anomalies in smart contracts, the evaluation of these analysis tools has been hindered by the lack of adequate anomalistic <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">real-world contracts</i> (i.e., smart contracts with addresses on Ethereum to achieve certain purposes). This problem prevents conducting reliable performance assessments on the analysis tools. An effective way to solve this problem is to inject anomalies into <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">real-world contracts</i> and automatically label the locations and types of the injected anomalies. <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SolidiFI</i>, as the first and only tool in this area, was developed to automatically inject anomalies into Ethereum smart contracts. However, <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SolidiFI</i> is subject to the limitations from its methodologies (e.g., its injection accuracy and authenticity are low). To address these limitations, we propose an approach called <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SCAnoGenerator</i>. <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SCAnoGenerator</i> supports Solidity 0.5.x, 0.6.x, 0.7.x and enables automatic anomaly injection for Ethereum smart contracts via analyzing the contracts’ control and data flows. Based on this approach, we develop an open-source tool, which can inject 20 types of anomalies into smart contracts. The extensive experiments show that <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SCAnoGenerator</i> outperforms <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SolidiFI</i> on the number of injected anomaly types, injection accuracy, and injection authenticity. The experimental results also reveal that existing analysis tools can only partially detect the anomalies injected by <italic xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">SCAnoGenerator</i>.
Authors
- Hai Dong (ORCID: https://orcid.org/0000-0002-7033-5688)
- Pengcheng Zhang (ORCID: https://orcid.org/0000-0003-3594-408X)
- Ben Wang (ORCID: https://orcid.org/0000-0001-7037-3660)
- Xiapu Luo (ORCID: https://orcid.org/0000-0002-9082-3208)
Institutions
- Hong Kong Polytechnic University (HK)
- Hohai University (CN)
- Ministry of Water Resources of the People's Republic of China (CN)
- RMIT University (AU)
Publication Details
- Journal
- IEEE Transactions on Software Engineering
- Published
- 2024-09-20
- DOI
- https://doi.org/10.1109/tse.2024.3464539
- Citations
- 5
- Primary Topic
- Blockchain Technology Applications and Security
- Type
- article
- Field-Weighted Citation Impact
- 3.90
Funders
- National Natural Science Foundation of China