keep-network / tbtc-dapp

Deposit BTC and redeem TBTC
http://dapp.test.tbtc.network/
MIT License
33 stars 31 forks source link

Improve Error Messaging when Deposit transactions are reverted/or fail #275

Open ramaruro opened 4 years ago

ramaruro commented 4 years ago

When initiating a Deposit, in Step 2, when the initial transaction (fee payment?) fails in Metamask the ensuing error is very unclear for an end user. It looks like it is reading straight from Ethereum, but very few people would know what to do with that.

Suggestion: capture the reason of the error (e.g. System at Minting Capacity) and display that. Also explicit that no fee was spent, only Gas (?). Exception thrown contract code Exception thrown contract code 2 Exception thrown contract code 3

Below is the message and the screenshots.

In Step Error initiating deposit Initiating... Transaction has been reverted by the EVM: { "blockHash": "0xc6b831e9c5c2e66874d3f79bb07da69a974370170b83537ad158c340b420bc7e", "blockNumber": 8306581, "contractAddress": null, "cumulativeGasUsed": 498185, "from": "0x200f0abeaf597351860cb9b1abf6bb685f1cb390", "gasUsed": 498185, "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": false, "to": "0x5536a33ed2d7e055f7f380a78ae9187a3b1d8f75", "transactionHash": "0x228c6b1e169d917d26afe4132aa59890123d8f617bc59861191671b58e16957b", "transactionIndex": 0, "events": {} }