Sparkn

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

Prize distribution can be wrongly calculated

Summary

Data given in different functions of ProxyContracts for distribution of prices is not validated properly.

Vulnerability Details

_distribute.ProxyContract did not get validation when passed in _distribute function,Prize distribution without any data will not be possible and the prizes can get lost due to unchecked data length.

_distribute(proxy, data);

https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L136
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L165
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L191
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L217

Impact

Tools Used

Manual Review

Recommendations

add a check for data.length > 0

Support

FAQs

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