Hi, how can we change the status of ProxyAdmin using TransparentUpgradeableProxy using OZ Defender Hardhat plugin? We want those functions to be available in the public read/write methods so they are easier to find and document for our users.
Also we want to change the contract name TransparentUpgradeableProxy to something else, for example MyTokenProxy, is this possible? Thank you.
We want those functions to be available in the public read/write methods
Can you clarify what you mean? Which functions are you referring to? If you want to expose functions, you may consider the UUPS proxy pattern instead, as that allows you to place proxy-related functions in your implementation.
Also we want to change the contract name TransparentUpgradeableProxy to something else, for example MyTokenProxy
This shouldn't be necessary, as it has no effect except how the source code verification would be displayed on block explorers. If you really wanted to, you could inherit TransparentUpgradeableProxy in a new contract without adding any other code. But deploying this proxy would not be supported from the Upgrades Plugins.
Apologies, I mean to make the admin variable public, that the functions renounceOwnership, transferOwnership, upgradeAndCall + UPGRADE_INTERFACE_VERSION and owner are visibile without navigating to the ProxyOwner address separately.
As for the second point, the renaming helps because we are using multiple instances of TransparentUpgradeableProxy contract for different smart contracts in our project, so it helps to be able to label them appropriately. Thank you.
Thanks for clarifying.
What you described does not sound like it fits with the transparent proxy pattern, since the admin functions should be "transparent" and not be accessible except when using the proxy admin. This is to avoid any possible clashes with implementation functions.
Instead, it seems the UUPS proxy pattern is the most appropriate for your use case. See https://docs.openzeppelin.com/contracts/5.x/api/proxy#transparent-vs-uups
2 Likes
Thank you for the info, we will explore UUPS.