Incorrect Calculation of payPerTeacher in LevelOne::graduateAndUpgrade() will mismanage and could potentially drain the Bursary funds before all Teachers and the Principal can be paid. payPerTeacheris calculated as a whooping 35% of the entire bursarywhich is actually supposed to be the total wage amount to be distributed among all the teachers. This inevitably breaks the Payment Structure in the protocols Invariants.
payPerTeacher  is wrongly calculated here in:
this calculation only gives the general percentage of bursary to be distributed among all the teachers. Whereas it should also be divided by the variable totalTeachersvariable to get the accurate payPerTeacher
Incorrect payPerTeacherleads to all the bursaryfunds getting depleted rapidly as teachers are paid. This breaks the Payment Structure in the invariants.
consider the test code below for 2 teachers added and 6 students enrolled written into the available LevelOneAndGraduateTest.t.sol . This test passes and proves that payPerTeacheris wrongly calculated as the total wages for all teachers which breaks the payment structure invariant.
Manual Review
Consider replacing the calculation of payPerTeacher with the correct calculation as shown below;
`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.
`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.
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.