This release adds some improvements on
zos outputs, adds a new
zos compile command to compile your contracts, incorporates a new
networks.js file to manage your networks, and finally implements a couple of handy commands to interact with your contracts from the command line.
While in 2.3 we focused on improving the ZeppelinOS inputs, by implementing friendlier interacting commands, in 2.4 we focused on improving its outputs. We removed much of the verbosity that plagued the CLI, and show you only what actually matters. We also integrated the awesome spinnies library for presenting long-running operations.
If you miss having the CLI filling your terminal with lots of output, you can bring back the old mode (with even more info!) by using the
--verbose flag in any command.
You can now run ZeppelinOS without depending on truffle. Version 2.4 ships with a new
zos compile command that will install and run
solcjs on your behalf, and compile your Solidity contracts when needed. As a bonus feature,
zos will check if there is a
solc on your
zos compile follow the same format as truffle's.
zos init will now create a framework-independent
networks.js file with the description of the network connections for your project. The format is similar to that of
truffle-config.js, with an additional
protocol key that allows you to specify whether you want to connect to your node via
Of course, ZeppelinOS remains fully compatible with truffle. If the CLI detects a
truffle(-config).js on your project root, it will still rely on truffle for compiling your contracts, and will load the networks configuration from truffle as usual.
Interacting with your contracts from the command line
You can try out the following commands:
zos balancequeries the balance of an account, either in ETH or in an ERC20
zos transfersends funds from one of your accounts to another
zos callexecutes a constant method in one of your contracts, and returns the value
zos send-txsends a transaction to one of your contracts, and returns the events
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!
zos compilecommand that uses solc directly to compile your contracts, generating artifacts with a format compatible to truffle's. The compiler version and optimizer settings can be controlled via command flags that are persisted on the
zos.jsonfile. The CLI will now default to this compiler when running commands that require compilation (like
create), unless there are no compiler settings on
zos.jsonand there is a
truffle.jspresent in the project root, in which case it will rely on
truffle compileas usual. (#914, #940, #945, #953, #956, #959, #963)
networks.jsdefault configuration file for specifying networks connections. This file replaces the truffle config file in specifying the available networks for the CLI, and shares most of its format. A
truffle-config.jscan still be used. (#918, #949)
zos send-txinteractive commands for interacting with a contract directly from the command line, by calling a constant method or sending a transaction to a function. (#848, #853)
zos transfercommands for querying and transferring ETH directly from the command line. The
balancecommand additionally supports an
--erc20flag to query the balance of an ERC20 token instead of ETH. (#823, #834)
- Added validations to method arguments in the interactive prompt. (#1018)
- [experimental] Add minimal proxy support (EIP 1167) via a
--minimalflag when running
zos create. Instances created this way will not be upgradeable, but consume much less gas than their upgradeable counterpart. (#850)
- Reworked all log outputs in the application to be less verbose and more user-friendly. The
--verboseflag re-enables the previous logging level. (#915, #948, #969, #988, #1003)
- [breaking] The
ConfigVariablesInitializerclass of the CLI programmatic interface has been renamed to
- [breaking] The
initArgsparameter names of the CLI programmatic interface were changed to
- Do not list contracts already added in interactive prompt when running
zos add. (#904)
- Fixed error
Cannot find method forEach of undefinedwhen two contracts with the same name are present in the project. (#880)
- Support invoking a method in a contract when there is another method with the same name and number of arguments. (#1019)
- Fixed parsing of array, boolean, and integer arguments when calling a method via the interactive prompt. (#976, #987)
- Handle new metadata format introduced in Solidity 0.5.2 embedded in the contract's bytecode. (#934)
- Fix extracting proxy address from
ProxyCreatedevent when running
solidity-coverage. (#978) (thanks @tsudmi!)
- [breaking] Removed the
statuscommand, which was unmaintained and failing in certain scenarios.