redeemMemorabilia()
leads to Supply UnderflowThe redeemMemorabilia function allows users to redeem memorabilia NFTs from a collection, incrementing currentItemId after each redemption.
The function checks collection.currentItemId < collection.maxSupply, but since currentItemId starts at 1, the last item (when currentItemId == maxSupply) can never be redeemed.
Likelihood:
This will occur every time a collection is created and users attempt to redeem the last available item.
The last item in every collection will be unredeemable.
Impact:
Users will be unable to redeem the full advertised supply of memorabilia.
The actual supply will always be one less than intended, leading to user confusion and potential loss of value.
Create a collection with maxSupply = 10
Redeem 9 items (currentItemId goes from 1 to 10)
Attempt to redeem the 10th item: require fails, even though maxSupply is 10
Use <= instead of < to make sure this does not occur.
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.