Closed sherlock-admin4 closed 8 months ago
1 comment(s) were left on this issue during the judging contest.
WangAudit commented:
according to sherlock's rules; slippage issues should have a detailed explanation; current explanation is not detailed and only shows not proven assumption -> invalid
bigbick123456789000
medium
Lack of Slippage Control in swapAndSend Function
Summary
The
swapAndSend
function in theStablecoinHandler
contract lacks slippage control mechanisms, potentially exposing users to unexpected price differences during token swaps. Without considering slippage, users may face unfavorable trade executions, leading to financial losses or inefficient asset conversions.Vulnerability Detail
The
swapAndSend
function is designed to swap stablecoins between different assets and send them to specified destinations. However, it lacks mechanisms to handle slippage, which is the difference between the expected price of a trade and the actual price at which the trade is executed. In decentralized exchanges and automated market-making systems, slippage can significantly impact the outcome of trades.Here's the code snippet of the
swapAndSend
function:Impact
The lack of slippage control in the
swapAndSend
function can lead to unexpected trade executions, resulting in financial losses for users. Without considering slippage, users may receive fewer tokens than expected when swapping assets, reducing the efficiency and reliability of the token swap mechanism.Code Snippet
#L116-L132
Tool used
Manual Review
Recommendation
Implement slippage control mechanisms in the
swapAndSend
function to minimize the impact of price differences during token swaps