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

Fix staking contract - unstake function #391

Closed
portuu3 opened this issue Apr 17, 2023 · 0 comments
Closed

Fix staking contract - unstake function #391

portuu3 opened this issue Apr 17, 2023 · 0 comments
Assignees
Labels
bug Something isn't working Contracts Staking

Comments

@portuu3
Copy link
Collaborator

portuu3 commented Apr 17, 2023

Description
Remove first require require(staker.tokensStaked > 0, 'Must be a positive number');, it is unnecessary since tokensStaked>0 will already be validated with this require

require(
            staker.tokensAvailable() >= _tokens,
            'Insufficient amount to unstake'
        );

Motivation
Fix error in the contract

Implementation details
Remove require

@portuu3 portuu3 added bug Something isn't working Contracts Staking labels Apr 17, 2023
@portuu3 portuu3 added this to the Staking dashboard milestone Apr 17, 2023
@leric7 leric7 self-assigned this Apr 17, 2023
@leric7 leric7 closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Contracts Staking
Projects
None yet
Development

No branches or pull requests

2 participants