The graduateAndUpgrade function is responsible for authorizing an upgrade to a new contract and distributing wages to teachers and principal from a bursary. It assumes all the preconditions are met.
Without checks, this function can:
Allow graduation before the session officially ends.
Permit upgrades even if students are not fully reviewed.
Promote students who fail to meet the required score, undermining the evaluation process.
Waste funds by prematurely distributing USDC-based wages.
Manual code review
Before authorizing an upgrade or distributing funds:
Ensure the session has ended by checking the current timestamp against sessionEnd.
Loop through all students in listOfStudents and confirm:
Each has exactly 4 reviews.
Each meets or exceeds the required cutOffScore.
This enforces the academic and financial logic and prevents manipulation or premature execution by the principal.
Add the following require statements before _authorizeUpgrade(_levelTwo):
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
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.