GivingThanks

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

registry variable doesnt incorrect address

Summary

Incorrect code in constructor of CharityRegistry contract

https://github.com/Cyfrin/2024-11-giving-thanks/blob/304812abfc16df934249ecd4cd8dea38568a625d/src/GivingThanks.sol#L16

Vulnerability Details

The contract has below incorrect code. msg.sender contains deployer address but not registry address. Due to this registry doesnt store registery address.

registry = CharityRegistry(msg.sender);

Impact

Registry functions wont work in GivingThanks contract

Tools Used

Manual review

Recommendations

Change it to this

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.