Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

`reviewCount` Mapping Is Never Updated or Initialized

Summary

The reviewCount mapping is used to restrict the number of reviews a student can receive (maximum of 4), yet it is never updated when a review is given. This means the condition reviewCount[_student] < 5 will always evaluate to true, rendering the limit ineffective.

Impact

The absence of an update to reviewCount allows unlimited reviews for a student, bypassing the intended restriction. This could lead to abuse by malicious teachers who repeatedly reduce a student’s score, and by the way breaking one of the invariant.

Recommendation

Increment the reviewCount[_student] value after each successful review, as shown below:

reviewCount[_student] += 1;

Place this line after updating lastReviewTime to ensure the student’s review count is tracked properly.

Tools Used

Slither

Updates

Lead Judging Commences

yeahchibyke Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

reviewCount not updated

`reviewCount` for students is not updated after each review session

yeahchibyke Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

reviewCount not updated

`reviewCount` for students is not updated after each review session

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!