In the GivingThanks smart contract, there is an issue in the constructor where the registry variable, intended to store the address of the CharityRegistry contract, is incorrectly assigned. Instead of using the _registry parameter passed during deployment, the contract mistakenly assigns msg.sender to the registry variable. This results in the contract deployer's address being cast as the CharityRegistry contract.
Incorrect Registry Assignment: The contract will treat the deployer's address as the CharityRegistry, which is not the intended behavior. This can cause all functions dependent on the registry variable to fail or produce incorrect results.
Potential Security Risks: Since the deployer's address is treated as the registry, the contract could behave unpredictably, especially if the deployer is not a legitimate charity registry contract.
manula review
the constructor should assign the _registry parameter to the registry variable.
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.