The donate
function in the GivingThanks
contract sends Ether to the specified charity
address without any checks to confirm that the address corresponds to the intended recipient. While registry.isVerified
confirms the address is listed as verified, there is no mechanism to ensure that the donor (msg.sender
) intended to send funds specifically to the charity
address provided, leading to the risk of accidental or unintended transfers.
When donate
is called, the contract verifies that the charity
address is valid and registered. However, there is no check to confirm the donor’s intent regarding the specific charity
address, leaving room for errors if the donor accidentally inputs the wrong address or is subject to a phishing attack. Since the function directly executes the transfer with (bool sent,) = charity.call{value: msg.value}("");
, this lack of additional validation can lead to unintended fund misdirection.
Without confirming the donor’s intent to send funds to the specific address, donors may accidentally transfer funds to unintended recipients, resulting in permanent loss of donations and decreasing trust in the security and reliability of the contract.
Manual Code Review
Foundry
Consider introducing checks fo
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.