Sparkn

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

After deploy **ProxyFactory** contract, the `whitelistedTokens` mapping can't be modified

Summary

The contract ProxyFactory have a mapping of tokens supported by the protocol
In this mapping, the tokens state cannot be change

Vulnerability Details

The contract ProxyFactory can't integrate/remove tokens this limits the contract to only use the tokens allowed in the constructor and it does not allow to disable tokens that do not want to use anymore for some reason(broken stable token like LUNA)

Impact

The protocol can't integrate/remove tokens

Recommendations

Add a onlyOwner function to permit change the state of the token inside the mapping:

event SetTokenWhitelistState(address indexed _whitelistedToken, bool _state);
function setTokenWhitelistState(address _whitelistedToken, bool _state) external onlyOwner {
whitelistedTokens[_whitelistedToken] = _state;
emit SetTokenWhitelistState(_whitelistedToken, _state);
}

Keep in mind that if a token is removed, it could have proxies with tokens and they will be locked in the contract. Only the owner of the contract ProxyFactory will be able to add the token, distribute them and remove the token

Support

FAQs

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