In the GivingThanks contract, the constructor incorrectly assigns msg.sender to initialize the CharityRegistry instance, rather than using the intended _registry address passed as a parameter. This approach assigns the deployer’s address to the registry variable, which does not correspond to the actual CharityRegistry contract deployed address.
This misassignment results in the registry variable pointing to an incorrect address, causing any function calls or interactions with registry to revert, as the assigned address is not a valid instance of CharityRegistry. Consequently, functionalities reliant on CharityRegistry methods, data or contract interactions are rendered unusable, disrupting the intended operation of the contract.
Replace msg.sender with _registry in the constructor to correctly assign the CharityRegistry address provided by 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.