Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Data type inconsistency between the "uint256 fee" and the "uint64 totalFees"

Summary

This vulnerability concerns the interaction between two variables, fee and totalFees, one of which is of type uint256 and the other of type uint64. This type mismatch may lead to issues if the value stored in uint256 fee exceeds the maximum value representable by uint64.

Vulnerability Details

Impact

If the value stored in uint256 fee exceeds the maximum value that can be represented by uint64, the truncation that occurs when it is converted to uint64 may lead to overflow and incorrect accounting of fees. This can result in loss of data or inaccurate calculations of fees.

Tools Used

manual review

Recommendations

Recommended to use consistent data types for variables related to fees. Either both fee and totalFees should be of type uint256 or both should be of type uint64. The choice between uint256 and uint64 should be based on the expected range of values and gas efficiency.

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

overflow-uint64

Support

FAQs

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