Hawk High

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

Mismatch between the state variables of `LevelOne` and `LevelTwo`

Description and Impact

The LevelTwo contract, intended as the next implementation after LevelOne, does not maintain the same state variables as LevelOne .

LevelTwo has missing state variables that exist in LevelOne ( schoolFees, reviewCount, lastReviewTime ) .

When upgrading smart contracts, both the old implementation and the new implementation has to implement the state variables in the exact same way .

LevelOne

principal
inSession
schoolFees
sessionEnd
bursary
cutOffScore
isTeacher
isStudent
studentScore
reviewCount
lastReviewTime
listOfStudents
listOfTeachers
usdc

LevelTwo

principal
inSession
[MISSING] schoolFees
sessionEnd
bursary
cutOffScore
isTeacher
isStudent
studentScore
[MISSING] reviewCount
[MISSING] lastReviewTime
listOfStudents
listOfTeachers
usdc

Recommended mitigation

Respect the implementation of the state variables between LevelOne in LevelTwo to be identical .

PoC

There is no need for a PoC .

Updates

Lead Judging Commences

yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
yeahchibyke Lead Judge 20 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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