The nextTokenId is incremented only after the _mint and _setTokenURI calls. If any of these calls fail or revert, the token ID will not be incremented, which can lead to duplicate token ID usage if the transaction is reattempted.
If _mint or _setTokenURI fails for any reason (like gas limitations on the recipient or a failure in the metadata URI assignment), the same tokenId could potentially be reused, causing unexpected behavior or token duplication.
Manual Review
The increment nextTokenId should be done immediately after setting the tokenIdbefore _mint and _setTokenURI calls. This ensures that each minting operation always references a unique token ID, regardless of any issues in subsequent function calls.
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.