Description: After distributing 5% to the principal and 35% to teachers, the remaining 60% of the bursary should persist in the 'bursary' state variable so it can be carried over or audited. The current implementation computes only the two payout shares and never recalculates or stores the residual.
Impact: Funds corresponding to the 60% residual go untracked:
The bursary state variable remains stale (usually still its original value or zero), breaking the invariant
Over time, "lost" bursary accumulates invisibly, preventing accurate accounting or reuse in future sessions.
Proof of Concept:
Note: this PoC assumes that the 'Incorrect Teacher-Pay Calculation' issue has already been fixed, so that graduateAndUpgrade gets as far as splitting by totalTeachers instead of reverting earlier.
After this fix include the following test in the LevelOneAndGraduateTest.t.sol
file:
Recommended Mitigation: After executing all transfers, compute and persist the 60% residual explicitly:
The bursary is not updated after wages have been paid in `graduateAndUpgrade()` function
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.