Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

The distribution between teachers is wrongly implemented

Description and Impact

When the Principal execute the LevelOne :: graduateAndUpgrade, from the school's budget 5% has to be transferred to the principal and 35% has to be distributed between all teachers` .

But the LevelOne :: graduateAndUpgrade will transfer 35% to each individual teacher instead of splitting the 35% to the number of teachers .

If there's only 1 teacher -> They correctly receive the whole 35% .

If there are 2 teachers -> The smart contract tries to pay out 2 * 35% which is 70% of the school's budger to the teachers .

If there are 6 teachers -> The smart contract tries to pay out 6 * 35% which is 210% that is greater than 100% .

Recommended mitigation

Modify the functionality related with the distribution of money to teachers within LevelOne :: graduateAndUpgrade .

PoC

There is not a PoC . The issue can be understood easily .

Updates

Lead Judging Commences

yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Validated
Assigned finding tags:

incorrect teacher pay calculation

`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.

yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Validated
Assigned finding tags:

incorrect teacher pay calculation

`payPerTeacher` in `graduateAndUpgrade()` is incorrectly calculated.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.