The StrategyOp::claimAndSwap
function checks if the balance after the swap is greater than or equal to _minOut
. However, this check is done after the swap, which means if the slippage is too high, the transaction will revert, but the gas cost will still be incurred.
Severity: LOW
Explanation: The claimAndSwap
function checks if the balance after the swap is greater than or equal to _minOut
. This check is performed after the swap, meaning that if the slippage is too high, the transaction will revert, but the gas cost will still be incurred.
Users may incur unnecessary gas costs if the slippage is too high.
Manual Testing
Implement a slippage check before executing the swap to avoid unnecessary gas costs.
To check the slippage before executing the swap, we have to update the StrategyOp::claimAndSwap
function, as below:
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.