Off-by-one error prevents last memorabilia redemption
The FestivalPass::redeemMemorabilia
function allows users to redeem a unique memorabilia NFT from a limited collection using BEAT tokens. The function uses the currentItemId
counter to enforce the supply cap with the following condition:
However, because currentItemId
starts at 1
, this condition excludes the final memorabilia item resulting in an off-by-one and leaving one item unreachable.
Likelihood: High
The logic runs on every redemptin call and users attempting to redeem up to maxSupply
will be blocked by the final one.
Impact: Medium
One memorabilia NFT will be permanently unredeemable per collection, breaking the promise of full supply availability and potentially leading to user frustration and incomplete collections.
Use <=
instead of <
to ensure the last item can be redeemed.
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.