The redeemMemorabilia function contains an off-by-one error that prevents redemption when currentItemId equals maxSupply, making collections with maxSupply = 1 completely unredeemable. The memorabilia redemption logic uses a strict less-than comparison (currentItemId < maxSupply) while currentItemId starts at 1, creating a logical error where single-item collections can never be redeemed because the initial state has currentItemId = 1 and maxSupply = 1, making the condition 1 < 1 always false.
The function uses a strict less-than comparison while currentItemId starts at 1:
For a collection with maxSupply = 1:
Initial state: currentItemId = 1, maxSupply = 1
Check: 1 < 1 evaluates to false
Result: Redemption always fails
Likelihood: Medium - Organizers will likely create single-item limited edition collections, making this issue inevitable for those specific collections.
Impact: High - Entire memorabilia collections become unusable, preventing users from spending BEAT tokens and breaking organizer's intended functionality.
Medium severity because:
Entire memorabilia collections can be rendered unusable
Users cannot redeem limited edition single-item collections
Requires redeployment or new collection creation to fix
Create a single item collection and try to redeem it
Change the comparison to less-than-or-equal to allow redemption up to maxSupply:
This fix ensures that all items up to and including the maxSupply can be redeemed, making single-item collections functional.
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.