Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

`HorseStore.sol::HorseStore::feedHorse` and `HorseStore.sol::HorseStore::isHappyHorse` lags necessary revert conditions causing updations even though horse id doesn't exist

Summary

The function updates the state for the horse id even though the horse id doesn't exist.

Vulnerability Details

The vulnerability arises due to the missing revert conditions when the horse id doesn't exist.
Even though if the horse id doesn't exist it updates the state.

Impact

Unnecessary updations even though horse id doesn't exist

Tools Used

Manual Review

Recommendations

Add a revert condition if token id doesn't exist in both the functions.

error HorseStore__HorseNotFound();
if (ownerOf(horseId) == address(0)) {
revert HorseStore__HorseNotFound();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Nonexistent horses can be fed

Support

FAQs

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