Flow does not finalize for single ParaSwap deposit in _runSwap() function. This will lead to DoS of the entire flow.
When the vault is an 1xLong, it uses spot swap to handle position increase/decrease. When users deposit, it will set the nextAction.selector to INCREASE_ACTION, then the keeper will call runNextAction() to trigger the swap.
If the swap is a single Paraswap, it only mints the shares, but does not finalize the flow. This means the flow variable is not cleared, and the entire workflow is stuck.
https://github.com/CodeHawks-Contests/2025-02-gamma/blob/main/contracts/PerpetualVault.sol#L534-L535
An easy PoC for this is modifying the test_RefundGas_When_Using_Paraswap_Only. After user deposits, the flow variable is not cleared.
Entire workflow is stuck.
N/A
Call _finalize() function after minting.
Likelihood: Medium/High, - Leverage = 1x - beenLong = True - positionIsClosed = False - Metadata → 1 length and Dex Swap Impact: Medium/High, DoS on any new action before the admin uses setVaultState Since this seems to be the most probable path for a 1x PerpVault, this one deserves a High.
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.