metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

[Bug]: Support for Solidity custom error is broken

Open 0xnakato opened this issue 2 years ago • 3 comments

Describe the bug

After the recent upgrade, the support for Solidity custom error is broken. Previously, it could return the function selector of the custom error that caused the transaction to be reverted when estimating gas/submitting the transaction.

Currently, if the transaction was reverted with a string reason, the error is like

"Failed to submit transaction: cannot estimate gas : [THE STRING ERROR REASON]."

However, for custom errors, the reason is no longer provided.

"Failed to submit transaction: cannot estimate gas."

Steps to reproduce

Call a transaction that will be reverted with Solidity custom errors.

Error messages or log output

{
    "code": -32603,
    "message": "Internal JSON-RPC error.",
    "data": {
        "code": 3,
        "message": "Failed to submit transaction: cannot estimate gas",
        "data": {
            "code": 104,
            "message": "cannot estimate gas"
        }
    }
}

Version

10.28.2

Build type

None

Browser

Chrome

Operating system

Windows

Hardware wallet

No response

Additional context

No response

0xnakato avatar Apr 07 '23 23:04 0xnakato

Upon investigating the issue, it appears that the message itself comes from the RPC provider.

I cannot find any existing or previous code that attempts to extract selector of the error and attach it to the message part.

Do you know by any chance what RPC provider were you using when the error was being displayed with the selector?

bergarces avatar Apr 20 '23 09:04 bergarces

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[bot] avatar Oct 24 '23 14:10 github-actions[bot]

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[bot] avatar Dec 08 '23 16:12 github-actions[bot]

Closing as lego's PR was merged

bschorchit avatar Dec 04 '24 18:12 bschorchit

@bschorchit Has it been confirmed fixed? I believe it may actually be properly fixed by yet-to-be-merged #11952.

legobeat avatar Dec 07 '24 02:12 legobeat