Description: In LevelOne::graduateAndUpgrade
, the contract iterates over 'listOfTeachers' and calls 'usdc.safeTransfer(teacher, payPerTeacher)' in a single loop. Each transfer is an external call: if any teacher's address reverts (e.g. a malicious contract or a frozen account) or if the loop runs out of gas due to a large list, the entire graduation operation will revert. This blocks payouts for all teachers and the principal, and can permanently lock funds in the contract.
Impact:
A single malicious or misbehaving teacher can deny service to all other participants, preventing graduation and locking up the bursary.
If the teacher list grows too large, the loop may consume more gas than the block limit, causing out-of-gas reverts and effectively a DoS.
The principal cannot complete graduation, so neither teachers nor students can progress or be paid.
Recommended Mitigation: Use the pull-payment pattern instead of pushing payments in a loop. Record each teacher’s owed amount in a mapping and allow them to withdraw asynchronously:
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.