The PerpetualVault
contract includes logic for processing withdrawals or to cancel an onging withdrawal flow and refund unused execution fees to users. However, the parameters used for IGmxProxy(gmxProxy).refundExecutionFee
to refund fees leads to execution fees refunded to the wrong user and also results in incorrect refund amounts.
In the withdrawal flow and during cancelling a withdrawal flow, the contract attempts to refund execution fees, but it incorrectly references depositInfo[counter]
instead of depositInfo[depositId]
/ depositInfo[flowData]
respectively. Since counter
might point to the latest depositor Id (unless last action was a cancelFlow
during deposit), this leads to:
Execution fees being refunded to the wrong user.
Incorrect refund amounts being issued.
In _handleReturn
function
In _cancelFlow
function
Users will not receive their execution fee refunds.
Refunds may be incorrectly allocated to other users.
Manual Review
Update the contract to ensure that the correct depositId
is used when referencing execution fee refunds.
Likelihood: Low, contract has to call cancelFlow after a withdraw, and the settle action is already executed by GMX. Impact: High, the fees will be distributed to the last depositor and not the withdrawer.
Likelihood: Low, contract has to call cancelFlow after a withdraw, and the settle action is already executed by GMX. Impact: High, the fees will be distributed to the last depositor and not the withdrawer.
Likelihood: Medium/High, when withdraw on a 1x vault. Impact: High, the fees will be distributed to the last depositor and not the withdrawer.
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.