Description:
When the principal calls LevelOne:graduateAndUpgrade, there are no checks to ensure that all students have gotten 4 reviews.
Impact:
This directly violates the invariant "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)"
Proof of Concept:
Since reviewCount is a private mapping, I changed it to a public mapping temporarily so that I can access the count value. By adding the following test code, we have shown that upgrading is possible even when students have less than 4 (in this case 0) reviews.
Recommended Mitigation:
By including the extra check below, we can ensure that all students have had 4 reviews before allowing the upgrade.
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
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.