GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

Incorrect registry set in constructor which blocks the donation of funds

Summary

  • In the constructor, the initial registry is being set as msg.sender instead of _registry which is not intended. If the msg.sender is not a contract, it blocks the donate function call. If msg.sender is a contract but does not implement CharityRegistry, it will block the donate function call.

Impact

  • This blocks the donate function for the users until the owner updates the registry to the correct address.

Tools Used

  • Manual review

Recommendations

constructor(address _registry) ERC721("DonationReceipt", "DRC") {
- registry = CharityRegistry(msg.sender);
+ registry = CharityRegistry(_registry);
Updates

Lead Judging Commences

n0kto Lead Judge 12 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-bad-registry-set-at-construction

Likelyhood: High, the parameter is not well used and won't be set. Impact: Low, can be changed with the setter and no one will be able to donate to malicious charity.

Support

FAQs

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