The GivingThanks constructor incorrectly assigns msg.sender as the registry address instead of using the provided _registry parameter.
In GivingThanks.sol, the constructor is improperly initializing the registry address:
The issue is that the constructor is setting msg.sender as a CharityRegistry contract instead of using the intended _registry parameter. This means the contract will try to interact with the deployer's address as if it were a CharityRegistry contract.
On deployment, the contract will be permanently linked to an incorrect registry address, in this case, the deployer's address, instead of the intended charity registry contract. Any calls to verify charities or process donations will fail as the deployer's address cannot respond to the required registry function calls. This makes the contract unusable from the moment of deployment unless the registry is updated through a separate transaction.
Manual Review
Remix IDE
Correct the constructor to use the provided registry parameter and add proper validation:
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.