Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing event in `setTreatCost` function

Summary

Fuction setTreatCost` changes the price of a selected NFT and certainly changes the state of the contract. In general, if you change a storage variable or move Ether in and out of the contract, you should emit an event.

Vulnerability Details

function setTreatCost(
string memory _treatName,
uint256 _cost
) public onlyOwner {
require(treatList[_treatName].cost > 0, "Treat must cost something.");
treatList[_treatName].cost = _cost;
- missing event
}

Impact

The information about changing price will not be logged.

Recommendations

Add event , f.e event priceChanged(uint256 newPrice, string treatName)

Updates

Appeal created

bube Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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