The function graduateAndUpgrade miscalculates how much each teacher should receive from the bursary. Instead of distributing 35% of the bursary across all teachers, it incorrectly gives each teacher the full 35% share. This results in massive overpayment and could cause the contract to transfer more than it holds.
Overdraw the contract’s USDC balance
Fail with a transfer revert due to insufficient funds
Lead to financial loss if exploited before failure
Let’s say:
Bursary = 1000e18
TEACHER_WAGE = 35 (representing 35%)
Number of teacher = 5
According to current code
So each teacher will get 350e18, which will total to
This exceeds the 1000e18 bursary by 750e18
Manual code review
Distribute the 35% share evenly across all teachers:
With this correction:
teacherShare = 350e18
payPerTeacher = 70e18
total payout = 5 × 70e18 = 350e18
Replace this:
With this:
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
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.