GivingThanks

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

Missing checks for zero address when assigning values to address state variables

Summary

Missing checks for zero address when assigning values to address state variables

Vulnerability Details

If admin calls CharityRegistry::changeAdmin(address newAdmin)without specifying the newAdmin, ownership of CharityRegistry contract will be lost.

Impact

Tools Used

Manual review

Recommendations

Add checks that if the address is zero.

function changeAdmin(address newAdmin) public {
+ require(newAdmin != address(0), "Invalid newAdmin address");
require(msg.sender == admin, "Only admin can change admin");
admin = newAdmin;
}
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.