The _handleReturn function, responsible for calculating and returning collateral tokens to deposit recipient, has an issue with the fee refund process. The function first calls _burn, which deletes deposit information from depositInfo, and then attempts to refund the unused execution fee. Since depositInfo[depositId] is already deleted, the refund process fails due to missing owner and execution fee data.
The _handleReturn function calculates the amount of collateral tokens to be returned based on the deposit's share of totalShares.
After computing the amount, it calls _transferToken to send the tokens to the deposit recipient.
_burn(depositId) is called, which:
Removes the deposit from userDeposits.
Decreases totalShares.
Deletes the depositInfo[depositId] record.
If refundFee is true, the function attempts to refund the unused execution fee.
However, since _burn has benn called first it has deleted depositInfo[depositId], accessing depositInfo[depositId].executionFeeresults in default value(0).
Refunds will always default to zero due to deleted deposit records.
Execution fee refunds will not be processed, causing a loss to depositors.
Manual Review
Follow the correct order of actions:
Refund the execution fee to the deposit owner if refundFee = true
Call _burnto delete the proper deposit information
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.