DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Does not follow CEI (Checks, Effects, Interactions)

Summary:

In the PerpetualVault.sol contract, the _cancelFlow() function violates the Checks-Effects-Interactions (CEI) pattern at lines 1232 and 1233. Specifically, the state update occurs after the transfer:

collateralToken.safeTransfer(depositInfo[depositId].owner, depositInfo[depositId].amount);
totalDepositAmount = totalDepositAmount - depositInfo[depositId].amount;

Impact:

This pattern can lead to potential vulnerabilities and inefficiencies.

Tools Used:

Manual review

Recommendations:

To comply with CEI, state changes should occur before external calls (transfers). The following adjustment is recommended:

totalDepositAmount = totalDepositAmount - depositInfo[depositId].amount;
collateralToken.safeTransfer(depositInfo[depositId].owner, depositInfo[depositId].amount);
Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Suppositions

There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Suppositions

There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.

Support

FAQs

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