{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,19]],"date-time":"2026-11-19T17:14:24Z","timestamp":1795108464007,"version":"4.10.3"},"reference-count":67,"publisher":"Association for Computing Machinery (ACM)","issue":"FSE","license":[{"start":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T00:00:00Z","timestamp":1750291200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2025,6,19]]},"abstract":"<jats:p>The exploitation of smart contract vulnerabilities in Decentralized Finance (DeFi) has resulted in financial losses exceeding 3 billion US dollars. Existing defense mechanisms primarily focus on detecting and reacting to adversarial transactions executed by attackers that target victim contracts. However, with the emergence of private transaction pools where transactions are sent directly to miners without first appearing in public mempools, current detection tools face significant challenges in identifying attack activities effectively.<\/jats:p>\n                  <jats:p>\n                    Based on the fact that most attack logic rely on deploying intermediate contracts as supporting components to the exploitation of victim contracts, novel detection methods have been proposed that focus on identifying these adversarial contracts instead of adversarial transactions. However, previous state-of-the-art approaches in this direction have failed to produce results satisfactory enough for real-world deployment. In this paper, we propose L\n                    <jats:sc>ook<\/jats:sc>\n                    A\n                    <jats:sc>head<\/jats:sc>\n                    , a new framework for detecting DeFi attacks via unveiling adversarial contracts. L\n                    <jats:sc>ook<\/jats:sc>\n                    A\n                    <jats:sc>head<\/jats:sc>\n                    leverages common attack patterns, code semantics and intrinsic characteristics found in adversarial contracts to train Machine Learning (ML)-based classifiers that can effectively distinguish adversarial contracts from benign ones and make timely predictions of different types of potential attacks. Experiments on our labeled datasets show that L\n                    <jats:sc>ook<\/jats:sc>\n                    A\n                    <jats:sc>head<\/jats:sc>\n                    achieves an F1-score of 0.8966, which represents an improvement of over 44.4% compared to the previous state-of-the-art solution, with a False Positive Rate at only 0.16%.\n                  <\/jats:p>","DOI":"10.1145\/3729353","type":"journal-article","created":{"date-parts":[[2025,6,19]],"date-time":"2025-06-19T11:15:34Z","timestamp":1750331734000},"page":"1847-1869","source":"Crossref","is-referenced-by-count":9,"title":["LookAhead: Preventing DeFi Attacks via Unveiling Adversarial Contracts"],"prefix":"10.1145","volume":"2","author":[{"ORCID":"https:\/\/orcid.org\/0009-0000-6440-3800","authenticated-orcid":false,"given":"Shoupeng","family":"Ren","sequence":"first","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0002-1802-7394","authenticated-orcid":false,"given":"Lipeng","family":"He","sequence":"additional","affiliation":[{"name":"University of Waterloo, Waterloo, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9776-5610","authenticated-orcid":false,"given":"Tianyu","family":"Tu","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0007-4785-706X","authenticated-orcid":false,"given":"Di","family":"Wu","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-6796-6828","authenticated-orcid":false,"given":"Jian","family":"Liu","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3441-6277","authenticated-orcid":false,"given":"Kui","family":"Ren","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6198-7481","authenticated-orcid":false,"given":"Chun","family":"Chen","sequence":"additional","affiliation":[{"name":"Zhejiang University, Hangzhou, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,6,19]]},"reference":[{"key":"e_1_3_1_2_2","unstructured":"2020. AAVE Protocol Whitepaper. https:\/\/github.com\/aave\/aave-protocol\/blob\/master\/docs\/Aave_Protocol_Whitepaper_v1_O.pdf Accessed 2024."},{"key":"e_1_3_1_3_2","unstructured":"2024. Alchemy. https:\/\/www.alchemy.com\/ Accessed 2024."},{"key":"e_1_3_1_4_2","unstructured":"2024. Arbitrum Documentation. https:\/\/docs.arbitrum.io\/ Accessed 2024."},{"key":"e_1_3_1_5_2","unstructured":"2024. Attacker Drains $ 182M From Beanstalk Stablecoin Protocol. https:\/\/www.coindesk.com\/tech\/2022\/04\/17\/attacker-drains-182m-from-beanstalk-stablecoin-protocol\/ Accessed 2024."},{"key":"e_1_3_1_6_2","unstructured":"2024. Attacker Hacks Arbitrum\u2019s Treasure DAO for Over 100 NFTs by Leveraging Marketplace Exploit. https:\/\/news.bitcoin.com\/attacker-hacks-arbitrums-treasure-dao-for-over-100-nfts-by-leveraging-marketplace-exploit\/ Accessed 2024."},{"key":"e_1_3_1_7_2","unstructured":"2024. Blocksec. https:\/\/blocksec.com\/ Accessed 2024."},{"key":"e_1_3_1_8_2","unstructured":"2024. BNB Chain Documentation. https:\/\/docs.bnbchain.org\/docs\/overview Accessed 2024."},{"key":"e_1_3_1_9_2","unstructured":"2024. BurgerSwap Hit by Flash Loan Attack Netting Over $7M. https:\/\/www.coindesk.com\/markets\/2021\/05\/28\/burgerswap-hit-by-flash-loan-attack-netting-over-7m\/ Accessed 2024."},{"key":"e_1_3_1_10_2","unstructured":"2024. Certik. https:\/\/www.certik.com\/ Accessed 2024."},{"key":"e_1_3_1_11_2","unstructured":"2024. ChangeNOW: Instant Cryptocurrency Exchange. https:\/\/changenow.io\/ Accessed 2024."},{"key":"e_1_3_1_12_2","unstructured":"2024. DeFi Hacks Reproduce. https:\/\/github.com\/SunWeb3Sec\/DeFiHackLabs Accessed 2024."},{"key":"e_1_3_1_13_2","unstructured":"2024. ERC20 Token Standard. https:\/\/eips.ethereum.org\/EIPS\/eip-20 Accessed 2024."},{"key":"e_1_3_1_14_2","unstructured":"2024. ERC721 Token Standard. https:\/\/eips.ethereum.org\/EIPS\/eip-721 Accessed 2024."},{"key":"e_1_3_1_15_2","unstructured":"2024. Ethereum Signature Dataset. https:\/\/www.4byte.directory\/ Accessed 2024."},{"key":"e_1_3_1_16_2","unstructured":"2024. Flashbots Documentation. https:\/\/docs.flashbots.net\/ Accessed 2024."},{"key":"e_1_3_1_17_2","unstructured":"2024. Forta Network https:\/\/forta.org\/blog\/how-fortas-predictive-ml-models-detect-attacks-before-exploitation\/ Accessed 2024."},{"key":"e_1_3_1_18_2","unstructured":"2024. Foundry. https:\/\/github.com\/foundry-rs\/foundry Accessed 2024."},{"key":"e_1_3_1_19_2","unstructured":"2024. Label Word Cloud on BscScan. https:\/\/bscscan.com\/labelcloud Accessed 2024."},{"key":"e_1_3_1_20_2","unstructured":"2024. Label Word Cloud on Etherscan. https:\/\/etherscan.io\/labelcloud Accessed 2024."},{"key":"e_1_3_1_21_2","unstructured":"2024. Learn EVM Attacks. https:\/\/github.com\/coinspect\/learn-evm-attacks Accessed 2024."},{"key":"e_1_3_1_22_2","unstructured":"2024. LookAhead dataset and source code. https:\/\/github.com\/zju-abclab\/LookAhead Accessed 2024."},{"key":"e_1_3_1_23_2","unstructured":"2024. Optimism Documentation. https:\/\/community.optimism.io\/ Accessed 2024."},{"key":"e_1_3_1_24_2","unstructured":"2024. PancakeBunny tanks 96% following $200M flash loan exploit. https:\/\/cointelegraph.com\/news\/pancakebunny-tanks-96-following-200m-flash-loan-exploit Accessed 2024."},{"key":"e_1_3_1_25_2","unstructured":"2024. Polygon Documentation. https:\/\/docs.polygon.technology\/ Accessed 2024."},{"key":"e_1_3_1_26_2","unstructured":"2024. SideShift: No Sign-Up Crypto Exchange. https:\/\/sideshift.ai\/ Accessed 2024."},{"key":"e_1_3_1_27_2","unstructured":"2024. SlowMist Hacked Events. https:\/\/hacked.slowmist.io\/ Accessed 2024."},{"key":"e_1_3_1_28_2","unstructured":"2024. SushiSwap Exchange Suffers Major $3.3 Million Smart Contract Hack. https:\/\/cryptonews.com\/news\/sushiswap-exchange-suffers-major-33-million-smart-contract-hack-heres-what-happenedhtm Accessed 2024."},{"key":"e_1_3_1_29_2","unstructured":"2024. SushiSwap\u2019s Token Launchpad Hacked for Over $3M in Ethereum. https:\/\/decrypt.co\/81120\/sushiswaps-token-launchpad-hacked-over-3m-ethereum Accessed 2024."},{"key":"e_1_3_1_30_2","unstructured":"2024. Tornado Cash Label on Etherscan. https:\/\/etherscan.io\/accounts\/label\/tornado-cash Accessed 2024."},{"key":"e_1_3_1_31_2","unstructured":"2024. Total Value Locked - DefiL lama https:\/\/defillama.com\/ Accessed 2024."},{"key":"e_1_3_1_32_2","unstructured":"Hayden Adams Noah Zinsmeister Moody Salem River Keefer and Dan Robinson. 2021. Uniswap v3 Core. https:\/\/uniswap.org\/whitepaper-v3.pdf Accessed 2024."},{"key":"e_1_3_1_33_2","unstructured":"Yixin Cao Chuanwei Zou and Xianfeng Cheng. 2021. Flashot: a snapshot of flash loan attack on DeFi ecosystem. arXiv preprint arXiv:2102.00626 (2021)."},{"key":"e_1_3_1_34_2","doi-asserted-by":"publisher","DOI":"10.14722\/ndss.2020.24449"},{"key":"e_1_3_1_35_2","doi-asserted-by":"publisher","unstructured":"Philip Daian Steven Goldfeder Tyler Kell Yunqi Li Xueyuan Zhao Iddo Bentov Lorenz Breidenbach and Ari Juels. 2020. Flash Boys 2.0: Frontrunning in Decentralized Exchanges Miner Extractable Value and Consensus Instability. In 2020 IEEE Symposium on Security and Privacy (SP). IEEE 910-927. https:\/\/doi.org\/10.1109\/sp40000.2020.00040 10.1109\/sp40000.2020.00040","DOI":"10.1109\/sp40000.2020.00040"},{"key":"e_1_3_1_36_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4842-2535-6"},{"key":"e_1_3_1_37_2","unstructured":"DLNews. 2024. Conic Finance suffers $3m exploit in twist to \u2018typical re-entrancy attack\u2019. https:\/\/www.dlnews.com\/articles\/defi\/conic-finance-suffers-exploit-similar-to-the-dao-hack\/ Accessed 2024."},{"key":"e_1_3_1_38_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-43725-1_13"},{"key":"e_1_3_1_39_2","unstructured":"Yu Gai Liyi Zhou Kaihua Qin Dawn Song and Arthur Gervais. 2023. Blockchain large language models. arXiv preprint arXiv:2304.12749 (2023)."},{"key":"e_1_3_1_40_2","doi-asserted-by":"publisher","unstructured":"Neville Grech Lexi Brent Bernhard Scholz and Yannis Smaragdakis. 2019. Gigahorse: Thorough Declarative Decompilation of Smart Contracts. In 2019 IEEE\/ACM 41st International Conference on Software Engineering (ICSE). IEEE 1176-1186. https:\/\/doi.org\/10.1109\/icse.2019.00120 10.1109\/icse.2019.00120","DOI":"10.1109\/icse.2019.00120"},{"key":"e_1_3_1_41_2","doi-asserted-by":"publisher","unstructured":"Shelly Grossman Ittai Abraham Guy Golan-Gueta Yan Michalevsky Noam Rinetzky Mooly Sagiv and Yoni Zohar. 2017. Online detection of effectively callback free objects with applications to smart contracts. Proceedings of the ACM on Programming Languages 2 POPL (Dec. 2017) 1-28. https:\/\/doi.org\/10.1145\/3158136 10.1145\/3158136","DOI":"10.1145\/3158136"},{"key":"e_1_3_1_42_2","doi-asserted-by":"publisher","unstructured":"Bishwas C Gupta and Sandeep K. Shukla. 2019. A Study of Inequality in the Ethereum Smart Contract Ecosystem. In 2019 Sixth International Conference on Internet of Things: Systems Management and Security (IOTSMS). IEEE 441-449. https:\/\/doi.org\/10.1109\/iotsms48152.2019.8939257 10.1109\/iotsms48152.2019.8939257","DOI":"10.1109\/iotsms48152.2019.8939257"},{"key":"e_1_3_1_43_2","doi-asserted-by":"publisher","unstructured":"Haibo He Yang Bai Edwardo A. Garcia and Shutao Li. 2008. ADASYN: Adaptive synthetic sampling approach for imbalanced learning. In 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence). IEEE 1322-1328. https:\/\/doi.org\/10.1109\/ijcnn.2008.4633969 10.1109\/ijcnn.2008.4633969","DOI":"10.1109\/ijcnn.2008.4633969"},{"key":"e_1_3_1_44_2","doi-asserted-by":"publisher","unstructured":"Queping Kong Jiachi Chen Yanlin Wang Zigui Jiang and Zibin Zheng. 2023. DeFiTainter: Detecting Price Manipulation V ulnerabilities in DeFi Protocols. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA \u201823). ACM 1144-1156. https:\/\/doi.org\/10.1145\/3597926.3598124 10.1145\/3597926.3598124","DOI":"10.1145\/3597926.3598124"},{"key":"e_1_3_1_45_2","unstructured":"Scott M Lundberg and Su-In Lee. 2017. A unified approach to interpreting model predictions. Advances in neural information processing systems 30 (2017). https:\/\/dl.acm.org\/doi\/10.5555\/3295222.3295230"},{"key":"e_1_3_1_46_2","doi-asserted-by":"publisher","unstructured":"Fuchen Ma Meng Ren Lerong Ouyang Yuanliang Chen Juan Zhu Ting Chen Yingli Zheng Xiao Dai Yu Jiang and Jiaguang Sun. 2023. Pied-Piper: Revealing the Backdoor Threats in Ethereum ERC Token Contracts. ACM Transactions on Software Engineering and Methodology 32 3 (April 2023) 1-24. https:\/\/doi.org\/10.1145\/3560264 10.1145\/3560264","DOI":"10.1145\/3560264"},{"key":"e_1_3_1_47_2","unstructured":"Fernando Martinelli and Nikolai Mushegian. 2019. A non-custodial portfolio manager liquidity provider and price sensor. https:\/\/balancer.fi\/whitepaper.pdf Accessed 2024."},{"key":"e_1_3_1_48_2","unstructured":"Tomas Mikolov. 2013. Efficient estimation of word representations in vector space. arXiv preprint arXiv: 1301.3781 (2013)."},{"key":"e_1_3_1_49_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-031-54204-6_24"},{"key":"e_1_3_1_50_2","doi-asserted-by":"publisher","DOI":"10.5555\/3620237.3620459"},{"key":"e_1_3_1_51_2","unstructured":"Kaihua Qin Zhe Ye Zhun Wang Weilin Li Liyi Zhou Chao Zhang Dawn Song and Arthur Gervais. 2023. Towards Automated Security Analysis of Smart Contracts based on Execution Property Graph. arXiv preprint arXiv:2305.14046 (2023)."},{"key":"e_1_3_1_52_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-662-64322-8_l"},{"key":"e_1_3_1_53_2","unstructured":"Leshner Robert and Hayes Geoffrey. 2019. Compound: The Money Market Protocol. https:\/\/compound.finance\/documents\/Compound.Whitepaper.pdf Accessed 2024."},{"key":"e_1_3_1_54_2","doi-asserted-by":"publisher","DOI":"10.14722\/ndss.2019.23413"},{"key":"e_1_3_1_55_2","unstructured":"Christof Ferreira Torres Ramiro Camino et al. 2021. Frontrunner jones and the raiders of the dark forest: An empirical study of frontrunning on the ethereum blockchain. In 30th USENIX Security Symposium (USENIX Security 21). 1343-1359."},{"key":"e_1_3_1_56_2","unstructured":"A Vaswani. 2017. Attention is all you need. Advances in Neural Information Processing Systems (2017). https:\/\/dlacm.org\/doi\/10.5555\/3295222.3295349"},{"key":"e_1_3_1_57_2","doi-asserted-by":"publisher","DOI":"10.1109\/tcss.2022.3228122"},{"key":"e_1_3_1_58_2","doi-asserted-by":"publisher","unstructured":"Dabao Wang Siwei Wu Ziling Lin Lei Wu Xingliang Yuan Yajin Zhou Haoyu Wang and Kui Ren. 2021. Towards A First Step to Understand Flash Loan and Its Applications in DeFi Ecosystem. In Proceedings of the Ninth International Workshop on Security in Blockchain and Cloud Computing (ASIA CCS \u201821). ACM. https:\/\/doi.org\/10.1145\/3457977.3460301 10.1145\/3457977.3460301","DOI":"10.1145\/3457977.3460301"},{"key":"e_1_3_1_59_2","doi-asserted-by":"publisher","unstructured":"Zhipeng Wang Stefanos Chaliasos Kaihua Qin Liyi Zhou Lifeng Gao Pascal Berrang Benjamin Livshits and Arthur Gervais. 2023. On How Zero-Knowledge Proof Blockchain Mixers Improve and Worsen User Privacy. In Proceedings of the ACM Web Conference 2023 (WWW \u201823). ACM 2022-2032. https:\/\/doi.org\/10.1145\/3543507.3583217 10.1145\/3543507.3583217","DOI":"10.1145\/3543507.3583217"},{"key":"e_1_3_1_60_2","doi-asserted-by":"publisher","unstructured":"Ben Weintraub Christof Ferreira Torres Cristina Nita-Rotaru and Radu State. 2022. A flash(bot) in the pan: measuring maximal extractable value in private pools. In Proceedings of the 22nd ACM Internet Measurement Conference (IMC \u201822). ACM 458-471. https:\/\/doi.org\/10.1145\/3517745.3561448 10.1145\/3517745.3561448","DOI":"10.1145\/3517745.3561448"},{"key":"e_1_3_1_61_2","unstructured":"Gavin Wood et al. 2014. Ethereum: A secure decentralised generalised transaction ledger. Ethereum project yellow paper 151 2014 (2014) 1-32."},{"key":"e_1_3_1_62_2","doi-asserted-by":"publisher","DOI":"10.1145\/3505263"},{"key":"e_1_3_1_63_2","doi-asserted-by":"publisher","DOI":"10.1109\/tdsc.2023.3346888"},{"key":"e_1_3_1_64_2","doi-asserted-by":"publisher","unstructured":"Shuo Yang Jiachi Chen Mingyuan Huang Zibin Zheng and Yuan Huang. 2024. Uncover the Premeditated Attacks: Detecting Exploitable Reentrancy Vulnerabilities by Identifying Attacker Contracts. In Proceedings of the IEEE\/ACM 46th International Conference on Software Engineering (ICSE \u201824). ACM 1-12. https:\/\/doi.org\/10.1145\/3597503.3639153 10.1145\/3597503.3639153","DOI":"10.1145\/3597503.3639153"},{"key":"e_1_3_1_65_2","unstructured":"Mengya Zhang Xiaokuan Zhang Yinqian Zhang and Zhiqiang Lin. 2020. {TXSPECTOR: Uncovering attacks in ethereum from transactions. In 29th USENIX Security Symposium (USENIX Security 20). 2775-2792. https:\/\/dl.acm.org\/doi\/10.5555\/3489212.3489368"},{"key":"e_1_3_1_66_2","unstructured":"Zhuo Zhang Zhiqiang Lin Marcelo Morales Xiangyu Zhang and Kaiyuan Zhang. 2023. Your exploit is mine: Instantly synthesizing counterattack smart contract. In 32nd USENIX Security Symposium (USENIX Security 23). 1757-1774. https:\/\/dl.acm.org\/doi\/10.5555\/3620237.3620336"},{"key":"e_1_3_1_67_2","doi-asserted-by":"publisher","unstructured":"Liyi Zhou Xihan Xiong Jens Ernstberger Stefanos Chaliasos Zhipeng Wang Ye Wang Kaihua Qin Roger Wattenhofer Dawn Song and Arthur Gervais. 2023. SoK: Decentralized Finance (DeFi) Attacks. In 2023 IEEE Symposium on Security and Privacy (SP). IEEE 2444-2461. https:\/\/doi.org\/10.1109\/sp46215.2023.10179435 10.1109\/sp46215.2023.10179435","DOI":"10.1109\/sp46215.2023.10179435"},{"key":"e_1_3_1_68_2","doi-asserted-by":"publisher","unstructured":"Shunfan Zhou Malte Moser Zhemin Yang Ben Adida Thorsten Holz Jie Xiang Steven Goldfeder Yinzhi Cao Martin Plattner Xiaojun Qin et al 2020. An ever-evolving game: Evaluation of real-world attacks and defenses in ethereum ecosystem. In 29th USENIX Security Symposium (USENIX Security 20). 2793-2810. https:\/\/dl.acm.org\/doi\/10.5555\/3489212.3489369 10.5555\/3489212.3489369","DOI":"10.5555\/3489212.3489369"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3729353","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,8,23]],"date-time":"2026-08-23T11:01:44Z","timestamp":1787482904000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3729353"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,19]]},"references-count":67,"journal-issue":{"issue":"FSE","published-print":{"date-parts":[[2025,6,19]]}},"alternative-id":["10.1145\/3729353"],"URL":"https:\/\/doi.org\/10.1145\/3729353","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,19]]}}}