The graduateAndUpgrade
function incorrectly calculates teacher wages, paying each teacher 35% of the bursary
instead of splitting 35% among all teachers, leading to overpayment and underfunding the bursary
.
Root Cause: The calculation payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION
applies 35% per teacher, not divided among them.
Attack Path: With 2 teachers, each receives 35% (total 70%) + 5% for the Principal = 75%, leaving only 25% for the bursary
instead of 60%.
Affected Component: Wage distribution logic and bursary
balance.
Expected: Teachers split 35% (e.g., 17.5% each for 2 teachers), bursary
retains 60%.
Actual: Each teacher gets 35%, bursary
drops to 25%.
Financial Imbalance: Overpays teachers, reducing the bursary
below the intended 60%.
Invariant Violation: Breaks the rule that 60% of the bursary
should remain post-upgrade.
Correct the wage calculation to split the 35% among teachers. Here’s the diff:
`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.