Oz set-admin, changing proxyAdmin

I was able to successfully run the command

oz set-admin -n {network}

I tried this kovan and hesitant to do it mainnet because I’m certainly not sure what happened after setting the admin. I read the documentation it specifies what it does perfectly.

This is the article I tried to follow, Upgrades Governance.
Instead of the Multi-Signature wallet, I’ve tried setting the admin with my own single-sig address.
I did it successfully and was able to change the proxy admin, however when I went back to my

truffle console

I can’t run the commands perfectly which I was able to do perfectly before changing the proxy admin.

My Contract has Ownable

myContract = await MyContract.at('0x0address')
myContact.owner()

and so gives me out an error after changing the proxy admin
Error: VM execution error.

I tried to put back the original proxy admin but this it always tells me
No contract instances that match contract MyContract are owned by this project

I’m really stuck and this is the last place I hope to get an answer.

1 Like

After reading this How the new ProxyAdmin will work

I was able to run the command in truffle console using the proxyAdmin as the sender

… in truffle console
proxyAdmin = ‘0xF52FD…’
myContact.owner({from:proxyAdmin})

BUT still when trying to set/transfer/change the admin to another address via oz set-admin,
I’m still getting:

No contract instances that match contract MyContract are owned by this project

Is there a way to resolve this?

1 Like

Hi @superern14

I recommend checking the process thoroughly on public test networks before doing this on mainnet.

https://docs.openzeppelin.com/sdk/2.5/api/cli#set-admin
Note that if you transfer to an incorrect address, you may irreversibly lose control over upgrading your contract.

The documentation includes instructions for transferring ownership of a single contract or the complete project:
https://docs.openzeppelin.com/sdk/2.5/architecture#ownership-transfer

Did you change the admin of a single contract or the complete project (ProxyAdmin)?

The admin of the proxy should not be the same as the owner of the contract due to the transparent proxy pattern.

If you are connecting to the testnet using Infura and truffle-hdwallet-provider then you need to ensure that the account you want to use is exposed.

Deploy to a public testnet using OpenZeppelin SDK
NOTE: To expose additional addresses from the same mnemonic set num_addresses in your config.
To change the derivation path to derive addresses set wallet_hdpath in your config.
See the truffle-hdwallet-provider repository for details.

I recommend testing set-admin on a simple contract. I tend to use Counter.sol for this purpose, though you may want to create a simple contract that is also Ownable.

pragma solidity ^0.5.0;

contract Counter {
  uint256 public value;

  function increase() public {
    value++;
  }
}

Hi @superern14
I wanted to check if you were able to change the Proxy Admin?