The graduateAndUpgrade function fails to verify that all students have received the required 4 reviews (one per week) before performing the system upgrade, directly violating a critical system 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)."
Without this validation, the system allows premature graduation and upgrades without completing the full academic evaluation process. This fundamentally undermines the educational integrity of the platform, as students can progress without receiving the complete assessment they are entitled to receive.
This issue will occur in any standard graduation cycle where at least one student has not received all four required reviews. Given the manual nature of reviews and the potential for teacher oversight, this is highly likely to occur in practice.
The graduateAndUpgrade function currently lacks any mechanism to check the number of reviews each student has received:
While the contract tracks review counts in the reviewCount mapping and restricts review frequency with the lastReviewTime mapping, it never verifies that students have received all required reviews before upgrading.
This creates several serious issues:
Students can graduate without receiving proper evaluation
The educational process is incomplete
The stated invariant is violated
Teachers might be paid despite not fulfilling their review obligations
The contract does have a giveReview function that updates the reviewCount for each student, but surprisingly, there's a limitation that students can receive a maximum of 5 reviews:
However, this limitation is never balanced with a minimum requirement check during graduation.
Implement a validation in the graduateAndUpgrade function to ensure all students have received exactly 4 reviews:
This ensures compliance with the stated invariant and maintains the educational integrity of the platform.
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.