Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Invalid

`HorseStore.sol::HorseStore::isHappyHorse` returns false even if horse is happy.

Summary

It is given that - ''If horse has been fed within the past 24 hours, horse X must be happy."
But in the function it returns false for boundary condition.

Vulnerability Details

The vulnerability lies in the solidity contract isHappyHorse function where it returns false for boundary condition but it should be true.

Impact

Returns false even if horse is happy for boundary condition.

Tools Used

Manual Review

Recommendations

Make the below updations

function isHappyHorse(uint256 horseId) external view returns (bool) {
- if (horseIdToFedTimeStamp[horseId] <= block.timestamp - HORSE_HAPPY_IF_FED_WITHIN) {
+ if (horseIdToFedTimeStamp[horseId] < block.timestamp - HORSE_HAPPY_IF_FED_WITHIN) {
return false;
}
return true;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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