MetaMask / MetaMask/metamask-extension

[Bug]: Contract revert error messages are too vague

Open
#23,638 1 comment 0 reactions 0 assignees View on GitHub
external-contributor INVALID-ISSUE-TEMPLATE T08-featureRequest team-confirmations Transactions type-enhancement
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

**Describe the bug**

When a contract interaction is expected to revert, I would expect the primary action to be disabled and a proper error message (from revert data) to be displayed (for this case "Token ID is taken").

![CleanShot 2024-03-22 at 13 09 48@2x](https://github.com/MetaMask/metamask-extension/assets/7336481/ba6c4acd-0349-4a9e-8050-6f212a3a0a5c)

**Steps to reproduce**

Can repro by performing mint(69) on https://etherscan.io/address/0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2#writeContract.

**Version**

Latest

**Build type**

None

**Browser**

Chrome

**Operating system**

MacOS

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by calling mint(69) on the linked Etherscan contract and observe the current revert handling. Trace the TypeScript code responsible for contract interaction errors and the primary action state; done means the action is disabled on the expected revert and the revert data produces the message "Token ID is taken".

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.