The GivingThanks contract DonationReceipt constructor incorrectly initializes the registry variable using msg.sender instead of the provided _registry parameter in its constructor. This results in the registry being set to the deployer's address rather than a valid CharityRegistry contract instance, leading to broken functionality.
The line registry = CharityRegistry(msg.sender); assigns the registry to the deployer’s address (msg.sender) instead of the _registry parameter with the actual CharityRegistry contract address.
Transactions with the registry will fail since the deployer's address does not have the CharityRegistry contract functions supplied. This leads to reverted transactions and non-functional features dependent on the registry.
Fix the initialization logic to use the actual CharityRegistry contract address from the _registry parameter.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.