Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Ch_301 - Users are not able to withdraw their funds from LMPVault #385

Closed
sherlock-admin2 opened this issue Aug 29, 2023 · 0 comments
Closed
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

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Aug 29, 2023

Ch_301

medium

Users are not able to withdraw their funds from LMPVault

Summary

Users need to stake their TOKE rewards in GPToke.sol.
However, GPToke.sol has a MIN_STAKE_AMOUNT which is a constant

uint256 public constant MIN_STAKE_AMOUNT = 10_000;

so users should earn at least 10_000 to avoid this revert

Vulnerability Detail

This will happen when the user withdraws his funds from the LMPVault
But if this Vault has a hard time with no reward or just dust, for a period of time. Also the claimsVaultRewards() wouldn't be called when there is only say $50 worth of rewards to collect, gas would eat all the profits. Same with liquidateVaultsForToken. So the reward will be too small

The MainRewarder.sol will be forced by GPToke.sol to revert with StakingAmountInsufficient() error.

Impact

  • The user is not able to withdraw his funds. They are locked until the reward of the user reaches the MIN_STAKE_AMOUNT

Code Snippet

Tool used

Manual Review

Recommendation

in AbstractRewarder._getReward() add check if the TOKE reward is small than MIN_STAKE_AMOUNT skip the stake action

Duplicate of #565

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Sep 11, 2023
@sherlock-admin sherlock-admin changed the title Formal Magenta Okapi - Users are not able to withdraw their funds from LMPVault Ch_301 - Users are not able to withdraw their funds from LMPVault Oct 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants