Lack of slippage protection in withdrawMargin
function
Suppose a user has deposited 100 USDC as collateral, and the current price of ETH is $2,000.
The user initiates a withdrawal of 50 USDC worth of ETH.
At the time of initiation, this would be equivalent to 0.025 ETH (50 / 2000).
The user submits the transaction to withdraw 0.025 ETH.
However, due to network congestion, the transaction doesn't get processed immediately.
In the meantime, the price of ETH suddenly drops to $1,800.
When the transaction is finally processed, 0.025 ETH is now worth only $45 USDC.
In this scenario, the user has effectively lost $5 worth of value due to slippage.
The current withdrawMargin
function doesn't protect against this scenario. It simply withdraws the amount specified without any checks on the current value of the collateral.
Users will lose their money due to lack of slippage protection
Manual Review
Add minAmountOut
and deadline
parameters. Also ensure transaction has not expired.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.