Root Cause: The contracts assign address values to state variables and mappings without checking if the address is the zero address (address(0)).
Impact: Assigning address(0) can lead to unexpected behavior, as it is often used as a sentinel value in Solidity to represent a null or uninitialized address. This could result in security risks, such as loss of access control or misdirected funds.
Assignments Without Zero Address Check:
In CharityRegistry:
Issue: No check to ensure charity is not address(0).
Consequence: address(0) could be registered as a charity.
In GivingThanks:
Issue: No validation of _registry.
Consequence: Setting registry to address(0) would break contract functionality.
Add Zero Address Checks:
For registerCharity:
For updateRegistry:
General Best Practice:
Before assigning any address to a state variable or mapping, check that it is not address(0) to prevent unintended behaviors.
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.