You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Description:
The stake function implements a minimumStake check to prevent anyone from filling the stakingQueue with small amounts. However, the issue arises when users who are already in the stakingQueue want to add a new amount that is lower than minimumStake. This check unnecessarily restricts existing users from staking additional smaller amounts.
Impact:
Users who are already in the stakingQueue cannot add new amounts if the new amount is lower than minimumStake.
Mitigation:
Modify the stake function to apply the minimumStake check only when the user is not already in the stakingQueue.
Proposed Change:
- if (amount < minimumStake) {- revert Module__LM_PC_KPIRewarder_v1__InvalidStakeAmount();- }
address sender = _msgSender();
if (stakingQueueAmounts[sender] == 0) {
+ if (amount < minimumStake) {+ revert Module__LM_PC_KPIRewarder_v1__InvalidStakeAmount();+ }
This change ensures that the minimumStake check is only applied when the user is not already in the stakingQueue, allowing existing users to add smaller amounts without restriction.
The text was updated successfully, but these errors were encountered:
Github username: @0xmahdirostami
Twitter username: 0xmahdirostami
Submission hash (on-chain): 0x6527a4a1918635e5e5bc8e452b168130541067cc339a7d72bd0abeb48174c691
Severity: low
Description:
Description:
The
stake
function implements aminimumStake
check to prevent anyone from filling thestakingQueue
with small amounts. However, the issue arises when users who are already in thestakingQueue
want to add a new amount that is lower thanminimumStake
. This check unnecessarily restricts existing users from staking additional smaller amounts.Impact:
Users who are already in the
stakingQueue
cannot add new amounts if the new amount is lower thanminimumStake
.Mitigation:
Modify the
stake
function to apply theminimumStake
check only when the user is not already in thestakingQueue
.Proposed Change:
This change ensures that the
minimumStake
check is only applied when the user is not already in thestakingQueue
, allowing existing users to add smaller amounts without restriction.The text was updated successfully, but these errors were encountered: