Sparkn

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

There is no check for address(0) for winners when distributing the rewards

Summary

There is no check for address(0) for winners when 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), it causes a loss of funds.

Tools Used

Manual review

Recommendations

Put a check in the function _distribute() for the winner's address to not be addressed (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.