All 3 functions, GET_HORSE_FED_TIMESTAMP
,FEED_HORSE
and IS_HAPPY_HORSE
only hash the horseId
variable when trying to load the value of the mapping horseIdToFedTimeStamp
. This will result in loading another value from storage rather than the mapping.
These three functions attempt to read the mapping horseIdToFedTimeStamp
but fail to hash the correct values to recover it's correct slot.
This will cause issues as the values that will be loaded/modified would be from another slot in storage.
A main property of the contract will thus be completely wrong and exposed, as the state of happiness of the horse might always be true or false.
Manual review
Need to load both the mapping location and horseId before hashing both.
#define constant HORSEIDTOTIMESTAMP_LOCATION= add correct slot here
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.