Open cuongdo opened 6 years ago
It doesn't look like this is possible (yet), because MetaMask isn't propagating the reason string:
https://github.com/MetaMask/metamask-extension/issues/4559
I'll see if there's another way, but I'm not too optimistic, because the error object thrown by MetaMask doesn't contain any info except the error code and the generic error message.
When a require() in our contracts fails, they usually have a reason string that propagates to web3. This reason string is visible in our tests. For some reason, the require() is not propagating to to the DApp. Instead, we get a generic and unhelpful JSON-RPC error. This should be fixed to avoid wasting time investigating what should be simple issues.