The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Possible Integer Overflow in `mint()` Function of `SmartVaultManagerV5` Contract

Summary

mint() function increments lastToken without checking for overflow

Vulnerability Details and Impact

In the mint() function, the line lastToken = lastToken + 1; increases the lastToken value by one each time a new token is minted. This operation can lead to an integer overflow if lastToken reaches its maximum value. After this point, every subsequent call to mint() would reset lastToken to zero, potentially causing issues with token uniqueness and tracking.

Recommendations

Add a check before increasing lastToken to ensure that it will not overflow.

require(lastToken < type(uint256).max, "Last token would overflow");
lastToken++;

This require statement checks that lastToken is less than the maximum value that can be held by a uint256. If lastToken is already at its maximum value, the condition will be false and the transaction will revert, preventing the overflow

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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