Lack of whitelisted token removal function can cause protocol issues
ProxyFactory
sets the whitelisted token list in its constructor and does not allow any further changes to this.
This presents an issue if any token ever is needed to be removed or any token was wrongly added to the factory.
There are known cases where top tokens can fall and die, example LUNA. Also, recent black swan events even lead to a slight depeg in USDC with no guarantee that no future black swan may not severely depege it.
Further, there is the possibility that deployer mistakenly added the wrong token value, which is actually the case in the current project if we examine deployment scripts:
DeployContracts.
gets the whitelisted tokens from the HelperConfig helper
which, for Polygon, where sponsor confirmed (in discord) that the project will most likely be deployed, has an invalid address:
the address for jpyc v1 on polygon
is set to 0x2370f9d504c7a6E775bf6E14B3F12846b594cD53
which is an EOA on Polygon. JPY Coin (JPYC) V1 address on Ethereum, 0x2370f9d504c7a6E775bf6E14B3F12846b594cD53
is the actual contract.
Deployment scripts are OOS, the above elaboration was to show that not only deployment mistake can happen, with current configuration it will happen and protocol should be make resilient to such issues.
Malicious, old, wrongly added or dead whitelisted tokens will cause protocol to potentially misbehave.
Manual review.
Allow the setting of whitelisted tokens, via a setter, by the contract owner.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.