Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: medium
Valid

Missing checks for address(0) in constructor when assigning values to address state variables

Summary

Missing checks for address(0) in function when assigning values to address state variables

Vulnerability Details

The constructor initializes an address state variable _implementation without verifying whether the provided address is non-zero (address(0)) or not.

address private immutable _implementation;
/// @notice constructor
/// @dev set implementation address
constructor(address implementation) {
_implementation = implementation;
}

Impact

If the constructor is called with address(0) as the implementation argument, it will result in _implementation being set to address(0), which may disrupt the intended functionality of the contract.

Tools Used

Manual Review

Recommendations

Add check for address(0) within the constructor function. Before assigning the provided implementation address to the _implementation state variable, verify that the implementation address is not equal to address(0).

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.