User Funds Lost Due to Execution Fee Refund Failure
During the execution of the PerpetualVault::_handleReturn() function, the _burn() function is called, which burns the user's shares and deletes the
depositInfo mapping that tracks user deposits. After burning the shares, the function initiates the refund fee process, which checks whether
depositInfo[depositId].executionFee > usedFee to determine if the execution fee is greater than the used fee. However, this condition will never be executed,
even if the execution fee is higher than the used fee because the depositInfo mapping—containing this crucial data like the execution fee that the user gave—has already been deleted. As a result, users may suffer fund losses due to unprocessed refunds.
The user will not be able to get the excess fee back at the time of withdrawal.
Funds intended to be refunded will be stuck within the contract.
Manual Review
Reorder the Sequence of the function call in the _handleReturn() function.
Create a temporary variable to store the execution fee before deleting the mapping.
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.