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]: Zero-arg function calls shown as "Contract interaction" rather than function name #15837

Closed
hiroshi-yamamoto-dublr opened this issue Sep 15, 2022 · 7 comments
Labels
area-activity area-transactions stale issues and PRs marked as stale team-confirmations-planning (only for internal use within Confirmations team) type-bug

Comments

@hiroshi-yamamoto-dublr
Copy link

hiroshi-yamamoto-dublr commented Sep 15, 2022

Describe the bug

I have several functions registered with the Parity registry (verified by reading them back), as required by MetaMask for resolving function names.

If the function takes one or more arguments (e.g. sell(uint256,uint256), the function name correctly shows in the MetaMask history (e.g. as Sell).

However, if the function takes no arguments (e.g. cancelOrder()), the function name shows in the MetaMask history as Contract interaction. No attempt is made to show the function name (e.g. as Cancel Order).

There seems to be an issue in the function signature parser, which takes the function signature string returned by the Parity registry, which does not like () as the parameter list.

image

A StackExchange search indicates that others have run into the same problem.

Steps to reproduce

  1. Deploy a contract with a 1-param function and a 0-param function.
  2. Register both function signatures using the Parity registry.
  3. Call both functions through MetaMask.
  4. Observe that the 0-param function is not named in the history.

Error messages or log output

No response

Version

10.18.0

Build type

No response

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

@FrederikBolding
Copy link
Member

Hi! Are your function signatures also registered with https://www.4byte.directory/ ? We recently had to disable fetching from the Parity registry because it was being griefed. It seems that those docs are out of date.

@hiroshi-yamamoto-dublr
Copy link
Author

@FrederikBolding no, sorry, I didn't know about that service -- I was just following the MetaMask docs.

Thanks, I'll register there instead. Is this a permanent switch?

@hiroshi-yamamoto-dublr
Copy link
Author

PS @FrederikBolding how does MetaMask handle collisions? There are currently 327k registered signatures at 4byte.directory, which means one chance in 13,122 of a collision. Can you resolve any ambiguity that arises by filtering through the list of returned signatures, and at least eliminating all signatures that don't typecheck against the arguments that were sent with the function call?

@hiroshi-yamamoto-dublr
Copy link
Author

@FrederikBolding I have at least one 4byte.directory 4-byte function selector collision for my API, and 4byte.directory does not seem to allow alternatives to be registered for a given function selector, which means the first function name that is registered for a given function selector will forevermore be the only function name that will be shown by MetaMask for all different functions that have the same function selector.

Would it be possible for MetaMask just to pull the API for verified contracts directly from Etherscan?

@github-actions
Copy link
Contributor

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. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Jul 20, 2023
@bschorchit bschorchit added team-confirmations-planning (only for internal use within Confirmations team) area-activity and removed stale issues and PRs marked as stale labels Jul 20, 2023
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Oct 19, 2023
Copy link
Contributor

github-actions bot commented Dec 3, 2023

This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 3, 2023
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-activity area-transactions stale issues and PRs marked as stale team-confirmations-planning (only for internal use within Confirmations team) type-bug
Projects
None yet
Development

No branches or pull requests

3 participants