The documentation of the HorseStore
protocol said that the horse is happy if it was fed within the past 24 hours, but the function HorseStore::isHappyHorse
excludes the time exactly 24 hours ago.
In the documentation of the project is said:
This means that if the horse was fed exactly 24 hours ago, the horse should be happy.
But the implementation of the function HorseStore::isHappyHorse
excludes the time exactly 24 hours ago and returns false
:
The owner of the horse think that his horse is happy, because he had fed it 24 hours ago, but the function HorseStore::isHappyHorse
returns false
.
The following test shows the issue. You can add this test to the file Base_Test.t.sol
and you can execute it with the Foundry command: forge test --match-test "testFeedingExactly24HoursAgoMakesHappyHorse" -vvv
The test is failed because it assumes that the horse should be happy if it was fed exactly 24 hours ago.
Manual Review, Foundry
Change the condition about the time when the horse is fed in HorseStore::isHappyHorse
:
After this change the horse will be happy if it was fed exactly 24 hours ago.
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.