Teeny Orange Otter
Medium
Inappropriate protocol fee can cause stakers unable to pay fee and claim rewards
In the function GovernanceStaker::_claimReward()
, the payout for staker is the claimable amount minus fee.
function _claimReward(DepositIdentifier _depositId, Deposit storage deposit, address _claimer)
internal
virtual
returns (uint256)
{
_checkpointGlobalReward();
_checkpointReward(deposit);
@> uint256 _reward = deposit.scaledUnclaimedRewardCheckpoint / SCALE_FACTOR;
// Intentionally reverts due to overflow if unclaimed rewards are less than fee.
@> uint256 _payout = _reward - claimFeeParameters.feeAmount;
@> if (_payout == 0) return 0;
...
In case the staker's unclaimed rewards is small enough, such that _reward <= claimFeeParameters.feeAmount
, the staker can not pay fee and claim any rewards token even though there is unclaimed rewards existed. This can be a problem when the claimFeeParameters.feeAmount
is set to be a relative high amount.
- There can be a small amount of fee/rewards can not be paid
Manual Review
Either send the small amount of rewards to user, or take it as fee