The function transfers the rewards to the caller. If there is not enough token balance, the function simply returns.
While this is a logic by design, this is unfair to users.
Users with a high rewardTokenAccrued will not be able to get any reward if the balance is not sufficient. But in the mean time, other users with a lower reward claim will be able to claim.
Impact
In a situation where the total rewardTokenAccrued is high enough (ie that the protocol owner need to periodically transfer tokens to allow users to claim their rewards), users with a high rewards can be grieved and not be able to claim any reward for a while
Tools Used
Manual Analysis
Recommended Mitigation Steps
Allow users to specify how much they want to claim, so that users with a lot of rewards are not penalized.
Lines of code
https://github.com/code-423n4/2023-05-venus/blob/8be784ed9752b80e6f1b8b781e2e6251748d0d7e/contracts/Rewards/RewardsDistributor.sol#L418-L421
Vulnerability details
Users can claim their rewards in
RewardDistributor.claimRewardToken()
. The reward handling part is done in_grantRewardToken()
:The function transfers the rewards to the caller. If there is not enough token balance, the function simply returns.
While this is a logic by design, this is unfair to users.
Users with a high
rewardTokenAccrued
will not be able to get any reward if the balance is not sufficient. But in the mean time, other users with a lower reward claim will be able to claim.Impact
In a situation where the total
rewardTokenAccrued
is high enough (ie that the protocol owner need to periodically transfer tokens to allow users to claim their rewards), users with a high rewards can be grieved and not be able to claim any reward for a whileTools Used
Manual Analysis
Recommended Mitigation Steps
Allow users to specify how much they want to claim, so that users with a lot of rewards are not penalized.
Assessed type
Other