Long Rouge Jay - When the deposit owner claims it, the reward is sent to the deposit owner instead of the designated deposit claimer. #73
Labels
Won't Fix
The sponsor confirmed this issue will not be fixed
Long Rouge Jay
Medium
When the deposit owner claims it, the reward is sent to the deposit owner instead of the designated deposit claimer.
Summary
When the deposit owner calls
claimReward
, the reward is sent to the deposit owner instead of the designated deposit claimer, which is not as expected and causes the deposit claimer to lose of rewards.Vulnerability Detail
According to the
deposit
function, when a user stakes tokens into a new deposit, he can designates a_claimer
address that will accrue rewards for the stake. As indicated inGovernanceStaker.sol:L344
, the rewards for the deposit should be sent to the claimer.https://github.com/sherlock-audit/2024-11-tally/blob/main/staker/src/GovernanceStaker.sol#L325-L338
According to the
claimReward
function, to claim the rewards, the caller needs to be either the deposit claimer or the deposit owner. Following the authorization check, the_claimReward
function will be invoked to calculate the accumulated rewards and send them to themsg.sender
(GovernanceStaker.sol:L412
). If it is called by the deposit owner, thenmsg.sender
will be the deposit owner.https://github.com/sherlock-audit/2024-11-tally/blob/main/staker/src/GovernanceStaker.sol#L407-L413
Therefore, if the deposit owner claims the rewards, the rewards will be sent to the deposit owner instead of the deposit claimer, which is inconsistent with the description of the
stake
function, and causes the deposit claimer to lose of rewards.Impact
When deposit owner claims the rewards, the rewards will be sent to the deposit owner instead of the deposit claimer, which is inconsistent with the role of the deposit claimer, and causes the deposit claimer to lose of rewards.
Code Snippet
https://github.com/sherlock-audit/2024-11-tally/blob/main/staker/src/GovernanceStaker.sol#L412
Tool used
Manual Review
Recommendation
The text was updated successfully, but these errors were encountered: