BuidlGuidl / abi.ninja

Interact with any contract on Ethereum.
https://abi.ninja
MIT License
183 stars 70 forks source link

UI / UX tweaks after proxy PR #78

Open technophile-04 opened 6 months ago

technophile-04 commented 6 months ago

Description :

UX :

Currently, we pre assume that every contract address is proxy contract and make 4-5* storage rpc calls to get the implementation address (max calls are been made if the contract is not proxy, and less calls if its proxy and we find the implementation address in early "if" condition) .

As such there is not a noticeable difference to me but it might for a user with slow internet connection before #72 and after #72 merge.

^ An naive solution might be having a check box on first screen "Load as proxy" and some URL search params in contracts page, so that we only make those implementation address storage rpc if the conditions are met.

UI:

Demo Image: ![Screenshot 2024-03-26 at 2 02 34 PM](https://github.com/BuidlGuidl/abi.ninja/assets/80153681/4b9c1628-a653-4fd5-b583-e034d900a715)

This is how we are showing implementation address, it looks good and serve it's purpose not sure if we can do better but happy to hear suggestions!!

portdeveloper commented 6 months ago

I also agree that we should give the user the option to tick a box for "This is a proxy contract" or maybe if we detect a contract but no code in it, maybe we can check for a public write function or something we could detect any proxy and then we attempt the proxy contract detection logic.

We currently do a similar thing if we do not detect a contract bytecode for a given address on heimdall PR, notifying the user: "This is not a contract, are you on the correct chain?". Something like that could work.

About the styling of the implementation address, I definitely agree! We should change that to look better ASAP :D

Also, I think evm-proxy-detection does not work for base and base is going to be pretty active so I think we should migrate proxy detection logic to viem so that we can modify it better and pass the chain as well. I will soon open an issue for this problem. (Maybe we could even utilize a basic backend to store/validate proxy contracts which could help with faster load times.)