Deploy contract using CLI without a proxy

Asked by @gitpusha:

How can I just deploy contracts using oz without wrapping them in a proxy - i.e. just deploy the implementation. oz create does the proxy stuff.

I found oz push but not 100% sure if it is correct to use it for the deployment of individual contract implementation instances.

Hi @gitpusha,

Can you provide more information on what you want to do?

You can use oz push to deploy a logic contract. Though you can’t interact with logic contracts (or non-proxy contracts) using the CLI.

There is an open issue to support creating non-upgradeable contracts: https://github.com/OpenZeppelin/openzeppelin-sdk/issues/802

The 2.4.0 release added experimental support for EIP1167 minimal proxies adding the --minimal flag to oz create

https://github.com/zeppelinos/zos/releases/tag/v2.4.0

EIP1167 minimal proxies

We have added experimental support for EIP1167 minimal proxies. These proxies rely on the same delegatecall pattern as the usual ZeppelinOS proxies, but have two main differences:

  • They cannot be upgraded to a different version of the code
  • They are incredibly cheap to deploy: about 1/10th of the standard proxy!

These features make minimal proxies an ideal choice when you want to spawn many copies of the same contract, without worrying about maintaining them in the future. They also play nicely with EVM packages: since the package developer pays the deployment cost of the logic contracts, you only need to pay for the minimal proxies.

You can try deploying one of these proxies by adding the --minimal flag when running zos create . Remember that these proxies will not be upgradeable to a different version of the code: the reduced deployment gas fee comes at a cost!