Sparkn

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

Lack of zero address check distributing funds

Summary

It's not checked if winners' addresses are zero address

Vulnerability Details

It's possible to send tokens to zero address

Impact

Loss of funds

Tools Used

Manual review

Recommendations

for (uint256 i; i < winnersLength;) {
if (winners[i] == address(0)) revert Distributor__NoZeroAddress(); // Add this line, you might want to cache winners[i]
uint256 amount = totalAmount * percentages[i] / BASIS_POINTS;
erc20.safeTransfer(winners[i], amount);
unchecked {
++i;
}
}

Support

FAQs

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