If more than one whitelisted token is supplied to proxy contract, there is no way to distribute the tokens not distributed by organizer unless conducted by owner via ProxyFactory.distributedByOwner()
after contest expiration. This is further excarbated by the fact that there is no checks stopping a proxy contract from holding more than 1 type of ERC20 token.
Hence, this can result in a delay of reward disbursement after contest ends and additional charge of 5% comission fees since another distribution is required to be performed by the owner to disburse rewards.
Add the following test in ProxyFactortTest.t.sol
and run forge test --match-test testDoubleSponsorTokens
Following is the description of PoC:
Owner sets contest
Sponsor sends two tokens (in this case, JPYCV1 and JPYCV2 ) to proxy contract
Setup calldata for deployment and distribution
Warp to contest completion (deadline set as 8 days, so we warp forward 9 days)
Organizer successfully distribute rewards to winners, with token set as JPYCV1
Organizer wants to distribute rewards to winners with token set as JPYCV2
, but fails and reverts as proxy is already deployed
Warp to contest expiration
Owner can then rescue funds, but winner rewards are delayed by 1 week
Manual Analysis, Foundry
Some recommendations:
Either add clear comments in code to prevent sponsor from sending multiple tokens
Or allow distribution of more than one tokens by organizer after contest completion.
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.