Sparkn

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

whitelisted token can be an eoa or a non-erc20 contract

Summary

whitelisted token can be an eoa or a non-erc20 contract resulting in either tx failure on distribute

Vulnerability Details

There is no check that the whitelisted address is a contract and complies to erc20 standard

Impact

transaction failures when distributing funds due to an invalid whitelisted token

Tools Used

manual review

Recommendations

Add a code size check & check if the total supply > 0

uint size;
assembly {
size := extcodesize(_whitelistedTokens[i])
}
if (size == 0) revert();

&

if (IERC20(_whitelistedTokens[i]).totalSupply == 0) revert();

Support

FAQs

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