# Transfer ownership doubt

**URL:** <https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313>\
**Category:** Upgrades\
**Tags:** proxies\
**Created:** [March 23, 2023, 8:36am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313 "2023-03-23T08:36:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 23, 2023, 8:36am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/1 "2023-03-23T08:36:05Z")

</div>

Hi everyone,

I've deployed three contracts in mainnet but I must transfer the ownership of all of them. They are proxies upgradeable with UUP pattern. When I transfer the ownership of a proxy contract what do I have to call?  
I'm currently calling the "transferOwnership" function. Should I call the "changeAdmin" function passing the address of the new owner? Or should only call the "transferOwnership" function and leave the rest as it is?

---

<div class="post-metadata">

**Author:** ![barakman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/barakman/32/855_2.png) [@barakman](https://forum.openzeppelin.com/u/barakman)\
**Post date:** [March 23, 2023, 8:54am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/2 "2023-03-23T08:54:39Z")

</div>

Depends what you want to do - change the account which can upgrade the logical contracts, or change the account which controls the logical contracts (i.e., allowed to call their limited-access functions)?

---

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 23, 2023, 8:55am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/3 "2023-03-23T08:55:22Z")

</div>

> [@Allennick](#):
>
> Hi everyone,
> 
> I've deployed three contracts in mainnet but I must transfer the ownership of all of them. They are proxies upgradeable with UUP pattern. When I transfer the ownership of a proxy contract what do I have to call?  
> I'm currently calling the "transferOwnership" function. Should I call the "changeAdmin" function passing the address of the new owner? Or should only call the "transferOwnership" function and leave the rest as it is?

I thank you for your answer. I would like to do both

---

<div class="post-metadata">

**Author:** ![barakman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/barakman/32/855_2.png) [@barakman](https://forum.openzeppelin.com/u/barakman)\
**Post date:** [March 23, 2023, 8:59am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/4 "2023-03-23T08:59:38Z")

</div>

Then do both.  
Keep in mind that the proxy contract admin and the logical contract admin must be two different accounts.

---

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 23, 2023, 9:08am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/5 "2023-03-23T09:08:48Z")

</div>

Thank you! I didn't remember that detail so you saved my ass

---

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 23, 2023, 10:54am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/6 "2023-03-23T10:54:19Z")

</div>

Just a thing. How can I call the upgradeAdmin function? When I try to interact with it directly from polyscan it gives me an error:

 ![Screenshot 2023-03-23 at 11.53.21](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/3X/4/7/47de8e00b59331e5c914ec9b1c056208585768a5.png)

I'm calling this proxy using the address I've used to deploy these contracts

---

<div class="post-metadata">

**Author:** ![barakman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/barakman/32/855_2.png) [@barakman](https://forum.openzeppelin.com/u/barakman)\
**Post date:** [March 23, 2023, 12:05pm UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/7 "2023-03-23T12:05:42Z")

</div>

The upgrader account is not necessarily the same as the deployer account.

When you deployed the proxy contract, one of the input parameters that you passed to it (i.e., one of the input parameters in the proxy contract's constructor) should be the address of the upgrader.

In order to upgrade the logical contract, you need to use that upgrader account.

---

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 24, 2023, 7:50pm UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/8 "2023-03-24T19:50:06Z")

</div>

Last question regards this topic: I need to hand over the ownership of the proxy contract to another user. I'm calling the changeProxyAdmin function of hardhat. Next I'm going to call the transferOwnership of the proxy contract. Is this all correct?  
In this case the owner of the contract will be the proxy admin too. Is this doable?

---

<div class="post-metadata">

**Author:** ![ericglau](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ericglau/32/15149_2.png) [@ericglau](https://forum.openzeppelin.com/u/ericglau)\
**Post date:** [March 27, 2023, 8:09pm UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/9 "2023-03-27T20:09:47Z")

</div>

> [@Allennick](#):
>
> I'm calling the changeProxyAdmin function of hardhat. Next I'm going to call the transferOwnership of the proxy contract. Is this all correct?  
> In this case the owner of the contract will be the proxy admin too. Is this doable?

Don't do that, because the proxy admin would not be able to call any functions on the Transparent proxy other than admin-related functions!

Instead, you should call transferProxyAdminOwnership and transferOwnership to transfer both the ProxyAdmin contract and the proxy to the new owner.

---

<div class="post-metadata">

**Author:** ![Allennick](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/allennick/32/8591_2.png) [@Allennick](https://forum.openzeppelin.com/u/Allennick)\
**Post date:** [March 28, 2023, 8:24am UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/10 "2023-03-28T08:24:54Z")

</div>

I've got to be honest. My coworkers told me to hurry so I did what I told you before. Am I completely screwed? I've tried to make an upgrade using the new ProxyAdmin set using changeProxyAdmin and the upgrade worked.  
As long as the upgrades "works" my client is happy. I've now learnt thanks to you what to do the next time

---

<div class="post-metadata">

**Author:** ![ericglau](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ericglau/32/15149_2.png) [@ericglau](https://forum.openzeppelin.com/u/ericglau)\
**Post date:** [March 28, 2023, 12:29pm UTC](https://forum.openzeppelin.com/t/transfer-ownership-doubt/35313/11 "2023-03-28T12:29:19Z")

</div>

If an address is both the proxy admin and the owner, then that address can only call admin functions, not the regular contract functions. If that is a problem, you can fix it by changing the proxy admin again to another address so that the proxy admin and owner are different.
