Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Valid

After `ProcessCompoundCancellation()`, the status of vault is not reset to Open

Summary

processCompoundCancellation is called after liquidity could not be added using a compound() action and the vault status must be reset to Open but is set to Compound_Failed

Vulnerability Details

When compound() is called and this function fails, it is not handled properly as in the diagram flow and documentation as shown.

Within the GMXCompound flow, the other function that can accept this state is in verification:

function beforeCompoundChecks(
GMXTypes.Store storage self
) external view {
if (
self.status != GMXTypes.Status.Open &&
self.status != GMXTypes.Status.Compound_Failed
)

But, it will only change if the result is correct. Otherwise, if this error that was initially generated persists and the compound cannot be performed, the vault will be left with the status "GMXTypes.Status.Compound_Failed" and the keeper will have to call "emergencyPause" and interrupt the operation of the vault to change this state.

Impact

Incorrect handling of control checks, interrupting the correct flow and leaving the vault disabled.

Tools Used

Manual code review

Recommendations

Handle correctly for processCompoundCancellation() and update the final status for OPEN.

Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Wrong status transition on processCompoundCancellation

Impact: High Likelihood: Low The sponsor confirmed it's a typo in the diagram but the documentation/source is the source of truth for the hawks. Will group all findings pointing out the wrong status transition to Compound_Failed based on the diagram.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.