Command Line Interface (CLI)
If you’re using Truffle or Buidler, check out the new Upgrades plugins to integrate upgradeability into your existing workflow. |
Develop, deploy and operate upgradeable smart contract projects. Support for Ethereum and every other EVM-powered blockchain.
-
Interactive commands: Send transactions, query balances, and interact with your contracts directly from the command line, using commands like
oz send-tx
,oz call
,oz balance
, andoz transfer
. -
Deploy & upgrade your contracts: You can develop your smart contracts iteratively, speeding up development locally, or squashing bugs in production. Run
oz deploy
to deploy your contracts, followed byoz upgrade
any time you want to change their code. -
Link Ethereum Packages: Use code from contracts already deployed to the blockchain directly on your project, saving gas on deployments and managing your dependencies securely, just with an
oz link
command. -
Bootstrap your dapp: Jumpstart your dapp by unpacking one of our starter kits, pre-configured with OpenZeppelin Contracts, React, and Infura. Run
oz unpack
to start!
Overview
Usage
All CLI commands are fully interactive: you can call them with no or incomplete arguments and they will prompt you for options as they proceed.
Below is a short list of the most used commands:
-
oz init
: initialize your OpenZeppelin project -
oz compile
: compile all Solidity smart contracts in your project -
oz deploy
: deploy an upgradeable smart contract -
oz send-tx
: send a transaction to a contract and execute a function -
oz call
: read data from the blockchain by callingview
andpure
functions -
oz upgrade
: upgrade a deployed contract to a new version without changing the address or state -
oz unpack
: bootstrap a project with a Starter Kit -
oz link
: reuse on-chain code by to a linking to Ethereum Packages
Learn More
-
Head to Getting Started to see the CLI in action by deploying and upgrading a smart contract!
-
Using Dependencies showcases a more complex project being built, including leveraging the OpenZeppelin Contracts library.
-
If you are a Truffle user, go to Using With Truffle for information on using both tools on the same project.
-
Take a look at the API reference for all CLI commands.
-
For an overview of the internals of the CLI, you can read on the Contracts Architecture and different Configuration Files.
Looking for the documentation for version 2.4 or earlier? You can find it here. |