The LevelOne
contract’s giveReview
function fails to increment the review count for students after each review. As a result, students can receive more than the intended four weekly reviews, undermining graduation requirements and enabling inconsistent or unintended state transitions.
The contract aims to enforce that each student can receive only one review per week, with a total of four reviews over the session. However, the review count is never updated after a review is given, making the guard check ineffective:
Students can be reviewed more than four times.
Graduation checks relying on completed reviews can be bypassed or produce incorrect results.
Undermines fairness and predictability of the upgrade process.
Because reviewCount[_student]
is never incremented, the check will always pass. This allows unlimited reviews per student, contrary to the intended business rule that limits each student to one review per week, for a total of four.
Manual code review
Add the missing increment:
`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.