Distribution contract owner can ruin rewards for some users while managing users in private pools
Contract owner can call manageUsersInPrivatePool()
to manage users accounts in private pools:
Take a look on the last lines where code should choose to stake or withdraw assets for the user. If the ammount is higher than deposited one, it forwards a call to stake
, in other case - to withdraw
.
So it is not possible to add an amount (make a deposit for users) if amount is less than deposited.
Imagine the sitaution when user ask to deposit 500 tokens for him (and he has 1000 deposited token already). In that case contract owner will withdraw assets despite on a user wish. A user will also loose his rewards for a full amount.
Users can be forced to withdraw assets by contract owner and loose some rewards
Manual review.
Not sure about the right purpose of that functions, but I guess it's better to add a flag for managing assets flow for contract owner. It can be a bool value deposit / withdraw
to make it more easy to navigae inside manageUsersInPrivatePool
.
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.