Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Off-by-One Error in Memorabilia Minting Supply Check

Root

The function is designed to allow users to redeem memorabilia NFTs from a collection, up to a specified maxSupply. The current check uses

Impact:

  • **Off-by-One Error: **The current logic only allows minting up to maxSupply - 1 NFTs. The last possible itemId that can be minted is maxSupply - 1.


Proof of Concept




Recommended Mitigation

Change the check to use <= (less than or equal):

- require(collection.currentItemId < collection.maxSupply, "Collection sold out");
+ require(collection.currentItemId <= collection.maxSupply, "Collection sold out");
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 month ago
inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

Off by one error in redeemMemorabilia

Support

FAQs

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