Disclaimer: This is a user generated content submitted by a member of the WriteUpCafe Community. The views and writings here reflect that of the author and not of WriteUpCafe. If you have any complaints regarding this post kindly report it to us.

For Ethereum, a platform for decentralised smart contracts, Etherscan is a Block Explorer and Analytics Platform.

On Etherscan, interacting with upgradeable contracts using a proxy standard was a real pain point. Some of you may find the below issues sounding familiar:

The Read/Write Contract functionality refers to the current contract address, which is either the implementation or the storage contract and therefore there is no straightforward way to interact across (or at the very least, read) a proxy contract on Etherscan.
Some proxy contract implementations have the implementation contract variable set to internal/private (for good reason, e.g. Transparent Proxy Pattern), which makes it harder for users to figure out where the implementation address is.
To help with this, we have recently worked to support several proxy contract standards, notably:

OpenZeppelin’s Unstructured Storage Proxies
OpenZeppelin’s Eternal Storage
EIP-1967 Transparent Proxy Pattern
EIP-1822 Universal Upgradeable Proxy Standard
And for contracts which uses their custom implementations, we also use a currently experimental process which guesstimates the implementation address from the transactions done historically.

Note that this feature is still new and experimental, there could be bugs and definitely more room for improvement — Always happy to receive feedback.

To access this feature, a contract must first be flagged as a proxy contract — The heuristic involved being that we check if there is a delegeteCall opcode sequence, and if yes, the below button will be displayed:

Is this a proxy?
Clicking on the button will load the Proxy Contract verification page. Clicking “Verify” will run the checks to obtain the implementation contract.

Proxy Contract Verification
If successfully done, we will get a happy green message — Things can still be inaccurate so do let us know if it is the case.

Click Save if this looks correct, else let us know. 🙂
Once saved, returning to the Contract tab of the proxy/storage contract page will display a new “Read as Proxy” and “Write as Proxy” sections, where the ABI used to load these read/write fields are the implementation contract’s ABI.

Suggestions are welcomed to replace the text “Read/Write as Proxy”. 🙂
If we are not able to obtain an implementation address display flagging the contract as a proxy contract, the below message will be shown. Likewise, please contact us if this is a mistake.

Please let us know if this is indeed a proxy contract.
What if the implementation address was upgraded?
If the proxy contract’s implementation address had been upgraded, just re-run the verification process and the new implementation address will be noted and stored in our database.

0

Login

Welcome to WriteUpCafe Community

Join our community to engage with fellow bloggers and increase the visibility of your blog.
Join WriteUpCafe