Potential for Integer Overflow in uint64 Casting
The current implementation of casting the fee variable to uint64 during its addition to totalFees poses a risk of integer overflow. If the calculated fee exceeds the maximum value that a uint64 can hold, it will result in an overflow, leading to incorrect tallying of totalFees
In the event of an overflow, totalFees would not accurately reflect the accumulated fees. This discrepancy could lead to funds becoming trapped within the smart contract, as the true amount of fees might surpass the recorded totalFees. Consequently, this would prevent the complete withdrawal of funds that are legitimately owed.
Manual review
Use SafeCast.toUint64(fee) from OZ
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.