The graduateAndUpgrade
function contains a critical miscalculation in determining teacher payments, resulting in significant overpayment to each teacher. If there are multiple teachers, this bug can drain the contract’s entire bursary balance.
The function is defined as follows:
The variable payPerTeacher
is intended to allocate a portion of the total bursary
to all teachers. However, the current implementation allocates that portion per teacher, resulting in an over-distribution.
This leads to:
Overpayment to teachers
Bursary depletion
Inaccurate wage distribution
High financial risk: The contract could drain funds if totalTeachers > 2
Violation of intended logic: Teachers receive more than their fair share
Breaks trust assumptions: Wage allocation logic does not match declared constants
Manual Code Review
Correct the calculation to distribute the teacher wage pool equally among all teachers:
This ensures the teacher wage pool is correctly distributed among all teachers, preserving contract integrity and preventing fund loss.
`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.