MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.08k stars 4.93k forks source link

[Bug]: Incorrect nonce when transaction is sent from non-connected active account #28274

Open hd878 opened 3 weeks ago

hd878 commented 3 weeks ago

Describe the bug

When a dapp is connected to a different account from the active account that currently been selected in Metamask, the transaction nonce of active account is used instead of connected account, making transaction fails and not broadcasts.

Expected behavior

Metamask should retrieve nonce from account which is connected to the dapp.

Screenshots/Recordings

No response

Steps to reproduce

  1. Import 2 accounts which have different transaction counts to Metamask.
  2. Connect first account to an dapp.
  3. Switch to the second account.
  4. Nonce is incorrect for transaction performed.

Error messages or log output

No response

Detection stage

In production (default)

Version

12.5, 12.5.1, 12.6

Build type

None

Browser

Brave

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

DanielTech21 commented 3 weeks ago

Hi @hd878

Thank you for informing us about this. Our team will look into this in more detail.