deployProxy using Ganache GUI only deploys proxy

This is a great guide (OpenZeppelin Upgrades: Step by Step Tutorial for Truffle)! However, at the step of deployment, when I deployed using below (on ganache)

$ npx truffle migrate -f 2

I got the below message:

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.



Starting migrations...
======================
> Network name:    'development'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


2_deploy_box.js
===============

   Deploying 'AdminUpgradeabilityProxy'
   ------------------------------------
   > transaction hash:    0xe4443dc8c967751088af206eb2552a1386b4c8e0ddaec0a03b737cbd0211778e
   > Blocks: 0            Seconds: 0
   > contract address:    0xA3C9bc34cBa39adE517105AB73302caaD14Eb9E1
   > block number:        26
   > block timestamp:     1603893970
   > account:             0x898E0FDE588806744505D0c2B34653b4D11380Bb
   > balance:             99.86877134
   > gas used:            647692 (0x9e20c)
   > gas price:           20 gwei
   > value sent:          0 ETH
   > total cost:          0.01295384 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:          0.01295384 ETH


Summary
=======
> Total deployments:   1
> Final cost:          0.01295384 ETH

But I didn’t get 3 contracts! (as per the guide - Box, ProxyAdmin, and AdminUpgradeabilityProxy)

I tried multiple times (deleting the project folder, deleting ganache workspace and recreating project folder and all the steps) and only once I guess I got all three contracts displayed.

Now whenever I go to Ganache > Contracts > Click on Box > ganache screen goes completely white.

What I’m missing?

1 Like

Hi @megatower66,

I assume that you still have a .openzeppelin/unknown-ZZZZ.json network file

This file records the implementation and proxy admin contracts which is why after deploying once these aren’t deployed again.

I was able to reproduce what you were seeing by removing the build directory and then rerunning npx truffle migrate --network development and only the proxy contract (AdminUpgradeabilityProxy) was deployed.

If you remove both the build directory and the .openzeppelin/unknown-ZZZZ.json network file and try deploying again.

As an aside, what operating system are you using?

Awesome @abcoathup, deleting .openzeppelin/unknown-ZZZZ.json generated all three proxies. You’re awesome!

On a side note, I added another upgradable contract along with initial one (say Contract A and B), but only 5 contracts were created (in below order)

  1. A
  2. ProxyAdmin
  3. AdminUpgradeabilityProxy
  4. B
  5. AdminUpgradeabilityProxy

Am assuming #2 ProxyAdmin is the admin for both #3 and #5?

I’m using Mac OS Mojave 10.14.6 (18G6020)

1 Like

Hi @megatower66,

That is correct.

Only one ProxyAdmin is deployed per network (per project) (see: https://docs.openzeppelin.com/upgrades-plugins/1.x/faq#what-is-a-proxy-admin).

1 Like