LevelOne::graduateAndUpgrade() calculates the payPerTeacher once:
It then loops over listOfTeachers and transfers that full amount to every teacher:
Because the formula omits / totalTeachers, the contract actually distributes
totalTeachers × 35 % = totalTeachers × 0.35 of the bursary.
With two teachers it sends 70 %; with three teachers it tries to send 105 % and immediately reverts for lack of balance.
Over‑payment of funds – every teacher gets twice (or more) what they should.
Denial of service – if ≥3 teachers exist, LevelOne::graduateAndUpgrade() reverts (ERC20InsufficientBalance), preventing the upgrade path entirely and locking all bursary funds.
Add to LevelOneAndGraduateTest.t.sol and run forge test --match-test test_test_teachers_are_overpaid() -vvv => The test will pass, proving that the two teachers receive the full 35% each.
Adding a third teacher (chris) in LevelOneAndGraduateTest.t.sol makes the call revert:
Divide the teacher share by the number of teachers (LevelOne::graduateAndUpgrade):
`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.