Lucene search

K
code423n4Code4renaCODE423N4:2021-10-COVALENT-FINDINGS-ISSUES-65
HistoryOct 21, 2021 - 12:00 a.m.

Validator can fail to receive commission reward in redeemAllRewards

2021-10-2100:00:00
Code4rena
github.com
5

Handle

jonah1005

Vulnerability details

Impact

Validator can fail to receive commission reward by calling redeemAllRewards.
There’s a check in redeemAllRewards

        uint128 rewards = sharesToTokens(s.shares, v.exchangeRate) - s.staked;
        require(rewards > 0, "Nothing to redeem");

The validator’s tx might be reverted here even if he got some commission reward to receive.

Proof of Concept

DelegatedStaking.sol#L275-L276
We can trigger the bug by setting commisionRate to 1e18 - 1

Tools Used

None

Recommended Mitigation Steps

Though this may rarely happen and the validator can redeem the reward through redeemRewards, this may cause some issues when the validator is handled by a contract.

I consider calling redeemRewards in redeemAllReawards as a more succinct way to do this.


The text was updated successfully, but these errors were encountered:

All reactions