FV-SOL-8 Slippage
TLDR
Slippage vulnerabilities in Solidity typically refer to situations where unexpected price changes or inadequate checks on the value transferred in transactions cause a user to receive less than expected. This is especially relevant in decentralized exchanges (DEXs) and automated market makers (AMMs)
Code
Classifications
Mitigation Patterns
Minimum Amount Checks (FV-SOL-8-M1)
Accept a minAmountOut
parameter in functions that perform token swaps or trades. Before finalizing the transaction, check that the amount received meets or exceeds minAmountOut
Time-Weighted Average Price (FV-SOL-8-M2)
Use a time-weighted average price (TWAP) instead of the immediate spot price to reduce the impact of temporary price manipulation
Decentralized Oracles (FV-SOL-8-M3)
Use a decentralized oracle network (e.g., Chainlink) to provide reliable and tamper-resistant price data for slippage calculations
Actual Occurrences
Content
Last updated