This question popped in my mind: Is there a way to signal proxy contract ABI for blockchain explorers like EtherScan, so that the contract users would have better visibly what transactions happen through a proxy contract?
Ps. Unrelated: the EOS decision to make all contract code upgradeable by default, having opt-in for immutable code seems wise as hindsight, as the EOS method is less complex.
Hey @miohtama! Unfortunately there is no way for a contract to signal it is a proxy (there is a proposed method in EIP897, but I think it’s not widely implemented). This means that, unfortunately, each block explorer needs to implement custom code for each proxy implementation they want to support.
As for Etherscan, they recently added support for flagging a contract as a proxy, so you could use its implementation ABI when interacting with it. They support a few different proxy types, such as EIP1967 (by checking the content of those specific storage slots) and EIP1167 (by checking the exact assembly). @kvrnc may be able to provide further info.
Absolutely! Here is an ERC20 token which is set up as a proxy. Note that you have two tabs: Read Contract and Read as Proxy. Both will query the proxy contract, but the latter will use the ABI of its implementation.