The cancelFlow function fully refunds the execution fee to the withdrawer, but since the gmxProxy has already paid the settlement transaction fee, this can lead to an issue where gmxProxy ends up covering the cost. If gmxProxy does not have enough ETH, the cancelFlow transaction reverts, preventing withdrawal cancellation.
The withdraw function requires double the execution fee since it includes both the settlement and actual withdrawal transactions.
The settlement order is executed immediately, deducting the first execution fee.
If cancelFlow is called before the actual withdrawal transaction, it refunds the full execution fee to the withdrawer.
Since gmxProxy has already paid for the settlement transaction, it bears the cost.
If gmxProxy has insufficient ETH to cover the settlement fee, cancelFlow reverts, leading to a failed cancellation.
Users may be unable to cancel withdrawals if gmxProxy lacks funds.
Potential Loss of Funds from the gmxProxy.
paste in /test/PerpetualVault.t.sol
Partial Refund Instead of Full Refund: Modify cancelFlow to refund only the withdrawal execution fee while keeping the settlement execution fee covered.
Likelihood: None/Very Low, when any flow is cancelled after a settle and before a withdraw. No real reason to do that. Impact: High, loss of funds.
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.