Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: medium
Likelihood: high
Invalid

Teachers assigned incorrect wage percentage in LevelTwo.sol

Summary

In LevelTwo.sol, teachers are assigned a wage of 40 instead of the required 35 as defined by the protocol documentation.

Vulnerability Details

The teacher wage is assigned a different, incorrect value of 40 in LevelTwo.sol than the correctly defined 35 in LevelOne.sol.

LevelOne.sol: uint256 public constant TEACHER_WAGE = 35;

LevelTwo.sol: uint256 public constant TEACHER_WAGE_L2 = 40;

Impact

This will lead to an incorrect distribution of wages to teachers and will leave less funds in the bursary.

Tools Used

Manual review and Foundry

Recommendations

Fix the variable in LevelTwo.sol to reflect the correct percentage:

contract LevelTwo is Initializable {
using SafeERC20 for IERC20;
address principal;
bool inSession;
uint256 public sessionEnd;
uint256 public bursary;
uint256 public cutOffScore;
mapping(address => bool) public isTeacher;
mapping(address => bool) public isStudent;
mapping(address => uint256) public studentScore;
address[] listOfStudents;
address[] listOfTeachers;
- uint256 public constant TEACHER_WAGE_L2 = 40;
+ uint256 public constant TEACHER_WAGE_L2 = 35;
uint256 public constant PRINCIPAL_WAGE_L2 = 5;
uint256 public constant PRECISION = 100;
IERC20 usdc;
Updates

Lead Judging Commences

yeahchibyke Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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