Interacting with an ERC20 proxy contract

I am developing when an ERC20 upgradeable using Openzeppelin Proxy contract, I understand how proxy storage is changed. However, I still do not understand how to get the values of the variables since the proxy does not save the declared structure of the variables, and on etherscan it still reads names, symbols, totalsupply, I don’t understand how they did. Which?

1 Like

Hi @trinhtan,

To interact with an upgradeable contract you use the ABI of the implementation contract with the address of the proxy contract.

You can have a look at an example script interacting with an upgradeable ERC20 (USDC): Interacting with upgradeable ERC20 using geth - #6 by abcoathup

I recommend trying out deploying an upgradeable contract: https://docs.openzeppelin.com/learn/upgrading-smart-contracts

Also see the Etherscan post: https://medium.com/etherscan-blog/and-finally-proxy-contract-support-on-etherscan-693e3da0714b

1 Like

Thank you, I will try.

1 Like

Can you show me a sample of an ERC20 implementation with openzeplin’s TransparentUpgradeableProxy? Thank you so much!

1 Like

thank you, I done it!

1 Like

Hi @trinhtan,

Glad to hear that you were able to interact with an upgradeable ERC20.

Hey can you share how you were able to solve it. I am also stuck with same problem.

1 Like

Hi @ayush_agarwal,

Welcome to the community :wave:

If you run into issues, feel free to create a new topic.

https://github.com/trinhtan/testUpgradeabilityContract You can see it, my repos

1 Like