Normal Behavior:
When a memorabilia collection is created with a given maxSupply, users should be able to redeem up to maxSupply unique memorabilia NFTs from that collection.
Issue:
The supply check in redeemMemorabilia uses a strict less-than comparison (<), which prevents the last item from ever being minted. As a result, only maxSupply - 1 items can be redeemed, not the intended maxSupply.
Likelihood:
This will always occur when a user attempts to redeem the last memorabilia item in any collection.
Impact:
Users are unable to mint the full advertised supply.
This can cause economic and reputational harm to the project.
The following test demonstrates the bug: after creating a memorabilia collection with a maxSupply of 3, a user is able to redeem only 2 items. Attempting to redeem the third (final) item fails with "Collection sold out", proving that the last item cannot be minted due to the off-by-one error.
To fix the bug, update the memorabilia supply check in redeemMemorabilia from a strict less-than (<) comparison to a less-than-or-equal-to (<=) comparison. This change allows users to redeem up to the intended maximum supply for each 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.