When a user calls deposit() multiple times, each call overwrites the stakedAsset value instead of accumulating it, causing permanent loss of previously deposited funds.
Normal behavior expects that if a user deposits 100 tokens and then deposits 50 more tokens, their total staked amount should be 150 tokens tracked in stakedAsset[user].
The current implementation uses direct assignment (=) instead of accumulation (+=), so the second deposit overwrites the first deposit amount. The user loses access to their initial deposit while shares are correctly accumulated.
Likelihood:
Users depositing in multiple transactions to manage their investment gradually will trigger this bug
No on-chain validation prevents multiple deposits from the same user
Common user behavior in DeFi to dollar-cost-average or add to positions over time
Impact:
Direct permanent loss of funds for users making multiple deposits
stakedAsset[user] tracking becomes incorrect, affecting refund calculations in cancelParticipation()
Users who deposit 1000 tokens in two 500-token transactions only have 500 tokens recorded
If they cancel participation, they only receive refund for the last deposit (500 tokens), losing 500 tokens permanently
Breaks user trust and creates unpredictable behavior
Lost tokens remain locked in contract with no recovery mechanism
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.