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]: error "BigNumber shift integer NaN" in simulation details #24690

Open
dbrans opened this issue May 21, 2024 · 0 comments
Open

[Bug]: error "BigNumber shift integer NaN" in simulation details #24690

dbrans opened this issue May 21, 2024 · 0 comments
Labels
regression-prod-11.16.0 Regression bug that was found in production in release 11.16.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-transactions Transactions team type-bug

Comments

@dbrans
Copy link
Contributor

dbrans commented May 21, 2024

Describe the bug

image

Bug_uniswap.mov

Expected behavior

No response

Screenshots/Recordings

No response

Steps to reproduce

  1. Go to uniswap
  2. Choose mainnet or sepolia (doesn't matter)
  3. Swap 0.01 ETH for WETH

Error messages or log output

No response

Version

11.16.0

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

Analysis:

When extension is first installed or reloaded, fetchAllErc20Decimals appears to return {pending: false, value: {}} even if there are in fact erc20 tokens. When we Because of the difficulty to reproduce as well as the timing of opening the debugger, this has been hard to catch in the act on a breakpoint.

Severity

No response

@metamaskbot metamaskbot added the regression-prod-11.16.0 Regression bug that was found in production in release 11.16.0 label May 21, 2024
dbrans added a commit that referenced this issue May 21, 2024
<!--
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**
Stopgap for #24690

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

## **Related issues**

Related: #24690
– do not close this.

## **Manual testing steps**

1. Try to reproduce
#24690

## **Screenshots/Recordings**

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

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask 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.
dbrans added a commit that referenced this issue May 22, 2024
<!--
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.
-->

Stopgap for #24690

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

Related: #24690
– do not close this.

1. Try to reproduce
#24690

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

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [ ] I’ve followed [MetaMask 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.

- [ ] 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.
danjm pushed a commit that referenced this issue May 22, 2024
…11.16.0 (#24700)

Cherry-pick fix stopgap for BigNumber shift NaN issue
4233f9e (#24691) into v11.16.0.

There was a merge conflict – I rejected `HEAD` and accepted
`4233f9ed06`.
```typescript
    const decimals =
<<<<<<< HEAD
      asset.standard === TokenStandard.ERC20 ? erc20Decimals[asset.address] : 0;
=======
      // TODO(dbrans): stopgap for #24690
      asset.standard === TokenStandard.ERC20
        ? erc20Decimals[asset.address] ?? ERC20_DEFAULT_DECIMALS
        : 0;
>>>>>>> 4233f9e (fix: stopgap for BigNumber shift NaN issue (#24691))
    const amount = getAssetAmount(tokenBc, decimals);
```
@gauthierpetetin gauthierpetetin added team-transactions Transactions team Sev2-normal Normal severity; minor loss of service or inconvenience. labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-11.16.0 Regression bug that was found in production in release 11.16.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-transactions Transactions team type-bug
Projects
Status: To be fixed
Status: To be fixed
Development

No branches or pull requests

3 participants