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

[Beta] ERC20 approve() -- UI makes it look like tokens are being sent #3423

Closed
trakout opened this issue Mar 3, 2018 · 10 comments
Closed

[Beta] ERC20 approve() -- UI makes it look like tokens are being sent #3423

trakout opened this issue Mar 3, 2018 · 10 comments
Assignees
Labels
area-UI Relating to the user interface. type-bug type-enhancement
Milestone

Comments

@trakout
Copy link

trakout commented Mar 3, 2018

When using approve() the full amount being approved is displayed (makes sense probably), but there is no indicator showing the fact that tokens are not yet being transferred (as opposed to approved for transfer).

Also in use-cases where an 'unlimited' approve is used (eg. RadarRelay), the max uint is displayed as an amount that runs off the edge of the viewport. This, coupled with the fact that there is no indication that this is technically not a transfer may be alarming to users.

Also related, users can use approve() without owning any amount of a token. Therefore the transaction will be successful even though the UI displays 'Insufficient tokens'.

Screenshots below. Used Chrome Nightly on Mac OS.

screen shot 2018-03-03 at 6 45 19 pm

screen shot 2018-03-03 at 6 53 00 pm

screen shot 2018-03-03 at 6 53 09 pm

@2-am-zzz 2-am-zzz added type-bug P1-asap area-UI Relating to the user interface. labels Mar 6, 2018
@2-am-zzz
Copy link
Contributor

2-am-zzz commented Mar 6, 2018

@danjm @alextsg

@danjm
Copy link
Contributor

danjm commented Mar 6, 2018

@trakout Some questions and responses (mostly for me to ensure I understand you correctly):
(1) I assume you are calling approve() from some other dapp, correct?
(2) You are proposing that we alter the words and visual indicators when a token contract approve() method is called? (For example, perhaps "Authorize" would be a better header than "Confirm" and "Please review your approval" a better subheader and maybe instead of an arrow between the two identicons, a https://fontawesome.com/icons/handshake?style=solid... this will actually go to our designer @cjeria first, but I am just giving you some examples to ensure I understand you correctly)
(3) Yes, we need to fix the amount running off the page. Thanks for notifying us of that.
(4) Did you get to your second screen shot by calling approve() and then clicking "Edit" on the screen with the "Confirm" header?
(5) Assuming your answer to for is yes, you are proposing that in the case of approve() calls, we should not display and insufficient amount error or disable the "Next" button on the basis of the users current token balance?

Thanks a lot for reporting this.

@danjm danjm self-assigned this Mar 6, 2018
@trakout
Copy link
Author

trakout commented Mar 6, 2018

Hey @danjm! Sure:

  1. Correct, calling approve() directly from a dapp.
  2. Yes, this is a good example -- I think it's pretty much in line with the idea behind approve().
  3. 👍
  4. Yes, this is the edit screen you can get to off the Confirmation screen that pops up after attempting approve().
  5. I think that's correct -- overall I think it's a good idea to suppress the amount field validation for approve(). There's cases where approval will be attempted for amounts of tokens a user does not have, or even will ever have (eg. larger than a token's totalSupply). There's ongoing discussion on this here (EIP 717).

Thanks!

@danjm
Copy link
Contributor

danjm commented Mar 6, 2018

@trakout Thanks for your replies. Fixing the display of large amounts will likely be resolved this week. Better support for approve() (to address the other issues raised here) will be done in our next sprint, which starts next week.

Thanks again for reporting this.

@cjeria
Copy link
Contributor

cjeria commented Mar 7, 2018

@danjm I think we should create a new issue for the design of the 'approve()' screen. This should be part of a more strategic move towards designing call specific transaction screens.

@2-am-zzz 2-am-zzz added this to the March 27 Sprint milestone Mar 12, 2018
@danjm danjm removed this from the March 27 Sprint milestone Mar 12, 2018
@danfinlay danfinlay added this to the Sprint 05 milestone Apr 26, 2018
@danfinlay
Copy link
Contributor

We should only show the token transfer approval screen when the data field starts with 0xa9059cbb, which is the 4-byte signature of the transfer method.

@danfinlay
Copy link
Contributor

I think we should create a new issue for the design of the 'approve()' screen.

This is beyond the scope of this issue, I'd rather we address other confirmation types as other issues, and ideally in a generic way when possible (like our rendering of contract method metadata).

@danjm danjm removed the needs-design Needs design support. label Jun 4, 2018
@danjm
Copy link
Contributor

danjm commented Jun 4, 2018

Design being handled in MetaMask/Design#18

@danjm
Copy link
Contributor

danjm commented Jun 5, 2018

Closing in favour of MetaMask/Design#18 and #4505

@danjm danjm closed this as completed Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-UI Relating to the user interface. type-bug type-enhancement
Projects
None yet
Development

No branches or pull requests

6 participants
@danfinlay @cjeria @trakout @2-am-zzz @danjm and others