ChoosingRam::increaseValuesOfParticipants
Description:
The ChoosingRam::increaseValuesOfParticipants
function contains checks to prevent users from using nonexistent token IDs. However, these checks use the >
operator instead of >=
when comparing token IDs against the current token counter (ramNFT.tokenCounter()
). As a result, users can incorrectly challenge with the current last token ID, which does not exist yet.
Impact:
Although this issue does not affect the outcome of ChoosingRam::increaseValuesOfParticipants
—users challenging with the last token ID will still have the same chances of winning or losing—it contradicts the developer's intentions and could lead to confusion or misuse.
Proof of Concept:
To demonstrate this issue, add the following test to the existing test suite:
get the lastTokenId
from ramNFT
check if the lastTokenId
has a address attached to it
Test the increaseValuesOfParticipants
with lastTokenId
Test the increaseValuesOfParticipants
with lastTokenId
+ 1 to make sure it reverts with correct error
check if the characteristics are updated for the challenge winner
Tools Used:
Manual Review
Recommended Mitigation:
Modify the token ID checks to use >=
instead of >
to correctly handle challenges involving the current last token ID, aligning with the developer's intentions.
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.