Hawk High

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

M-03. LevelTwo has storage collisions with levelOne

Summary

In level two, it misses two storage variable reviewCountand lastReviewTime

As a result, the two following variable istOfStudents and listOfTeacherswill use their variable slots.


mapping(address => bool) public isTeacher;
mapping(address => bool) public isStudent;
mapping(address => uint256) public studentScore;
/**
@audit miss: reviewCount & lastReviewTime
*/
address[] listOfStudents;
address[] listOfTeachers;

Vulnerability Details

istOfStudents and listOfTeachers will overwrite the slots used by reviewCountand lastReviewTime , slots which contain the location where their data is actually stored

Impact

It is not possible to usereviewCountand lastReviewTimeinside LevelTwo.
The impact is low since the logic inside levelTwo is minimalst

Tools Used

Manual analysis

Recommendations

Add the missing variables or implement ERC-7201 to manage storage variable: https://eips.ethereum.org/EIPS/eip-7201

Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

storage collision

Support

FAQs

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