The deposit function overwrites the stakedAsset[receiver] value instead of accumulating it when the same user makes multiple deposits. This causes loss of previously deposited assets and corrupts the internal accounting system.
Likelihood:
Users may naturally make multiple deposits over time as they acquire more funds
The contract doesn't prevent multiple deposits from the same address
The overwrite behavior is not immediately apparent to users
This violates the principle of least surprise in financial applications
Impact:
Permanent loss of funds - previous deposits are overwritten and become unrecoverable
Broken accounting - internal state becomes inconsistent with actual token balances
Unfair reward distribution - users making multiple deposits get incorrect share allocations
Contract becomes unusable - the fundamental accounting mechanism is corrupted
verify that user1's stakedAsset balance should be 2 ether minus 2*fee after making two deposits
This simple change from assignment (=) to accumulation (+=) ensures that multiple deposits from the same address are properly recorded and accounted for, maintaining consistency between the asset tracking and share minting mechanisms.
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.