Beginner FriendlyFoundryGameFi
100 EXP
View results
Submission Details
Severity: medium
Invalid

_nextTokenId updation done prematurely

Summary

Variable _nextTokenId incremented before the current value is assigned to the token to be minted.

Vulnerability Details

uint256 tokenId = _nextTokenId++;

Impact

View function getDesign() will throw an error on the latest minted token, and view function getNextTokenId() will return the tokenId of the latest minted token instead of the next token, leading to erratic behaviour on integration.

Tools Used

Manual review

Recommendations

Update line 39 to two lines:

uint256 tokenId = _nextTokenId;
_nextTokenId++;
Updates

Lead Judging Commences

bube Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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