Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slowfi - Funds Can Get Stucked on BribeRewarder contract #652

Closed
sherlock-admin3 opened this issue Jul 15, 2024 · 1 comment
Closed

slowfi - Funds Can Get Stucked on BribeRewarder contract #652

sherlock-admin3 opened this issue Jul 15, 2024 · 1 comment
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A High severity issue. Reward A payout will be made for this issue

Comments

@sherlock-admin3
Copy link
Contributor

sherlock-admin3 commented Jul 15, 2024

slowfi

Medium

Funds Can Get Stucked on BribeRewarder contract

Summary

The BribeRewarder does not offer a way to recover funds that can be stuck during normal protocol operations.

Vulnerability Detail

There two main scenarios where funds can get locked inside BribeRewarder contract.

  1. If the user registers the contract through the bribe function. In this case, the user needs to send the amount that is bigger or equal than the number of periods multiplied by the amount per period. However if the previous transfer amount is bigger the excessive tokens are stuck in the contract.
  2. For the periods that no user votes or the voting power is less than the amount to distribute, the amounts per period are not distributed and stuck in the contract.

Impact

Unnecessary lock of funds on the contracts.

BribeRewarder.sol#L132C1-L134C6

  function bribe(uint256 startId, uint256 lastId, uint256 amountPerPeriod) public onlyOwner {
      _bribe(startId, lastId, amountPerPeriod);
  }

Tool used

Manual Review

Recommendation

Allow to withdraw the excessive amount of tokens or native tokens to the owner in case no rewards require to be distributed or the transfer amount was over calculated.

Duplicate of #172

@github-actions github-actions bot added duplicate Medium A Medium severity issue. labels Jul 21, 2024
@sherlock-admin4 sherlock-admin4 added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 22, 2024
@0xSmartContract 0xSmartContract added High A High severity issue. and removed Medium A Medium severity issue. labels Jul 29, 2024
@sherlock-admin2 sherlock-admin2 changed the title Sneaky Neon Mole - Funds Can Get Stucked on BribeRewarder contract slowfi - Funds Can Get Stucked on BribeRewarder contract Jul 30, 2024
@sherlock-admin2 sherlock-admin2 added the Reward A payout will be made for this issue label Jul 30, 2024
@WangSecurity
Copy link

Now a duplicate of #172, based on #164 (comment) and #164 (comment) comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A High severity issue. Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

5 participants