The GivingThanks
contract has an error in its constructor where the registry
variable is assigned msg.sender
instead of _registry
which is the intended input address for the CharityRegistry
contract. This mistake results in the GivingThanks
contract referencing the deployer's address instead of the charity registry thereby blocking the donate function from validating charities resulting in breaking the main functionality of the entire project.
In the constructor of the GivingThanks
contract, the registry
variable that is intended to store the address of the CharityRegistry
contract, is mistakenly assigned msg.sender
. Since msg.sender
is the address deploying the GivingThanks
contract, the registry reference becomes invalid, preventing access to the necessary charity verification records.
This error causes the GivingThanks
contract to fail when validating charities through the donate
function, as it cannot access the actual charity verification data. Without access to the correct CharityRegistry
contract, the GivingThanks
contract cannot verify addresses as legitimate charities, rendering donations and NFT minting inoperable. This therefore blocks all the intended functionalities of the donate function and would prevent the contract from functioning as designed and intended.
Manual code inspection.
Update the GivingThanks
contract's constructor to assign the _registry
argument to the registry
variable instead of msg.sender
.
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.