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

Unsafe cast from uint256 to uint64

Summary

uint256 to uint64 conversion can cause overflow

Vulnerability Details

totalFees = totalFees + uint64(fee);
In this calculation, fee is cast to uint64, but fee is originally uint256. when a number larger than the range that can be represented by uint64 is entered, it causes an overflow and the calculation goes wrong

Impact

WithdrawFees() cannot be invoked because the balance of the Fee is collapsed, and it may not be possible to withdraw the Fee

Tools Used

Manual

Recommendations

Use the safecast library

Updates

Lead Judging Commences

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

unsafe cast of fee to uint64

Support

FAQs

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

Give us feedback!