Pass my delegated call to another proxy

I am also looking for a way to pass my delegated call to another proxy. I was looking at

https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies#proxy-forwarding

Could we delegate the call like that to another proxy instead of the implementation? This would be the best way to achieve this since we don’t need to upgrade the Interface.

My proxy A Implement Contract A

I have several other Proxys that would be owned by my first proxy.

If I Deploy Proxy B and transfer the ownership to A, then I can’t upgrade it afterwards.

But if I was to set up accesControl for A over B instead of transferring the ownership, That would work, but when ever I would upgrade implementation B, i would need to update the interface as well in Implementation A. If I’m not mistaken,

So it’s seams to me that the best way to avoid dealing with the interface would be to make a delegated call to ProxyB so we don’t have to deal with changes in interfaces like the proxy forwarding does to the implementation.

Hi @madeindreams,

Sorry, I am not understanding your proposed setup. Can you give more details about what you are trying to do?

Absolutly @abcoathup Thanks for asking.

The context.

Prior to Defender I was dealing with all the proxy details. So I had 1 Proxy that was the owner of all my vaults. All the vaults are based on the same interface. This was my own way of being able to do exactly what the team came up with. I guess the OZ Team beat me at it!

Now I want to make use of Defender and upgradeability, and keep the process similar.
What was my Proxy before becomes an implementation behind an upgradeable Proxy.

So far this is all going well. Now I have vaults that deal with specific protocols, I also want these vault to be upgradeable. But if I was to upgrade that vault and add a new function, my main proxy implementation would require an upgrade as well to insert that new function in the interface.

I also notice how the proxy forward works to delegate call to the implementation. I was wondering if this was also possible for delegating calls to my vault without requiring the interface. But after second thought, I feel like I’m leaving a hole open.

I think it’s called the proxy fallback function.

However the main reason I’m digging into this is because I have tried to give the ownership of my vault (an upgradeable proxy) to my main proxy (upgradeable owner of all vault).

But then I’m unable to to upgrade this vault. I’m not the owner anymore. Clearly reverted.

I used this function

upgrades.admin.transferProxyAdminOwnership(0xofMyMainProxy) Not sure if it’s the right one to call.

I’m not sure if this is the right approach to transfer ownership.

Maybe I got it all wrong and the proposal to upgrade these vault should be made on the main proxy?

1 Like

Hi @madeindreams,

Do you use a ProxyAdmin?
https://docs.openzeppelin.com/upgrades-plugins/1.x/faq#what-is-a-proxy-admin

You would use admin.transferProxyAdminOwnership to transfer ownership of the ProxyAdmin and hence control of any upgrades for upgradeable contracts it was the admin for.
https://docs.openzeppelin.com/upgrades-plugins/1.x/api-truffle-upgrades#admin-transfer-proxy-admin-ownership

1 Like

Well according to what I have figured out so far.

I’m not sure if I use an admin proxy or jus a proxy. I looked at the ProxyAdmin admin contract you posted but not sure I get it right. The ProxyAdmin contract is not in the contracts-upgradeable 4.0.0 package.

I use the deployProxy with hardhat and ethers.

Do I have to implement all the function listed for my contract to be ProxyAdmin?

FUNCTIONS

Or do I declare my contract as a ProxyAdmin and import that from a different package?

1 Like

Hi @madeindreams,

If you deployed your upgradeable contract with Upgrades Plugins then a ProxyAdmin contract was deployed as the admin for your proxies.

https://docs.openzeppelin.com/upgrades-plugins/1.x/faq#what-is-a-proxy-admin