The deposit() function directly updates on-chain storage upon receiving a deposit transaction, however the token transfer may revert before completing. This could leave storage in an invalid state.
When a user calls deposit(), storage modifications like updating the deposit cache occur immediately. But the token transfer instruction executes separately, and has the potential to revert prior to completion. If this occurs, storage would be prematurely updated, risking inconsistencies.
Reproduction Steps:
User deposits tokens by calling deposit()
Function triggers storage updates like to the deposit cache
Token transfer executes independently
Before transfer settles, it reverts
But storage was already modified out of sync
Storage inconsistencies if transfer reverts after updates
Manual Review
Defer storage changes until after validating token arrival
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.