According to the documentation, the teachers should share in 35% of the bursary.
Payment structure is as follows:
principal
gets 5% ofbursary
teachers
share of 35% of bursaryremaining 60% should reflect in the bursary after upgrade
However, the current implementation will pay every teacher 35% of the bursary.
The vulnerability is located in the graduateAndUpgrade
function of the LevelOne
contract.
where TEACHER_WAGE
is set to 35 and PRECISION
is set to 100. This means that every teacher will receive 35% of the bursary.
The following test will validate that the teachers share in 35% of the bursary:
Since the teachers are paid 35% of the bursary each this would not only mean that the teachers are overpaid but also that the school will not have enough money to pay more than two teachers.
When three teachers are hired the school would have to pay 35% + 35% + 35% + 5% = 110% of the bursary. This would lead to the contract being locked since the payout will be reverted.
Manually reviewed the code and the documentation.
Calulate the pay per teacher correctly as follows:
`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.