ScamDetect: Towards a Robust, Agnostic Framework to Uncover Threats in Smart Contracts
Pasquale De Rosa 2 , Pascal Felber 2 , and Valerio Schiavoni 2 · 2025
Read ScamDetect: Towards a Robust, Agnostic Framework to Uncover Threats in Smart Contracts by Pasquale De Rosa 2 , Pascal Felber 2 , and Valerio Schiavoni 2 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-07094.txt.
Introduction
Pasquale De Rosa, Pascal Felber, and Valerio Schiavoni present a vision for finding scams in smart contracts in 2025. Smart contracts run trust-free deals in digital finance, but they also draw phishing and exploits. Checking code before it runs can catch bad contracts early.
Their earlier tool reached about ninety percent accuracy at spotting phishing code. Two hurdles remain: tricks that hide code shape, and the many platforms contracts run on. The new plan first uses graph-based learning on code flow to beat hiding tricks. It then extends to newer runtimes, in a frame meant to work across platforms.
Catalog record
| CREATOR | Pasquale De Rosa 2 , Pascal Felber 2 , and Valerio Schiavoni 2 |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 10 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2508-07094
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
ScamDetect: Towards a Robust, Agnostic Framework to Uncover Threats in Smart Contracts Pasquale De Rosa 2 , Pascal Felber 2 , and Valerio Schiavoni 2 Abstract Smart contracts have transformed decentralized finance by enabling programmable, trustless transactions. However, their widespread adoption and growing financial significance have attracted persistent and sophisticated threats, such as phishing campaigns and contract-level exploits. Traditional transaction-based threat detection methods often expose sensitive user data and interactions, raising privacy and security concerns. In response, static bytecode analysis has emerged as a proactive mitigation strategy, identifying malicious contracts before they execute harmful actions. Building on this approach, we introduced PhishingHook , the first machine-learning-based framework for detecting phishing activities in smart contracts via static bytecode and opcode analysis, achieving approximately 90% detection accuracy. Nevertheless, two pressing challenges remain: (1) the increasing use of sophisticated bytecode obfuscation techniques designed to evade static analysis, and (2) the heterogeneity of blockchain environments requiring platform-agnostic solutions. This paper presents a vision for ScamDetect ( S mart C ontract A gnostic M alware Detect or), a robust, modular, and platform-agnostic framework for smart contract malware detection. Over the next 2.5 years, ScamDetect will evolve in two stages: first, by tackling obfuscated Ethereum Virtual Machine (EVM) bytecode through graph neural network (GNN) analysis of control flow graphs (CFGs), leveraging GNNs’ ability to capture complex structural patterns beyond opcode sequences; and second, by generalizing detection capabilities to emerging runtimes such as WASM. ScamDetect aims to enable proactive, scalable security for the future of decentralized ecosystems. I Introduction Smart contracts form the core logic underpinning a wide range of decentralized applications (dApps). The Ethereum ecosystem, in particular, has experienced exponential growth—amassing billions of dollars in total value locked (TVL) and enabling innovative use cases such as lending pools, yield aggregators, and token swaps. However, the same programmable and trustless capabilities that drive these advancements also create opportunities for malicious actors. Recent estimates indicate that, in 2023 alone, Ethereum suffered over $1.35 billion in financial losses due to security breaches, with phishing attacks and malicious smart contracts playing a significant role [ 3 , 2 ] . Traditional approaches to detecting malicious contracts often rely on analyzing on-chain user interactions (e.g., transaction flows, approval patterns, or external calls). While effective under certain conditions, these methods require substantial transaction data to generate meaningful signals, thus delaying detection. Moreover, replaying or simulating transaction traces can inadvertently expose sensitive user data, creating additional security and privacy challenges. Given that blockchain transactions are irreversible, detection delays can result directly in monetary loss and erosion of user trust. Static analysis of smart contract bytecode offers a proactive alternative: by detecting suspicious code structures at or before deployment, threats can be mitigated early. Motivated by this paradigm, we previously introduced PhishingHook , a machine learning framework that analyzes smart contract bytecode to detect phishing attacks, achieving an average of 90% detection accuracy. However, despite its promising results, PhishingHook faces two limitations. First, emerging obfuscation techniques—including source-level manipulation [ 23 ] , control-flow graph transformations [ 22 ] , and binary diversification [ 1 ] —threaten the reliability of static pattern-based detection. Second, the increasing diversity of blockchain platforms (e.g., WASM-based smart contracts) demands solutions that are robust across heterogeneous runtimes. In this paper, we present our vision for ScamDetect ( S mart C ontract A gnostic M alware Detect or), a robust, platform-agnostic framework for malware detection in smart contracts. ScamDetect will address obfuscation challenges by moving beyond opcode-level patterns, leveraging graph neural networks (GNNs) over control-flow graphs (CFGs) extracted from contract bytecode. GNNs offer the potential to learn high-level structural patterns in code execution flow, which may exhibit greater robustness against certain forms of obfuscation. Our research plan unfolds over two phases. In the next six months, we aim to develop a robust detection method targeting obfuscated EVM bytecode, focusing on graph-based representations and machine learning models such as GAT [ 20 ] , GCN [ 13 ] , GIN [ 21 ] , TAG [ 5 ] , and GraphSAGE [ 8 ] . Over the subsequent two years, we plan to generalize ScamDetect to support emerging smart contract runtimes, including WASM environments, building a modular and scalable detection pipeline. Through ScamDetect , we aspire to proactively strengthen smart contract security across the evolving blockchain landscape. II Background and Related Work The research community has developed various strategies to counter vulnerabilities in smart contracts. Dynamic or transaction-based methods, such as Eth-PSD [ 12 ] and TxPhishScope [ 9 ] , monitor on-chain activity and external interactions to surface attacks in real time. While effective, these approaches require substantial user activity and may compromise privacy when replaying transactions. Conversely, static analysis techniques aim to detect threats before execution. Symbolic execution has been applied to uncover honeypots [ 19 ] and hidden backdoors, but can be computationally intensive on complex contracts. Machine learning methods, including random forests, k-NN, and deep neural networks, have been used to classify attack types such as Ponzi schemes [ 14 ] or malicious opcode patterns [ 10 ] . A tension persists between these approaches: dynamic methods benefit from live data but suffer from detection latency and privacy risks, while static methods offer proactive security but are vulnerable to code obfuscation. As DeFi ecosystems evolve, more robust and adaptive detection frameworks are urgently needed. III PhishingHook To address these challenges, we previously proposed PhishingHook [ 18 ] , a machine learning framework that detects phishing attacks through direct analysis of smart contract bytecode and opcode sequences. By focusing on code structure rather than transaction behavior, PhishingHook enables proactive threat identification without requiring user interaction data. PhishingHook was evaluated on a curated dataset of 7,000 real-world phishing contracts, benchmarking 16 classification models, including opcode histograms, vision-based encodings, large language models, and vulnerability-specific detectors. Our approach achieved an average detection accuracy of approximately 90%, demonstrating the promise of static, privacy-preserving malware detection at the bytecode level. While effective, PhishingHook faces two growing challenges: resilience against sophisticated obfuscation tactics and the need for broader applicability beyond the Ethereum Virtual Machine (EVM). These challenges motivate the development of ScamDetect , a more general and robust detection framework. IV Existing Challenges: Obfuscation and Platform Heterogeneity Although PhishingHook proved effective in detecting phishing attacks on Ethereum, two major challenges limit static bytecode-based detection. First, increasingly sophisticated obfuscation techniques, such as those introduced by BOSC [ 22 ] and BiAn [ 23 ] , manipulate control structures, instruction flows, and data layouts to evade conventional static analyzers. These tactics reduce the reliability of opcode-pattern classifiers and shallow ML models. Second, blockchain platforms are diversifying. Beyond the Ethereum Virtual Machine (EVM), ecosystems like Polkadot [ 16 ] , NEAR [ 15 ] , the Internet Computer [ 4 ] and EOS [ 6 ] rely on WebAssembly (WASM) as a runtime [ 11 ] , introducing heterogeneous instruction sets and execution models. These dual challenges—advanced obfuscation and platform variability—necessitate a new class of resilient, adaptable, and cross-platform detection frameworks. V Roadmap: From PhishingHook to ScamDetect To address these challenges, we propose ScamDetect ( S mart C ontract A gnostic M alware Detect or), a next-generation malware detection framework for smart contracts. ScamDetect will enhance robustness against