In HorseStore.huff
in the FEED_HORSE
macro, there is an issue revolves around the absence of a check for the existence of a horse before allowing it to be fed.
The FEED_HORSE
macro does not include a check to verify the existence of the horse with the given horseId
. This omission allows feeding a horse without ensuring that it has been minted previously.
It allows feeding a horse without ensuring its prior minting. This could lead to inconsistencies in the contract state and potential unexpected behavior. Basically, this break the invariant because how can horse be happy if it is not present?
Copy the below code
Run it via forge test --match-test testStableMasterIsFeedingToGhostsInsteadOfHorsesInHuff
Results:
Manual review.
Include a check to verify the existence of the horse with the given horseId
before proceeding with the feeding logic. This will prevent feeding a horse that has not been minted.
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.