The reviewCount
mapping, which appears to track how many reviews a student has received, is never incremented within the giveReview()
function. This makes the associated review count check (require(reviewCount[_student] < 5)
) misleading and ineffective.
Relevant code snippet:
This line intends to enforce an upper limit on how many times a student can be reviewed. However, the function fails to update reviewCount[_student]
after a review is given. This results in:
Students are potentially being reviewed indefinitely without hitting the limit.
Critical invariant — "Students must have gotten all reviews before system upgrade" — is impossible to validate.
Review-based upgrade logic is becoming unreliable or meaningless.
System Invariant (from provided spec):
"Students must have gotten all reviews before system upgrade. System upgrade should not occur if any student has not gotten 4 reviews (one for each week)."
Since the system depends on this count for upgrade eligibility, failing to increment it introduces a logical inconsistency and a potential for privilege abuse or system malfunction.
Protocol upgrade gating becomes unenforceable.
Violates the upgrade eligibility invariant.
Students may be upgraded prematurely or indefinitely blocked from valid progression.
Potential DoS or unfair certification due to untracked evaluations.
Manual Code Review
Add the following line at the end of the giveReview()
function (before the emit
):
`reviewCount` for students is not updated after each review session
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.