The graduateAndUpgrade function in LevelOne.sol incorrectly distributes teacher payments, giving each teacher 35% of the total bursary instead of sharing the 35% among all teachers.
Each teacher receives 35% of the total bursary, and total teacher payment should be 35% shared among all teachers.
Current implementation: payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION this means if there are 3 teachers, they would receive 105% of the bursary (35% each) which is inconsistent with the protocol assumptions.
High: This vulnerability:
Could drain the entire bursary if there are multiple teachers
May leave insufficient funds for principal payment
Makes the payment system unsustainable
Could lead to financial losses for the school
Manual code review
Fix teacher payment calculation in graduateAndUpgrade:
Calculate total teacher payment as 35% of bursary
Divide total teacher payment by number of teachers
Add validation to ensure total payments don't exceed bursary
`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.