GivingThanks

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

[H-1] wrong implementation in constructor in GivingThanks.sol

Summary

in the constructor::GivingThanks.sol registry is initialized to CharityRegistry(msg.sender)rather than the parameter _registry

constructor(address _registry) ERC721("DonationReceipt", "DRC") {
registry = CharityRegistry(msg.sender);
owner = msg.sender;
tokenCounter = 0;
}

Vulnerability Details

registry been initialized as CharityRegistry(msg.sender) will cause an overall malfunction of the protocol. As functions from the registry contract cannot be called successfully by the GivingThanks.sol contract

Impact

Overall malfunction of the protocol.

Tools Used

Manual review

Recommendations

the registry variable should be properly initialized

registry = CharityRegistry(_registry)
Updates

Lead Judging Commences

n0kto Lead Judge 8 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.