Sparkn

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

Missing zero-address check

Vulnerability Details

The vulnerability titled "Missing zero-check address" refers to the lack of validation for the 'implementation' address in the constructor of the Proxy contract. In the provided code, the constructor accepts an 'implementation' address parameter but does not check if this address is a zero address (0x0). If a zero address is passed, it could lead to unexpected behavior or failures when the fallback function is invoked, as it attempts to delegate calls to this address. This could potentially lead to loss of funds or other critical issues. It is recommended to add a require statement to check that the 'implementation' address is not a zero address.

Impact

Low

Recommendations

To resolve this issue, you should add a require statement in the constructor to ensure that the 'implementation' address is not a zero address. Here is the updated constructor:

constructor(address implementation) {
require(implementation != address(0), "Implementation address cannot be 0x0");
_implementation = implementation;
}

This will throw an error and revert the transaction if a zero address is passed as the 'implementation' address, preventing any potential issues down the line.

Support

FAQs

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