Missing checks for address(0)
when assigning values to address state variables
Lack of zero-address validation on address parameters may lead to transaction reverts, waste gas,
require resubmission of transactions and may even force contract redeployments in certain cases within the protocol.
This check is considered important as:
Nobody owns this address, either externally-owned account (EOA) or by any contract.
Because the value 0 is the default uninitialized value, it can be aeasily passed to the functions by mistake
Because the value 0 is the default uninitialized value, address(0) might often be used to check if an address has been initialized or not
Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Lender.sol
Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/utils/Ownable.sol
Code Review
Add checks for address(0)
when assigning values to address state variables
NeoCrao
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.