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

Return value of _runSwap() function is never used

Summary

The _runSwap returns a bool value i.e returns True if only dexSwap is performed or returns false if _gmxSwap is performed. According to the natspec if the returned value is true it indicates the swap is completed and if its false it indicates swap should continue.

Vulnerability Details

These are the instances where _runSwap() is called in different scenarios

  1. in run() 1,2,3

  2. in runNextAction 1](https://github.com/CodeHawks-Contests/2025-02-gamma/blob/e5b98627a4c965e203dbb616a5f43ec194e7631a/contracts/PerpetualVault.sol#L358-L358),2,3

Impact

As you can see in all the above instances the runSwap is called its return value is not made use of

Tools Used

Manual review

Recommendations

make use of the return value as intended and mentioned in the natspec

Updates

Lead Judging Commences

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

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

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

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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