ADEFGuard: Anomaly detection framework based on Ethereum smart contracts behaviours
Malaw Ndiaye, Thierno Ahmadou Diallo, Karim Konaté · Blockchain Research and Applications · 2023
Smart contract is the building block of blockchain systems that enables automated peer-to-peer transactions and decentralized services. Smart contracts certainly provide a powerful functional surplus for maintaining the consistency of transactions in applications governed by blockchain technology. Smart contracts have become lucrative and profitable targets for attackers because they can hold a large amount of money. Formal verification and symbolic analysis have been employed to combat these destructive scams by analyzing the codes and function calls, yet each scam's vulnerability should be discreetly predefined. In this work, we introduce ADEFGuard, a new anomaly detection framework based on the behavior of smart contracts, as new features. We design a learning and monitoring module to determine fraudulent smart contract behaviors. Our framework is advantageous over basic algorithms in three aspects. First, ADEFGuard provides a unified solution to different genres of scams, relieving the need for code analysis skills. Second, ADEFGuard's inference is orders of magnitude faster than code analysis. Third, experimental results show that ADEFGuard achieves high accuracy (85%), precision (75%) and recall (90%) for malicious contracts and is potentially useful in detecting new malicious behaviors of smart contracts.