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

[Bug]: Permit token amounts display different values in the Estimated Changes > Spending Cap and Message > Value #28118

Closed
sleepytanya opened this issue Oct 28, 2024 · 1 comment · Fixed by #28142
Assignees
Labels
regression-RC-12.6.0 Regression bug that was found in release candidate (RC) for release 12.6.0 release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-confirmations Push issues to confirmations team type-bug

Comments

@sleepytanya
Copy link
Contributor

sleepytanya commented Oct 28, 2024

Describe the bug

Permit token amounts display different values in the Estimated Changes > Spending Cap and Message > Value

Related - #27328

Expected behavior

  • Both values must be 3.000

Screenshots/Recordings

Screenshot 2024-10-27 at 22 17 58

Steps to reproduce

  1. Go to the test dapp
  2. Click Sign Permit
  3. Observe that values in the Estimated Changes > Spending Cap and Message > Value do not match

Error messages or log output

No response

Detection stage

During release testing

Version

12.6.0

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

@sleepytanya sleepytanya added type-bug team-confirmations Push issues to confirmations team regression-RC-12.6.0 Regression bug that was found in release candidate (RC) for release 12.6.0 labels Oct 28, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Oct 28, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Oct 28, 2024
@pnarayanaswamy
Copy link
Contributor

ToDo: Check if this is fixed in 12.7.0

@digiwand digiwand self-assigned this Oct 29, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 5, 2024
…ecimals for non-ERC20 token values (#28142)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Removes bug where fetchErc20Decimals was used in
`ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign.tsx`
info component and passed to the message dataTree to be used.
fetchErc20Decimals was incorrectly used as it cannot be assumed that the
token contract is an ERC20 standard. Fixed by calling
useGetTokenStandardAndDetails instead which will use the default 18
decimals digit if the standard is an ERC20 token with no decimals found
in the details.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28142?quickstart=1)

## **Related issues**

Fixes: #28118

## **Manual testing steps**

1. Go to test-dapp
2. Test Permit button
3. Observe both the simulation and message value display "3,000"
(contract is not an ERC20 standard so it does not apply default 18
decimals)

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="640"
src="https://private-user-images.githubusercontent.com/104780023/380556504-95ff2704-fca4-411e-b2b6-40dc6b099531.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzAxOTcyMjAsIm5iZiI6MTczMDE5NjkyMCwicGF0aCI6Ii8xMDQ3ODAwMjMvMzgwNTU2NTA0LTk1ZmYyNzA0LWZjYTQtNDExZS1iMmI2LTQwZGM2YjA5OTUzMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQxMDI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MTAyOVQxMDE1MjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wMDU4NjhhMGE0OGZhNjg4YzY0YmM3ZWRhNWFjYmUwNjFlZTY2ZDZjN2IyMDg1MjI0NGEyNTM2OTIyOGNmZjAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.MipJ95Oyanm_83vnd1FYq14ua0HgEiH_7GMt3hRDGLE">

### **After**

<img width="320"
src="https://github.com/user-attachments/assets/eea77452-3aa0-49b3-84a6-401ffb189b40">

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Nov 5, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Nov 5, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-RC-12.6.0 Regression bug that was found in release candidate (RC) for release 12.6.0 release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-confirmations Push issues to confirmations team type-bug
Projects
Archived in project
4 participants