Sparkn

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

No check for address(0) for winners in _distribute() function

Summary

No check for address(0) for winners when you are distributing the rewards.

Vulnerability Details

For the winner's address, in the function _distribute(), there is no check for address(0).

Impact

If you send the rewards to the winners with address(0), causing loss of fund.

Tools Used

Manual review

Recommendations

Just put a check in the function _distribute() for winners address to not to be address(0), like this :

for (uint256 i; i < winners.length; ) {
if (winners[i] == address(0)) revert ;
unchecked {
++i;
}
}

Support

FAQs

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