Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

Invariant breaking in giveReview() __LevelOne.sol

Summary

The giveReview function checks the review count for students. However, the invariant in the contract are:

"Students can only be reviewed once per week"

"Student must have 4 reviews before upgrade"

Vulnerability Details

The following check in giveReview function breaks the invariant because it allows 5 reviews instead of the intended 4:

require(reviewCount[_student] < 5, "Student review count exceeded!!!");

Impact

Students may receive more reviews than intended, violating system assumptions tied to the upgrade condition.

Tools Used

Manual review

Recommendations

Update the check to enforce a maximum of 4 reviews:

require(reviewCount[_student] < 4, "Student review count exceeded!!!");
Updates

Lead Judging Commences

yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Appeal created

hawks Submitter
18 days ago
hawks Submitter
18 days ago
yeahchibyke Lead Judge
17 days ago
yeahchibyke Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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