Sparkn

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

Missing zero check

Summary

Missing zero check

Vulnerability Details

In the provided code, the constructor accepts an 'implementation' address parameter but does not verify if this address is a non-zero address.

Impact

This could potentially allow the contract to be initialized with a zero address for the 'implementation' variable, which would render the contract useless as any calls to it would fail. This could lead to loss of funds or other unexpected behavior. It is recommended to add a require statement to check that the 'implementation' address is not a zero address.

Tools Used

Audit Wizard:)

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 0");
_implementation = implementation;
}

This will throw an error and revert the transaction if the 'implementation' address is a zero address, preventing the contract from being deployed with an invalid state.

Support

FAQs

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