Sparkn

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

There is no check for 0 address when calling distribute function

Summary

If address 0 is included in the winners list, the tokens will be lost

Vulnerability Details

Not checking for 0 address among the winners may result in loss of tokens when trying to distribute prizes among the winners, if such a winner appears in the list

Impact

Loss of tokens

Tools Used

manual

Recommendations

for (uint256 i; i < winnersLength;) {
uint256 amount = totalAmount * percentages[i] / BASIS_POINTS;
require(winners[i] != 0); // ADD
erc20.safeTransfer(winners[i], amount);
unchecked {
++i;
}

Support

FAQs

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