MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: low
Invalid

Gas inefficiency when calculating ip_

Summary

The ip_ variable is not calculated in the most gas-efficient way.

Vulnerability Details

By unwrapping the paranthesis of the expression ((endTime_ - payoutStart_ - intervalsPassedBefore_ * interval_) / interval_), the term intervalsPassedBefore would be first multiplied by interval_ only to be divided by it again. Removing this term from the paranthesis would avoid performing an additional multiplication operation.

Impact

Extra gas is spent for additional arithmetic operation

Tools Used

Manual inspection

Recommendations

Rewrite the term as ((endTime_ - payoutStart_) / interval_ - intervalsPassedBefore_)

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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