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

[Staking App] Button to stake is activated despite needing ERC20 Approval first #152

Open
dimsome opened this issue May 20, 2022 · 1 comment
Labels
bug Something isn't working frontend Frontend Team work p3-comp Bugs that give some unexpected results but nothing significant is at stake ui UI work

Comments

@dimsome
Copy link
Contributor

dimsome commented May 20, 2022

Describe the bug
The button "Stake" is clickable despite needing ERC-20 Approval first.

Screen Shot 2022-05-20 at 12 20 03

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://staking.mstable.app/#/stake
  2. Click on staking MTA or mBPT
  3. Enter the amount in stake App
  4. Lock appears, and is enabled, but "Stake" button is also clickable

Expected behavior
Throwing the error is expected if there is a missing approval. However, the Stake button should not be activated until such approval has gone through.
This results in users missing the approval button.

  1. Simple solution: deactivate the button until the approval is done. Replace text with "Allow the Staking contract to use your MTA" or "Allow the Staking contract to use your mBPT"
  2. Probably better solution: Add button above staking to create tx for approval.

See Uniswap example:
Screen Shot 2022-05-20 at 12 19 40

Screenshots

Trying to send transactions without approval throws an error.
Screen Shot 2022-05-20 at 12 13 43

@dimsome dimsome added bug Something isn't working ui UI work p3-comp Bugs that give some unexpected results but nothing significant is at stake labels May 20, 2022
@dimsome
Copy link
Contributor Author

dimsome commented May 23, 2022

Non-consistent behaviour throughout the app, in another place e.g. Swap it's handled like this.
We should consolidate the behaviour and make it consistent
Screen Recording 2022-05-23 at 12 00 55
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Frontend Team work p3-comp Bugs that give some unexpected results but nothing significant is at stake ui UI work
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants