This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
0xVolodya - reward tokens will be stuck in staking contract #18
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0xVolodya
medium
reward tokens will be stuck in staking contract
Summary
Some amount of tokens will be stuck in a staking contract after users burn their positions. POC below
Vulnerability Detail
The
_getRewardBalances
function calculations are off. The problem arises after two consecutive mints, on the third interaction with a stakingmodule. An amount of rewards equal to the pending rewards at the second interaction are then claimed but not added to the reward balances.AbstractStakingAM.sol#L529
Impact
Code Snippet
Tool used
POC
Manual Review
Recommendation
Either create a function so the owner can sweep the rest of the tokens, or change formula so there will be no left tokens left, or give all the rest reward tokens to the last staker.
Duplicate of #38
The text was updated successfully, but these errors were encountered: