In the GivingThanks contract constructor, the registry variable is mistakenly assigned to msg.sender rather than _registry. This causes the donate function to fail, as msg.sender does not implement the necessary isVerified function expected from the CharityRegistry.
The constructor sets the registry variable to msg.sender, instead of the provided _registry address, as shown below:
Since the registry address is incorrectly set to msg.sender, any call to registry.isVerified() in the donate function will fail, as the contract instance at msg.sender does not contain the required isVerified function. This effectively breaks donation functionality and prevents interactions with registered charities.
Failure of the donate function: Without the correct registry address, the donate function cannot verify charities, leading to donation process failures.
Contract Misconfiguration: Using msg.sender instead of _registry results in improper initialization, making the contract unable to perform as designed.
Manual Review
Assign the registry variable to _registry to ensure proper configuration:
This change ensures the GivingThanks contract is correctly initialized with the intended CharityRegistry address, restoring donation functionality and allowing proper charity verification.
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.