In the deposit() function:
stakedAsset[receiver] = stakeAsset; sets stakeAsset to the user
But unfortunately when a user deposits more then once before the event starts, the previous deposit gets overwritten.
Likelihood:
it will happen every single time any user makes more than one deposit
if multiple users make multiple deposits, they all loose their initial funds. only the last one gets accounted for.
Impact:
Users could lose refund value if they cancel participation (refund uses stakedAsset).
Accounting errors break _getWinnerShares() and withdraw() fairness.
Allows malicious users to manipulate share-to-asset ratio before event start
1. alice deposits 5 tokens — stakedAsset[user] = 5.
2. alice deposits again with 5 tokens — now stakedAsset[user] = 10, but total shares = 300 worth.
3. If user calls cancelParticipation(), they only get 5 refunded instead of 10.
Accumulate instead of overwrite.
Vault tracks only a single deposit slot per user and overwrites it on every call instead of accumulating the total.
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.