This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
MlumStaking::renewLockPosition
leads to lack of change in IMlumStaking::StakingPosition
which results in loss of rewards for stakers
#18
sheep
Medium
Lack of parameter in
MlumStaking::renewLockPosition
leads to lack of change inIMlumStaking::StakingPosition
which results in loss of rewards for stakersSummary
Wrong argument to a call to internal function
MlumStaking::_lockPosition
throughMlumStaking::renewLockPosition
leads to loss of rewards.Vulnerability Detail
Staker creates a position in the protocol but has the ability to renew the
IMlumStaking::StakingPosition
by using the functionMlumStaking::renewLockPosition
, this function uses an internal function_lockPositon
to renew theStakingPosition
. During the call to this internal function_lockPosition(tokenId, _stakingPositions[tokenId].lockDuration, false);
it passes the wrong second argument, in which instead of passing new lockDuration, it passes the same old lockDuration of staker. This keeps the status ofstakingPosition
the same despite renewing it. This could lead to a loss of rewards for the staker as rewards for staking positions depend on the duration for which the assets are staked in the protocol.Impact
Loss of rewards for stakers
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/MlumStaking.sol#L509-L514
Proof of Concept
Tool used
Manual Review
Recommendation
Duplicate of #138
The text was updated successfully, but these errors were encountered: