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

Issues with the equality check statements in `IS_HAPPY_HORSE`

Summary

The function IS_HAPPY_HORSE does not follow the solidity contract logic in the function isHappyHorse.

Vulnerability Details

The main difference is :

@> eq // [timestamp == horseFedTimestamp]
start_return
jump // unconditional jump
start_return_true:
0x01
start_return:
// Store value in memory.
0x00 mstore

This equality check is wrong, rather than returning the value of the check :

HORSE_HAPPY_IF_FED_WITHIN <= timestamp - horseFedTimestamp
It returns this timestamp == horseFedTimestamp

Which is not what is expected by the solidity function. This check will most of the time be wrong

Impact

Almost complete DOS of the function isHappyHorse as it will almost always return false.

Impact : high

Tools Used

Manual review

Recommendations

Update the equality so that it checks that HORSE_HAPPY_IF_FED_WITHIN == timestamp - horseFedTimestamp. However, it should return 0 if this is the case in order to be coherent with the solidity function.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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