contracts/PerpetualVault.sol
The cancelFlow
function is used to terminate an ongoing flow due to issues on the GMX side of the protocol. A key invariant maintained throughout the protocol is that keeper operations should never revert.
To enforce this, all functions called by the keeper that interact with tokens, user addresses, or user-provided addresses are wrapped in try/catch
statements to gracefully handle unexpected failures. However, within the _cancelFlow
function, a token transfer is performed to an address without being wrapped in a try/catch
statement. If this transfer operation fails, the entire keeper operation would revert, violating a fundamental property of the keeper flow.
The recipient address is blacklisted (e.g., USDC, USDT).
The contract holds fewer tokens than the transfer amount.
Keeper-called functions do not emit events, making it difficult to detect unexpected reverts. This lack of visibility can lead to unintended execution failures and disrupt the overall operation flow.
Manual Review
Wrap the collateral token transfer operation in a try/catch
statement to gracefully handle unexpected failures without causing a revert.
Likelihood: Extremely Low, when user is blacklisted between the deposit/withdraw and cancelFlow is called by the Keeper. Impact: Medium/High, cancelFlow DoS.
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.