The GivingThanks
contract constructor incorrectly initializes the registry
variable by casting msg.sender
(the deploying address) as a CharityRegistry
contract. This results in an incorrect reference to the intended CharityRegistry
contract and causes the donate
function to fail when it attempts to call registry.isVerified(charity)
, as the cast address does not implement the required CharityRegistry
functions.
Line 16
in the GivingThanks.sol
contract
This bug prevents the donate
function from working, effectively breaking the primary functionality of the contract. Without this fix, users cannot make verified donations through the contract.
Manual code review
replace msg.sender
with the constructor param _registry
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.