The FestivalPass::redeemMemorabilia function is intended to allow users to redeem a fixed-supply NFT from a memorabilia collection. However, the current logic prevents users from redeeming the final (i.e., maxSupply-th) NFT due to an off-by-one error in this condition:
This check disallows redemption when currentItemId == maxSupply - 1 (just before the last mint) and then prevents minting when currentItemId == maxSupply, thereby allowing only maxSupply - 1 NFTs to be minted.
Impact:
The collection's maxSupply is never fully reachable.
It results in an under-allocation of NFTs, which could affect the scarcity and value perception of the collection.
Users expecting to be able to redeem up to the defined maxSupply will face unexpected reverts.
The condition collection.currentItemId < collection.maxSupply prevents the minting of the final item. When currentItemId == maxSupply - 1, the redemption succeeds and increments the ID to maxSupply, at which point further redemptions are blocked—even though the total supply is now exactly equal to the allowed maximum.
Update the condition to be less than and equal to the collection.maxSupply
Or Alternatively we can start the currentItemId index at 0 in the FestivalPass::createMemorabiliaCollection function
that way we can always mint up to the maxSupply of the NFT collection.
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.