When processing withdrawals, _handleReturn
is executed at the end of the withdrawal flow to transfer collateral back to the user proportionally to their share. This function includes a bool refundFee
parameter to determine whether the user is eligible for a refund on execution fees paid during the withdraw
function call.
However, before verifying the refund eligibility, the function prematurely burns the depositorInfo
. As a result, even if a user qualifies for a fee refund, they will never receive it. This occurs because if (depositInfo[depositId].executionFee > usedFee)
will always evaluate to false
since the relevant deposit information has already been deleted resulting in depositInfo[depositId].executionFee
to always be zero.
If the user was supposed to get a refund on the execution fees they paid, for example, during withdrawing from a 1x leveraged long position, they ultimately end up losing the entire execution fees for that transaction.
Manual Review
_burn
should be called after the refund functionality
Likelihood: High, every time a user withdraw on 1x vault with paraswap Impact: Medium, fees never claimed to GMX and refund to the owner.
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.