During a withdrawal, the last step of the process is the invocation of PerpetualVault::_handleReturn. This function handles the refund of fees is applicable.
It will, however, never refund any fees.
One of the inputs to _handleReturn is refundFee. If set to true, and the user has paid more execution fees than used, this function should refund the difference:
The problem lies in the fact that depositInfo[depositId] is burnt just the line above this condition is checked so depositInfo[depositId].executionFee is always zero and will never meet this condition (if (depositInfo[depositId].executionFee > usedFee)):
User will never get any fee refunded.
Manual review
Cache the value of depositInfo[depositId] before burning or burn depositId after fees are refunded.
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.