If a user withdraws all tokens from a previous position while they have a pending stake, their pending stake will never receive any rewards, nor fees once it gets consolidated into a position.
user has an active position in LiquidationPool
user calls increasePosition to add a pending stake
user calls decreasePosition to withdraw all tokens from their position while their other stake is still pending
decreasePosition calls deletePosition which calls deleteHolder, the user is removed from the holders array
when consolidatePendingStakes gets called after 1day, the pending stake is consolidated into a position with no matching entry in the holders array
fee and reward distribution iterate over the holders array so this position will never receive anything
No known attack vector. It is simply a bug and inconvenience for the users. The user will not receive fees or rewards for their stake but they can still withdraw by calling decreasePosition or fix the position by adding more stake via increasePosition.
However, such inconsistencies in state could easily lead to vulnerabilities down the road.
Do not remove user from holders array if they have a pending stake or re-add them when the pending stake is consolidated into a position.
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.