It is stated in the natspec that the protocol will only accept vetted tokens such as USDC, JPYCv1, JPYCv2, USDT, DAI, etc..
The _distribute function purpose is to distribute the respective compensation amounts to the winners. When payment token used is USDC (or any other token, stablecoin that implement a blacklist like functionality), if any involved actor is blacklisted, _distribute will revert, obstructing the other winners from receiving their rewards.
There are two ways to send funds :
The organizer calls deployProxyAndDistribute or the owner calls deployProxyAndDistributeByOwner.
However, when the transfer fails, the owner/organizer will not know which address is causing the revert which will halt or block the whole process, especially if the winner's array is large.
If a winner's address is blacklisted, token transfers to that address will fail.
The process will revert, but the caller of the _distribute function will not be able to know which address is causing the revert. If the winner's address is long, the distribute process will be completely halted.
Manual review and Foundry testing.
First recommandation: Right now the only message that gets logged after the transfer has failed is : "SafeERC20: ERC20 operation did not succeed". If the owners do not wish to change the code implementation strategy, they could change this message to log more information about the address or they could add the following revert after the line https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/Distributor.sol#L147 :
This way, the caller can either remove the address, or ask the winner for a new address before creating the proxy and distributing the funds before calling the function again.
Second recommandation : Change the implementation strategy by using a pull pattern and allow each winner to withdraw their pay. However, by storing the rewards into a state variable, other proxy like related issues like storage variable clashing in the proxy contract need to be accounted for.
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.