scaffold-eth / scaffold-eth-2

Open source forkable Ethereum dev stack
https://scaffoldeth.io
MIT License
1.41k stars 887 forks source link

show blockexplorer link when transaction receipt is reverted #910

Closed technophile-04 closed 3 months ago

technophile-04 commented 3 months ago

Description

I think its nice UX to point to user to block explorer when transaction receipt is reverted. Viem does not give us the actual reason for transaction receipt revert as mentioned here they only give you status "reverted". So maybe its nice idea to point to block explorer for actual reason.

image

To test you could checkout:

git switch tx-revert-example

Checkout home page on how to make transaction revert or you could checkout Matt's video here. I have just bought Matt's example branch here and updated useTransactor with this branch code.

Demo video : https://github.com/user-attachments/assets/f894c898-4094-4b28-b823-954d096173ff
technophile-04 commented 3 months ago

Thanks @damianmarti ! Merging this 🙌