Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of a zero address check in `ThePredicter::setThePredicter`

Summary

The function ThePredicter::setThePredicter that sets the predicter, lacks a check for 0 address inputs.

Vulnerability Details

The zero address commonly represents an uninitialized or invalid address in Ethereum.

function setThePredicter(address _thePredicter) public onlyOwner {
thePredicter = _thePredicter;
}

Impact

Allowing the setting of a zero address as the predictor would effectively render any interactions with the predictor address impossible, leading to a loss of functionality within the contract.

Tools Used

Manual review

Recommendations

Consider adding a 'require' statement to check that the address is different from address(0). Here is the recommended modification:

function setThePredicter(address _thePredicter) public onlyOwner {
+ require(_thePredicter != address(0), "Zero address cannot be set as the predictor.");
thePredicter = _thePredicter;
}
Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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