Releases: OpenZeppelin/openzeppelin-sdk
v2.4.0
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.
Nicer outputs
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.
Standalone CLI
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 PATH that matches the requested version, and use it instead of the javascript port - this yields a 6x speed improvement in compile times. It's worth mentioning that the artifacts generated by zos compile follow the same format as truffle's.
Also, 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 http(s), ws(s), ipc, etc.
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
We have added new commands for interacting with your contract instances easily. You can now send a transaction or move funds directly from the terminal, without having to spawn a javascript console.
You can try out the following commands:
zos balancequeries the balance of an account, either in ETH or in an ERC20zos transfersends funds from one of your accounts to anotherzos callexecutes a constant method in one of your contracts, and returns the valuezos 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!
Changelog
Added
- New
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 thezos.jsonfile. The CLI will now default to this compiler when running commands that require compilation (likeaddorcreate), unless there are no compiler settings onzos.jsonand there is atruffle.jspresent in the project root, in which case it will rely ontruffle compileas usual. (#914, #940, #945, #953, #956, #959, #963) - New
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. Atruffle.jsortruffle-config.jscan still be used. (#918, #949) - New
zos callandzos 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) - New
zos balanceandzos transfercommands for querying and transferring ETH directly from the command line. Thebalancecommand 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 runningzos create. Instances created this way will not be upgradeable, but consume much less gas than their upgradeable counterpart. (#850)
Changed
- 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 toConfigManager. (#918) - [breaking] The
initMethodandinitArgsparameter names of the CLI programmatic interface were changed tomethodNameandmethodArgsrespectively. (#841)
Fixed
- 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 runningsolidity-coverage. (#978) (thanks @tsudmi!)
Removed
- [breaking] Removed the
statuscommand, which was unmaintained and failing in certain scenarios.
Internal
v2.3.1
v2.3.0
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 unpack and create2 commands. And as usual, the smart contracts have been audited by a separate team.
Interactive commands
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 DEBIAN_FRONTEND=noninteractive variable.
Unpack command
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.
Additionally, 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.
Set-admin command
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 command
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
Changelog
Added
- Add interactive prompts for most CLI commands (
add,create,init,link,publish,push,remove,session,set-admin,unlink,update,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) - Support
ZOS_NON_INTERACTIVEenvironment variable, as well asDEBIAN_FRONTEND=noninteractive, to disable interactive prompts in scripts (#887) - Add
zos unpackcommand for initializing a new zepkit from any github repository with akit.jsonspecification, with the shortcutstutorialandzepkitalready set to official packs (#822, #869) - Add
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
lib-simpleandcreate-instances-from-solidityexample projects (#813, #780) (thanks @paulinablaszk!) - Add mixins support to the typescript codebase for removing code duplication (#815)
Changed
- Add support to
set-admincommand for changing the owner of theProxyAdmincomponent, 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)
- Optimized
initializermodifier fromInitializablecontract 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)
Fixed
- Fix issue
truffle-migrateexample (#763) (thanks @HardlyDifficult!) - Output a message notifying if no contracts were pushed in a
zos push(#888) - Remove dependency
web3-provider-engine, which was no longer needed, and caused all ofbabelto be installed along with the CLI (#909) - Show a reasonable error message if a
zos.jsonorzos.network.jsonfile is malformed (#881) - Store proxy admin and proxy factory addresses in
zos.network.jsonupon apushif 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)
v2.2.3
v2.2.2
Added
- Added Goerli network to the list of known networks, both for verification on etherscan and for naming of zos.network.json files (#768) (thanks @paulinablaszk!)
Fixed
- Fix contracts compilation on Windows workstations (#764) (thanks @siromivel!)
- Avoid adding libraries and contracts from external packages (#758) (thanks @siromivel!)
- Fix ZWeb3 initialization when providing an HTTP url as a web3 provider (#785)
Changed
- Exceptions thrown during the validation process can be ignored during
zos pushvia the--forceflag (#770)
v2.2.1
This patch release includes several bugfixes, but the main change is the removal of openzeppelin-solidity as a dependency. This allows users of zos-lib to be able to use whichever version of openzeppelin they want, since truffle compilation fails to handle multiple versions of the same package in the same project (including transitive dependencies).
Changed
- Remove
openzeppelin-solidityas a dependency (#739)
Fixed
- Provider initialization issue on
zos checkcommand (#737) - Error messages that refer to
truffle.jsconfig file when actually it istruffle-config.js(#710) - Error message "Cannot read zosversion of undefined" when attempting to create a contract on a new network that had not been
push'ed to before (#711) - Handle spaces in project path when compiling contracts (#743)
v2.2.0
This release adds a new ProxyAdmin component, which a small contract that is the default admin of all the upgradeable instances you create. This allows you to transparently interact with your contracts from any address, without needing to work with two addresses simultaneously - one for managing upgrades, the other for actual interaction. Note that projects developed with earlier versions of zos need to be migrated to this new structure: the migration is prompted when you run a zos push on any network.
Another major change is that ZeppelinOS now works with web3-1.0.0-beta.37 contracts instead of truffle 4 contracts. This means that the programmatic interface will now return web3 contract objects. If you want to use truffle contracts (either 4 or 5) you will need to wrap the instances in a truffle-contract.
Added
- New
ProxyAdmincontract to manage proxy instances (#588 and #625) (see audit report) - Contributing guidelines (#553)
- Example using truffle migrations (#416)
- Tests for
verifycommand (#468) - Migration process for projects using previous versions of ZeppelinOS v2 (#621)
- Support receiving booleans via the CLI (#623)
- Parse scientific notation numbers from the CLI (#567)
- Linter pre-commit githook (#620)
Changed
- Update Web3 to version
1.0.0-beta.37(#572) - Use web3 compatible contract classes (#595)
- Migrate
clicodebase to TypeScript (#494, #516, #517, #523, #515, #521, #525, #526, #529, #530, #531, #532, #537) - Migrate
libcodebase to TypeScript (#443, #492, #493, #491, #500, and #509) - Add
lodashfunctions separately (#555) (thanks @slorenzo!) - Upgrade
truffle-flattenerto version1.3.0(#682) - Update Etherscan api key url (#474)
- Polish
Truffleutil methods used in CLI (#507) - Avoid transferring proxies to
Appon publish (#609)
Fixed
- Gas estimation issues on geth (#614)
- Use gas defaults when present (#575)
- Bytecode comparison in
SimpleProject(#580) - Avoid changing tx params object for every transaction (#675)
- Force compiling all contracts (#581)
- Etherscan mainnet url (#642)
- Checksum default sender address on initialization (#654)
- Ignore Truffle's default gas value (#671)
- Integration tests using
truffle-hdwallet-provider(#473)
Removed
v2.1.2
This patch pins down a dependency in zos-lib which caused a breaking change, rendering 2.1.1 unusable when the new dependency was released. For more information, read here.
Fixes
- Use patched versions of
[email protected](#9571fd4) - Use patched versions of
[email protected](#9571fd4) - Use pinned version
1.2.8oftruffle-flattener(#9571fd4)
v2.1.1
v2.1.0
The main feature of this release is support for contract compilation with both Truffle 4 and Truffle 5. This means that you can now use ZeppelinOS with contracts built using Solidity 0.5.x. We have also adapted the Initializable contract to be compilable with both Solidity 0.4 and 0.5. However, under the hood, ZeppelinOS still depends on Truffle 4 and Web3 0.x; we are working to migrate the entire stack to Web3 1.0 in an upcoming release.
This release also includes automatic gas price setting when working on mainnet, by querying ethgasstation to obtain an average gas price value. Thanks @zachzundel for the contribution!
Last but not least, after etherscan opened up their API for contract code verification, we are also including automatic contract verification on etherscan via the zos verify command. Thanks @ProtonGustave for the contribution!
Changelog
Added
- Support Truffle 5 projects (04137b7)
- Extend
Initializablepragma to allow solidity 0.5 (912bf2d) - Etherscan integration for contracts verification (#413)
- Gas price estimations on mainnet with ETH Gas Station (#299)
- Add more tests to create command in CLI (9a935a3)
Changed
- Use contract method
estimateGasfunction to estimate contract functions calls (#310) - Remove
truffle-workflow-compilein favor of shell compilation (423d8f9) - Delete mock contracts when publishing package (#293)
- Update truffle-migrate example to use latest ZeppelinOS version (#574)





