The graduateAndUpgrade
function distributes 35% of the bursary to each teacher and 5% to the principal, leaving the remaining funds (up to 60%) locked in the contract.
If there are two teachers, each receives 35%, totaling 70%, plus 5% to the principal—leaving 25% unallocated. The contract does not transfer the remaining USDC, causing them to be stuck indefinitely.
add this function to LevelOneAndGraduateTest
:
Run test: forge test --match-test test_graduate_leaves_funds_locked -vvv
Assuming schoolFees = 5000 USDC
and 6 students enrolled (6 × 5000 = 30000 USDC
initial bursary).
This proves 25% of the bursary (7500 USDC) was left locked in the contract after distributions.
Significant portions of the school fees remain inaccessible, reducing the system's efficiency and potentially locking funds permanently.
Calculate the total distributed percentage and transfer the remaining balance to a designated address (e.g., the principal or a treasury) after distributions.
`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.
Funds are stuck in `LevelOne()` contract after upgrade.
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.