In the Solidity contract the function isHappyHorse
conditional will lead to an underflow when the block timestamp is less than 86400 seconds.
Underflows/Overflows occur when arithmetic on an unsigned integer would go out of the bounds of maximum or minimum value that type can hold.
When subtracting HORSE_HAPPY_IF_FED_WITHIN
from the block.timestamp
that is less than 86400 seconds you will go below 0 and thus the function will return true.
Low, I assume this will only effect production blockchains who's block timestamp is less than 1 day/86400 seconds.
Foundry
Restructure the isHappyHorse
conditional to compare horseIdToFedTimeStamp[horseid] + HORSE_HAPPY_IF_FED_WITHIN >= block.timestamp
this conditional will return true otherwise false.
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.