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

Feat(StakeVault): allow users to withdraw tokens unrelated to staking #136

Open
3esmit opened this issue Sep 27, 2024 · 1 comment
Open

Comments

@3esmit
Copy link
Collaborator

3esmit commented Sep 27, 2024

Commonly happens that users send tokens wrongly to contracts.
UserVault could allow withdraw balances of tokens that were not staked.

@Pranay-Bhilare
Copy link

I would like to contribute for this issue too , and here's how I think it can be easily implemented.

  1. Function withdraw with parameters => address of the token and amount.
  2. Retrieving amount of tokens wrongly sent to contract by tokenAddress.balanceOf(address(this))
  3. if amount > retrieved balance, set amount = retreivedBalance.
  4. Transfer amount back to user
  5. And for preventing stakedToken to be withdrawned using this, a check can be added, and should be reverted if address of token is of stakedToken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants