Skip to main content

What Specific Smart Contract Functions Are Most Susceptible to Sandwich Attacks?

Smart contract functions that involve token swaps on Automated Market Makers (AMMs) are the most susceptible. Specifically, functions like swapExactTokensForTokens or swapTokensForExactTokens on protocols like Uniswap are targeted.

These functions read the current price, execute the trade, and then write the new price. The price change caused by the victim's trade is what the front-runner exploits by placing trades around it.

What Is a “Sandwich Attack” and How Is It a Form of MEV?
What Are the Most Common Smart Contract Vulnerabilities Exploited by State-Sponsored Attackers?
How Does Delta Hedging an Options Position Relate to the Rebalancing Action of an AMM?
What Is ‘Sandwich Attack’ and How Does It Exploit the AMM Slippage Mechanism?