he graduateAndUpgrade(address _levelTwo, bytes memory)
function is the critical function where all the graduation-related validations should be enforced before upgrading to the next contract version (LevelTwo
).
No Validation of Student Score Against Cutoff
No sessionEnd
Time Check
No Validation of Review Count (Must Be 4)
Issue: The contract fails to verify whether a student's studentScore
meets or exceeds the required cutOffScore
.
Consequence: Students with poor performance or disciplinary issues can still graduate.
Recommendation: Add a condition like:
require(studentScore[student] >= cutOffScore, "Insufficient score to graduate");
sessionEnd
Time CheckIssue: The principal can trigger graduation before the session officially ends.
Consequence: Students might graduate with incomplete review cycles or manipulated sessions.
Recommendation: Enforce:
require(block.timestamp >= sessionEnd, "Session has not ended yet");
Issue: The contract does not verify that each student has received all 4 reviews (one per week).
Consequence: Students may graduate with partial evaluation, violating documentation invariants.
Recommendation: Validate:
require(reviewCount[student] == 4, "Not all reviews completed");
Logic Bypass: Students with poor performance (e.g., < cutOffScore
) incorrectly graduate.
Data Integrity: System state will be polluted with ineligible students, potentially affecting future rewards or tracking.
Mannual Review
graduateAndUpgrade
function:require(block.timestamp >= sessionEnd, "Session not ended");
for (uint256 i = 0; i < listOfStudents.length; i++) {
address student = listOfStudents[i];
if (!hasPaid[student]) continue;
if (reviewCount[student] < 4) continue;
if (studentScore[student] < cutOffScore) continue; // Graduate the student
graduated[student] = true;
}
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
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.