MetaMask / MetaMask/metamask-extension

[swaps] ERC20 custom approvals not human readable

Open
#12,703 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ux-enhancement ux-papercuts
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

Describe the bug
Approvals in swaps are in scientific notation instead of decimal format.

Steps to reproduce (REQUIRED)
Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:

  1. Perform a swap, and edit the spend allowance for a token (the approve method)
  2. Try changing the allowance

Expected behavior
A clear description of what you expected to happen.
The output for the user should not be in scientific notation, instead it should be represented in a similar fashion that the token is represented in the assets tab.

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2021-11-15 at 01 52 56

Browser details (please complete the following information):

  • OS: [e.g. OS X, Windows] OS X
  • Browser: [e.g. Chrome Version 79.0.3945.79 (Official Build) (64-bit), Firefox Browser 71.0 (64-bit)] Firefox
  • MetaMask Version: [e.g. 5.0.2 - find it in Settings > About] 10.5.1

Edit 1: updated bug description & removed additional information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the swaps flow: perform a swap, edit the token spend allowance through the approve method, and change the allowance. Trace the UI entry point for editing approvals and compare its formatting with the token display in the assets tab. Done means the allowance is shown in decimal format rather than scientific notation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.