GivingThanks

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

### Missing Event in `registerCharity` Function

Description
The registerCharity function allows users to register a charity by adding its address to the registeredCharities mapping. However, there is currently no event emitted to log this registration. Emitting an event is important for tracking charity registrations on the blockchain.

Code Snippet

function registerCharity(address charity) public {
registeredCharities[charity] = true;
}

Recommendation
Add an event declaration for charity registrations and emit this event within the registerCharity function after successfully registering the charity. This will provide a clear log of charity registrations on the blockchain.

Code Snippet

// Declare the CharityRegistered event
event CharityRegistered(address indexed charity);
function registerCharity(address charity) public {
registeredCharities[charity] = true;
emit CharityRegistered(charity); // Emit the CharityRegistered event
}
Updates

Lead Judging Commences

n0kto Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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