"Cannot set proxy implementation" when using Ganache GUI

I am using the SDK for the first time and it’s pretty neat. The contract got deployed when I used oz create for the first time. Later, I restarted Ganache and tried to get a new instance using the same oz create command. But this time, I received a Cannot set proxy implementation to a non-contract address error. What does it mean? And what am I doing wrong?

1 Like

Hi @manolingam,

Sorry to hear that you had this issue. I wasn’t able to reproduce. Would appreciate any details you can share.

The error is when the implementation being set isn’t identified as a contract:

I am using Windows Subsystem for Linux and the following versions:

$ oz --version
$ ganache-cli --version
Ganache CLI v6.7.0 (ganache-core: 2.8.0)
$ node --version
$ npm --version

I did oz create on the following contract from Your first project then killed ganache-cli, started ganache-cli again and then ran oz create

pragma solidity ^0.5.0;

contract Counter {
  uint256 public value;

  function increase() public {
1 Like

Hello, @abcoathup Thanks for reaching out.

So based on your input, I tried doing it again from scratch. But got the same error. Here are the steps I followed,

  1. Created an empty directory.
    mkdir zep-sdk
  2. Initialized that directory with zeppelin.
    cd zep-sdk
    oz init
  3. I changed my port number in networks.js from 8545 to 7545 as I am using Ganache GUI.
  4. Created a smart contract called Counter.sol and the code is the same as you have mentioned above.
  5. Saved everything, started ganache GUI and then did oz create. Instance got created. oz send-tx and oz call worked like a charm.

Now comes the confusing part,
6. I then closed the Ganache GUI and then restarted again. Since the local blockchain would have got reset, I again tried to create an instance using oz create. And this where I got an error as Cannot set a proxy implementation to a non-contract address.

Hope this might be sufficient for you to help :slight_smile:

1 Like

Hi @manolingam,

Before you shutdown Ganache GUI you should save the workspace.
When you start Ganache GUI you can then load the workspace. The blockchain will be in the same state from when you saved.
See the Ganache GUI documentation for details:

Alternatively, if you want to just use Quick Start workspace and not save (so you get a new blockchain every time), then in .openzeppelin directory you should delete <network>.json configuration file (e.g. in my project it is named dev-5777.json).

See Configuration Files <network.json> for more information about this configuration file.

1 Like

Thanks @abcoathup. That helped :slight_smile:

1 Like