Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: high
Valid

The function variance will revert due to subtraction underflow.

Summary

The function variance will revert due to subtraction underflow.

Vulnerability Details

In the function variance , the mean value will be calculated based on the data first, and then the average variance will be calculated. However, when a value is less than the mean value, the function will revert.

Impact

Core logic such as validate and finalizeValidation will be broken.

Tools Used

VSCode

Recommendations

Using int256 instead uint256:

int256 diff = data[i] - mean;
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Underflow in computing variance

Support

FAQs

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