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

Metamask fails to parse function signatures, shows contract interaction #8835

Closed
DeltaBalances opened this issue Jun 19, 2020 · 0 comments · Fixed by #8836
Closed

Metamask fails to parse function signatures, shows contract interaction #8835

DeltaBalances opened this issue Jun 19, 2020 · 0 comments · Fixed by #8836

Comments

@DeltaBalances
Copy link

DeltaBalances commented Jun 19, 2020

Describe the bug
A bug in the MetaMask confirmation popup when sending a transaction to a contract.
Some function signatures will never parse and show up as contract interaction, even though their signatures are known by 4byte and eth-method-registry.

This has been happening for weeks/months and thus is not just a temporary outage or loading error.
Some other functions show up fine, so it is somewhat functional.

Example

Function: withdrawToken(address token, uint256 amount)
MethodID: 0x9e281a98

Sending this will show me contract interaction instead of withdraw Token like it did a while ago.
interaction

To Reproduce (REQUIRED)

  • Go to an exchange contract on etherscan.
  • Go to Contract -> Write contract, and connect to Web3
  • Enter the 'withdrawToken' parameters (any address & number will do, you don't actually need to have a balance on the exchange)
  • Click the write button to get the MetaMask popup.
  • Reject the transaction after looking at the popup.

Expected behavior
I expect the function name to be displayed in the Metamask popup, for functions that have had their signatures registered. Just like it did in the past.

Screenshots (chrome left, firefox right)
popup

Browser details (please complete the following information):

  • OS: Windows 10 (64 bit)
  • Browser: Firefox 77.0.1 (Dutch) & Chrome 83.0.4103.106 (English)
  • MetaMask Version 7.7.9

Additional context (Error Messages, etc.)
It occasionally loads sent ether instead. Which might be a similar loading/parsing error.

tmashuang added a commit that referenced this issue Jun 19, 2020
…s empty

Fixes #8835

In cases where the registry failed to load, and the sig is set to `{}` on this line: https://github.com/MetaMask/metamask-extension/blob/e85b162651e887d79bfd15469289abc2c6753cbc/ui/app/helpers/utils/transactions.util.js#L78 this proceeds to set the method prefix to `{}` in knownMethodData.

Additionally check if the method prefix object is empty to proceed call getMethodDataAsync again.

I could only reproduce by intentionally failing the method registry lookup and found this solution. I could not find an instance where the registry consistently failed to lookup even on slow/throttled/high latency networks.
tmashuang added a commit that referenced this issue Jun 23, 2020
…s empty (#8836)

Fixes #8835

In cases where the registry failed to load, and the sig is set to `{}` on this line: https://github.com/MetaMask/metamask-extension/blob/e85b162651e887d79bfd15469289abc2c6753cbc/ui/app/helpers/utils/transactions.util.js#L78 this proceeds to set the method prefix to `{}` in knownMethodData.

Additionally check if the method prefix object is empty to proceed call getMethodDataAsync again.

I could only reproduce by intentionally failing the method registry lookup and found this solution. I could not find an instance where the registry consistently failed to lookup even on slow/throttled/high latency networks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant