mint() function increments lastToken without checking for overflow
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.
Add a check before increasing lastToken to ensure that it will not overflow.
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
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.