Sparkn

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

Tokens can't removed and new tokens can't be added to whitelist

Summary

Tokens can not be removed and new tokens can not be added.

Vulnerability Details

Whitelisted tokens are added in the constructor. If invalid token is added to the whitelistedTokens mapping, it can not be removed. Also if some of the tokens that should be whitelisted is missed by mistake, it can not be added to the mapping after contract deployment.

Impact

Invalid tokens added to the whitelistedTokens mapping and valid tokens that should be in the mapping will not be whitelisted.

Tools Used

Manual Review

Recommendations

Add functions for removing and adding tokens with onlyOwner modifier. For example:

function unwhitelistToken(address token) external onlyOwner {
whitelistedTokens[token] = false;
}
function whitelistToken(address token) external onlyOwner {
whitelistedTokens[token] = true;
}

Support

FAQs

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