Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

getNextTokenId function gets the current tokenId

Summary

According to README.md: "getNextTokenId - Allows the users to get the next token id."
However, the current implementation returns the most recent tokenId,

Vulnerability Details

function testGetNextTokenIdGetsCurrentTokenId() public {
    assertEq(ramNFT.getNextTokenId(), 0);
    vm.prank(organiser);
    ramNFT.mintRamNFT(organiser);
    assertEq(ramNFT.getNextTokenId(), 1);
}

Impact

Since this function is not called within the scope, it does not have any immediate impact.
However, should there be any external contracts that calls getNextTokenId(), it may become a vulnerability.

Tools Used

Manual Review

Recommendations

I suggest the return value to be `tokenCounter + 1"

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.