Barbara Guidi, Francesco Massellucci, Andrea Michienzi
{"title":"EVM智能合约的反夹心机制","authors":"Barbara Guidi, Francesco Massellucci, Andrea Michienzi","doi":"10.1016/j.future.2025.108077","DOIUrl":null,"url":null,"abstract":"<div><div>With the advent of blockchain, Decentralised Finance (DeFi) has become an accessible and decentralised method for financial services. One of the most important components of DeFi is the Decentralised Exchanges (DEXs), smart contracts that let users exchange tokens with each other. Trading through DEXs has become crucial in the blockchain ecosystem; however, new malicious activities have begun to spread in parallel. The Maximal Extractable Value (MEV) is becoming pervasive. In this paper, we propose an analysis of the magnitude of MEV activities and a new solution to prevent sandwich attacks after a deep overview of the current anti-MEV approaches. We focused on sandwich attacks because they are the most common MEV attacks (1,330,732 attacks within our 3-year-wide dataset) and cause significant losses to end users ($809,453,320 recorded in our dataset). Our proposed solution prevents sandwich attacks by enhancing token contracts to enforce a cooldown for transferring tokens. Unlike existing approaches, this solution can be easily integrated into any token contract, providing developers with a versatile and customisable MEV solution. Additionally, we extensively evaluate our solution and show that it successfully blocks all sandwich attacks, prove that it does not cause any harm to normal users, and compute that it only introduces a small 3 % gas fee increase.</div></div>","PeriodicalId":55132,"journal":{"name":"Future Generation Computer Systems-The International Journal of Escience","volume":"175 ","pages":"Article 108077"},"PeriodicalIF":6.2000,"publicationDate":"2025-08-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"An anti-sandwich mechanism for EVM’s smart contracts\",\"authors\":\"Barbara Guidi, Francesco Massellucci, Andrea Michienzi\",\"doi\":\"10.1016/j.future.2025.108077\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>With the advent of blockchain, Decentralised Finance (DeFi) has become an accessible and decentralised method for financial services. One of the most important components of DeFi is the Decentralised Exchanges (DEXs), smart contracts that let users exchange tokens with each other. Trading through DEXs has become crucial in the blockchain ecosystem; however, new malicious activities have begun to spread in parallel. The Maximal Extractable Value (MEV) is becoming pervasive. In this paper, we propose an analysis of the magnitude of MEV activities and a new solution to prevent sandwich attacks after a deep overview of the current anti-MEV approaches. We focused on sandwich attacks because they are the most common MEV attacks (1,330,732 attacks within our 3-year-wide dataset) and cause significant losses to end users ($809,453,320 recorded in our dataset). Our proposed solution prevents sandwich attacks by enhancing token contracts to enforce a cooldown for transferring tokens. Unlike existing approaches, this solution can be easily integrated into any token contract, providing developers with a versatile and customisable MEV solution. Additionally, we extensively evaluate our solution and show that it successfully blocks all sandwich attacks, prove that it does not cause any harm to normal users, and compute that it only introduces a small 3 % gas fee increase.</div></div>\",\"PeriodicalId\":55132,\"journal\":{\"name\":\"Future Generation Computer Systems-The International Journal of Escience\",\"volume\":\"175 \",\"pages\":\"Article 108077\"},\"PeriodicalIF\":6.2000,\"publicationDate\":\"2025-08-17\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Future Generation Computer Systems-The International Journal of Escience\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0167739X25003711\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Future Generation Computer Systems-The International Journal of Escience","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0167739X25003711","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
An anti-sandwich mechanism for EVM’s smart contracts
With the advent of blockchain, Decentralised Finance (DeFi) has become an accessible and decentralised method for financial services. One of the most important components of DeFi is the Decentralised Exchanges (DEXs), smart contracts that let users exchange tokens with each other. Trading through DEXs has become crucial in the blockchain ecosystem; however, new malicious activities have begun to spread in parallel. The Maximal Extractable Value (MEV) is becoming pervasive. In this paper, we propose an analysis of the magnitude of MEV activities and a new solution to prevent sandwich attacks after a deep overview of the current anti-MEV approaches. We focused on sandwich attacks because they are the most common MEV attacks (1,330,732 attacks within our 3-year-wide dataset) and cause significant losses to end users ($809,453,320 recorded in our dataset). Our proposed solution prevents sandwich attacks by enhancing token contracts to enforce a cooldown for transferring tokens. Unlike existing approaches, this solution can be easily integrated into any token contract, providing developers with a versatile and customisable MEV solution. Additionally, we extensively evaluate our solution and show that it successfully blocks all sandwich attacks, prove that it does not cause any harm to normal users, and compute that it only introduces a small 3 % gas fee increase.
期刊介绍:
Computing infrastructures and systems are constantly evolving, resulting in increasingly complex and collaborative scientific applications. To cope with these advancements, there is a growing need for collaborative tools that can effectively map, control, and execute these applications.
Furthermore, with the explosion of Big Data, there is a requirement for innovative methods and infrastructures to collect, analyze, and derive meaningful insights from the vast amount of data generated. This necessitates the integration of computational and storage capabilities, databases, sensors, and human collaboration.
Future Generation Computer Systems aims to pioneer advancements in distributed systems, collaborative environments, high-performance computing, and Big Data analytics. It strives to stay at the forefront of developments in grids, clouds, and the Internet of Things (IoT) to effectively address the challenges posed by these wide-area, fully distributed sensing and computing systems.