This release marks a huge improvement in terms of developer experience, adding interactive prompts to most commands in the CLI. We have also overhauled the
set-admin command, and added new
create2 commands. And as usual, the smart contracts have been audited by a separate team.
The ZeppelinOS CLI will now guide you through the process of creating a new upgradeable contract and updating it as needed. We have reworked most commands on the CLI to be interactive, and handle any necessary work for you. Now, instead of typing the following 3 commands...
$ zos add MyContract $ zos push --network mainnet $ zos create MyContract --network mainnet --init initialize --args 42 > Instance created at 0x123456
... you can just run
zos create and let the CLI walk you through it.
All previous arguments and flags still work. However, if you are writing a script to run in an automated environment, you can also add a
--no-interactive flag to any command to make sure it will never prompt, or set a global
ZOS_NON_INTERACTIVE environment variable. The CLI will also honor the
A new command
zos unpack was added for unpacking a zepkit instance. We are providing two packs initially:
zos unpack zepkitwill initialize a new barebones react app, preconfigured with OpenZeppelin, ZeppelinOS, Truffle, and Infura, ready to start coding.
zos unpack tutorialwill initialize the same pack, but with an additional guided tutorial for you to get acquainted with it.
zos unpack can be directed to any github repository with a
kit.json specification, so anyone in the community can propose their own packs to be used with ZeppelinOS.
In previous versions,
zos set-admin would allow you to change the upgradeability admin (ie the Ethereum account, contract or externally owned, that had the rights to upgrade an instance) of each individual proxy in your application. However, on version 2.2, we introduced the
ProxyAdmin component, which is a small contract that acts as a the owner of all your instances for your project (which you own in turn).
We have updated the
zos set-admin command to take advantage of this new contract. It now allows you to change ownership of your entire project to a different account in a single transaction, by just changing the owner of the root
ProxyAdmin. The functionality from previous versions is maintained, meaning that you can still change ownership of any individual instances if needed.
CREATE2 is an EVM opcode that allows you to deploy a contract at a predictable address, by providing a
salt that is used to compute the deployment address. It is used in generalized state channels implementations, as well as in improved user onboarding flows.
With this new release, you can leverage
CREATE2 directly from the command line, deploying an upgradeable contract at a predictable address with a one-liner. The CLI will take care of setting up the necessary contracts for you, so you don't to implement everything from scratch.
We have also added early meta-transaction support for this command. Instead of having the deployment address determined by the salt and the sender of the transaction, now a user can sign a
CREATE2 request for a specific contract with a salt, and have the transaction submitted by anyone.
$ zos create2 MyContract --query --salt 42 --signature 0xabcdef --init initialize > Instance of MyContract initialized with 'initialize()' with salt 42 and signature 0xabcdef will be deployed at 0x654321 ... $ zos create2 MyContract --salt 42 --signature 0xabcdef --init initialize > Instance of MyContract deployed at 0x654321
- Add interactive prompts for most CLI commands (
verify), plus a
--no-interactiveflag to ensure that no prompts are shown when working in a non-interactive script (#792, #766, #750, #745, #730, #725, #839)
ZOS_NON_INTERACTIVEenvironment variable, as well as
DEBIAN_FRONTEND=noninteractive, to disable interactive prompts in scripts (#887)
zos unpackcommand for initializing a new zepkit from any github repository with a
kit.jsonspecification, with the shortcuts
zepkitalready set to official packs (#822, #869)
zos create2command for deploying proxies to a predefined address determined via a salt and the sender address, or an off-chain signature of a sender (#805, #757), checking before deployment that the address had not been already deployed to (#788) (thanks @siromivel!)
- Add test to
truffle-migratesample project on CI (#775) (thanks @paulinablaszk!)
- Add new
ProxyFactorycontract and model for supporting the CREATE2 opcode (#805)
- Add new
create-instances-from-solidityexample project (#724)
- Add READMEs to
create-instances-from-solidityexample projects (#813, #780) (thanks @paulinablaszk!)
- Add mixins support to the typescript codebase for removing code duplication (#815)
- Add support to
set-admincommand for changing the owner of the
ProxyAdmincomponent, so ownership of the entire application can be moved to a different entity in a single transaction (#804)
- Commands can now be run from any subfolder in the project (#818)
Initializablecontract to use less gas (#613) (thanks @k06a!)
- Deployment of
Contractclass from lib now accepts a variable number of arguments for the constructor instead of an array (#630)
- Fix issue
truffle-migrateexample (#763) (thanks @hardlydifficult!)
- Output a message notifying if no contracts were pushed in a
- Remove dependency
web3-provider-engine, which was no longer needed, and caused all of
babelto be installed along with the CLI (#909)
- Show a reasonable error message if a
zos.network.jsonfile is malformed (#881)
- Store proxy admin and proxy factory addresses in
pushif the upload of a contract failed (#860)
- Web3.js instance is no longer reset inbetween calls (#836) (thanks @Perseverance!)
- Changing the proxy admin now checks that sender is the current admin before sending the transaction (#840)
- Properly flagged
lodash.omitas non-development dependency (#864)
- Use the block gas limit as gas allowance for all transactions to ganache, instead of estimating gas, to circumvent bugs with gas estimations in ganache 6.4.0 and above (#896)