EquivSage: LLM-assisted Detection of EVM-Inequivalent Code Smells in Multi-chain Reuse Contracts

With the increasing development of Solidity contracts on Ethereum , more developers are reusing them on other compatible blockchains. However, developers may overlook the differences between the designs of the blockchain system, such as the Gas Mechanism and Consensus Protocol , leading to the same contracts on different blockchains not being able to achieve consistent execution as on Ethereum . This inconsistency reveals design flaws in reused contracts, exposing code smells that hinder code reusability, and we define this inconsistency as EVM-Inequivalent Code Smells . In this paper, we conducted an empirical study to reveal the causes and characteristics of EVM-Inequivalent Code Smells . To ensure the identified smells reflect real developer concerns, we analyzed 1,379 security audit reports, 823 bug bounty reports, and 326 Stack Overflow posts related to reused contracts on EVM-compatible blockchains, such as Binance Smart Chain (BSC) and Polygon . Using the Open Card Sorting method, we defined nine types of EVM-Inequivalent Code Smells . To enable efficient detection, we developed EquivSage , a tool that leverages the contextual understanding capabilities of large language models (LLMs) to guide slicing and static taint analysis via task-specific prompts. Symbolic execution is integrated to improve detection reliability. An analysis of 1,263,683 contracts across six EVM-compatible blockchains using EquivSage reveals that, on average, 15.45% contain at least one EVM-Inequivalent Code Smell , underscoring its widespread prevalence. Since 2024, code smells in reused contracts on Ethereum , Polygon , and Optimism have increased significantly. While not all instances lead to financial loss, high frequency and asset exposure highlight the risks inherent in contract reuse. Developers are encouraged to avoid copy-and-paste practices and to detect such smells proactively before reuse.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-08-24
DOI
https://doi.org/10.1145/3841635
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

EquivSage: LLM-assisted Detection of EVM-Inequivalent Code Smells in Multi-chain Reuse Contracts

Zibin Zheng, Zexu Wang, Daoyuan Wu, Kaiwen Ning et al.
ACM Transactions on Software Engineering and Methodology
Advanced Malware Detection Techniques
article

EquivSage: LLM-assisted Detection of EVM-Inequivalent Code Smells in Multi-chain Reuse Contracts

Zibin Zheng, Zexu Wang, Daoyuan Wu, Kaiwen Ning, Jiachi Chen, Yanlin Wang, Zewei Lin, Jingwen Zhang
article en

Abstract

With the increasing development of Solidity contracts on Ethereum , more developers are reusing them on other compatible blockchains. However, developers may overlook the differences between the designs of the blockchain system, such as the Gas Mechanism and Consensus Protocol , leading to the same contracts on different blockchains not being able to achieve consistent execution as on Ethereum . This inconsistency reveals design flaws in reused contracts, exposing code smells that hinder code reusability, and we define this inconsistency as EVM-Inequivalent Code Smells . In this paper, we conducted an empirical study to reveal the causes and characteristics of EVM-Inequivalent Code Smells . To ensure the identified smells reflect real developer concerns, we analyzed 1,379 security audit reports, 823 bug bounty reports, and 326 Stack Overflow posts related to reused contracts on EVM-compatible blockchains, such as Binance Smart Chain (BSC) and Polygon . Using the Open Card Sorting method, we defined nine types of EVM-Inequivalent Code Smells . To enable efficient detection, we developed EquivSage , a tool that leverages the contextual understanding capabilities of large language models (LLMs) to guide slicing and static taint analysis via task-specific prompts. Symbolic execution is integrated to improve detection reliability. An analysis of 1,263,683 contracts across six EVM-compatible blockchains using EquivSage reveals that, on average, 15.45% contain at least one EVM-Inequivalent Code Smell , underscoring its widespread prevalence. Since 2024, code smells in reused contracts on Ethereum , Polygon , and Optimism have increased significantly. While not all instances lead to financial loss, high frequency and asset exposure highlight the risks inherent in contract reuse. Developers are encouraged to avoid copy-and-paste practices and to detect such smells proactively before reuse.

ACM Transactions on Software Engineering and Methodology
Sun Yat-sen University (CN), State Key Laboratory of Cryptology (CN), Peng Cheng Laboratory (CN), Zhejiang University (CN)
Openalex Percentile: Top 9%
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.