GivingThanks

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

Missing Event in `updateRegistry` Function

Description
The updateRegistry function in the GivingThanks contract allows the admin to update the address of the CharityRegistry. However, there is currently no event emitted to log this change. Emitting an event is important for tracking changes to the registry address, providing transparency and accountability in the contract's operations.

Code Snippet

function updateRegistry(address _registry) public {//@reported no access control
registry = CharityRegistry(_registry);
}

Impact

  • Lack of Transparency: Without an event, there is no way for external systems or users to track when the registry address is updated, making it difficult to audit or verify changes to the contract's state.

  • Reduced Interoperability: Other contracts or decentralized applications (dApps) that rely on registry updates will not be able to react to or display this information, limiting the functionality of the ecosystem.

Recommendation
Add an event declaration for registry updates and emit this event within the updateRegistry function after successfully updating the registry address. This will provide a clear log of registry changes on the blockchain.

Code Snippet

// Declare the RegistryUpdated event
event RegistryUpdated(address indexed oldRegistry, address indexed newRegistry);
function updateRegistry(address _registry) public {//@reported no access control
address oldRegistry = address(registry); // Store the old registry address
registry = CharityRegistry(_registry);
// Emit the RegistryUpdated event
emit RegistryUpdated(oldRegistry, _registry);
}
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.