MetaMask / metamask-extension

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

[Bug]: This method only supports 0x-prefixed hex strings #24728

Open 0f0crypto opened 3 months ago

0f0crypto commented 3 months ago

Describe the bug

When trying to initialize a freshly deployed USD Coin token (FlashTokenV2_1) from circle.com (e.g. via Remix) the latest version of Metamask 11.15.5 throws the "This method only supports 0x-prefixed hex strings but input was:" error. Reverting back to an older version, e.g. v11.13.3 resolves the issue, i.e. changes made since v11.13.3 have (re)introduced the issue/bug

Expected behavior

The initialize transaction should be correctly processed

Screenshots/Recordings

No response

Steps to reproduce

  1. Grab the USDC smart contract code (e.g. from ethereum at https://etherscan.io/address/0x43506849d7c04f9138d1a2050bbf3a0c054402dd#code)
  2. (re)deploy the smart contract (e.g. via Remix) to, for example, Sepolia - compile using the solidity v0.6.12 compiler (with 10,000,000 optimizations)
  3. try to initialize with the following values;
    • USD Coin
    • USDC
    • USD
    • 6 and any wallet addresses for the remaining params
  4. Metamask throws the error (see the log output below)

Error messages or log output

Message: This method only supports 0x-prefixed hex strings but input was: 0xusd coin

Code: Error

Stack:
Error: This method only supports 0x-prefixed hex strings but input was: 0xusd coin
  at r.assertIsHexString (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-3.js:21:21821)
  at r.toChecksumAddress (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-3.js:21:9005)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-2.js:1:214645
  at n.default (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-2.js:1:214659)
  at ga (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:60103)
  at As (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:104934)
  at Ou (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:90842)
  at Ru (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:90767)
  at Tu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:88115)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:46513
  at n.unstable_runWithPriority (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:3:13158)
  at Yi (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:46222)
  at eo (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:46458)
  at Ji (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:46393)
  at xu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:88492)
  at dl (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:113674)
  at render (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-5.js:1:115597)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-5.js:1:131028

Version

11.15.5

Build type

None

Browser

Chrome

Operating system

Windows

Hardware wallet

No response

Additional context

No response

Severity

No response

gauthierpetetin commented 3 months ago

Duplicate issue: https://github.com/MetaMask/metamask-extension/issues/24476

github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

adonesky1 commented 1 week ago

@0f0crypto we are planning to release v12.1.0 in the next day or two. I believe the fix for this bug (if its not already resolved) should be fixed in that version. Please update to v12.1.0 when available and let us know if you're still seeing this issue.