The emergencyResume
function is intended to recover the vault's liquidity following an emergencyPause
. It operates under the assumption of a successful deposit call. However, if the deposit call is cancelled by GMX, the emergencyResume
function does not account for this scenario, potentially locking funds.
When emergencyResume
is invoked, it sets the vault's status to "Resume" and deposits all LP tokens back into the pool. The function is designed to execute when the vault status is "Paused" and can be triggered by an approved keeper.
Should the deposit fail, the callback contract's afterDepositCancellation
is expected to revert, which does not impact the continuation of the GMX execution. After the cancellation occurs, the vault status is "Resume", and the liquidity is not re-added to the pool.
Given this, another attempt to execute emergencyResume
will fail because the vault status is not "Paused".
In this state, an attempt to revert to "Paused" status via emergencyPause
could fail in GMXManager.removeLiquidity, as there are no tokens to send back to the GMX pool, leading to a potential fund lock within the contract.
The current implementation may result in funds being irretrievably locked within the contract.
Manual Analysis
To address this issue, handle the afterDepositCancellation case correctly by allowing emergencyResume to be called again.
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.