In Sparkn, sponsors presumably send whitelisted tokens to proxy contract before proxy contract deployment for rewards disburment after contest ends. This whitelisted tokens are decided in the constructor when owner deploys the ProxyFactory.sol contract:
However, there is nothing preventing sponsors from sending non-whitelisted tokens.
If unaware sponsors or anybody accidentally send tokens that are not whitelisted to proxy contract, those tokens can never be retrieved since whitelistedTokens mapping can never be adjusted. This is due to this check in Distributor._distribute():
This issue is evident in the test case testIfTokenAdressIsNotWhitelistedThenRevert() present in the unit test ProxyTest.t.sol. For example, where if sponsor sends USDT that is not whitelisted by accident, even though the tokens cannot be distributed by organizer, owner calling ProxyFactory.distributeByOwner will also revert due to the _isWhiteListed() check.
Manual Analysis
While this is a known issue, it can easily be prevented by:
Adding a onlyOwner function to send accidental funds of non-whitelisted tokens sent to proxy to STADIUM_ADDRESS. This also allows blacklist of previously whitelisted tokens in the event of emergencies
Exposing an external function for sponsors to directly call in ProxyFactory.sol to send funds to proxy contract, where in function logic, tokens sent by sponsors can be checked to ensure that the correct whitelisted tokens are being sent to proxy contract
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.