Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Releases: OpenZeppelin/openzeppelin-sdk

v2.4.0

24 Jun 18:24
Compare
Choose a tag to compare

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.

createoutput

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.

send-tx-and-transfer

You can try out the following commands:

  • zos balance queries the balance of an account, either in ETH or in an ERC20
  • zos transfer sends funds from one of your accounts to another
  • zos call executes a constant method in one of your contracts, and returns the value
  • zos send-tx sends 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 compile command 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.json file. The CLI will now default to this compiler when running commands that require compilation (like add or create), unless there are no compiler settings on zos.json and there is a truffle.js present in the project root, in which case it will rely on truffle compile as usual. (#914, #940, #945, #953, #956, #959, #963)
  • New networks.js default 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.js or truffle-config.js can still be used. (#918, #949)
  • New zos call and zos send-tx interactive 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 balance and zos transfer commands for querying and transferring ETH directly from the command line. The balance command additionally supports an --erc20 flag 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 --minimal flag when running zos 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 --verbose flag re-enables the previous logging level. (#915, #948, #969, #988, #1003)
  • [breaking] The ConfigVariablesInitializer class of the CLI programmatic interface has been renamed to ConfigManager. (#918)
  • [breaking] The initMethod and initArgs parameter names of the CLI programmatic interface were changed to methodName and methodArgs respectively. (#841)

Fixed

  • Do not list contracts already added in interactive prompt when running zos add. (#904)
  • Fixed error Cannot find method forEach of undefined when 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 ProxyCreated event when running solidity-coverage. (#978) (thanks @tsudmi!)

Removed

  • [breaking] Removed the status command, which was unmaintained and failing in certain scenarios.

Internal

  • Removed TSlint in favor of prettier and ESLint. (#920)
  • Add integration tests for starter boxes, to ensure that the latest version of the CLI is always compatible with zepkit. (#913, #957)

v2.3.1

05 Jun 20:54
Compare
Choose a tag to compare

Fixed

  • Fix error Cannot read property 'absolutePath' of undefined when retrieving contracts if the project folder had the word "contracts" on it (#928)

v2.3.0

27 May 15:27
Compare
Choose a tag to compare

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.

coc-create

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 zepkit will initialize a new barebones react app, preconfigured with OpenZeppelin, ZeppelinOS, Truffle, and Infura, ready to start coding.
  • zos unpack tutorial will initialize the same pack, but with an additional guided tutorial for you to get acquainted with it.

unpack

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.

create2

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-interactive flag to ensure that no prompts are shown when working in a non-interactive script (#792, #766, #750, #745, #730, #725, #839)
  • Support ZOS_NON_INTERACTIVE environment variable, as well as DEBIAN_FRONTEND=noninteractive, to disable interactive prompts in scripts (#887)
  • Add zos unpack command for initializing a new zepkit from any github repository with a kit.json specification, with the shortcuts tutorial and zepkit already set to official packs (#822, #869)
  • Add zos create2 command 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-migrate sample project on CI (#775) (thanks @paulinablaszk!)
  • Add new ProxyFactory contract and model for supporting the CREATE2 opcode (#805)
  • Add new create-instances-from-solidity example project (#724)
  • Add READMEs to lib-simple and create-instances-from-solidity example projects (#813, #780) (thanks @paulinablaszk!)
  • Add mixins support to the typescript codebase for removing code duplication (#815)

Changed

  • Add support to set-admin command for changing the owner of the ProxyAdmin component, 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 initializer modifier from Initializable contract to use less gas (#613) (thanks @k06a!)
  • Deployment of Contract class from lib now accepts a variable number of arguments for the constructor instead of an array (#630)

Fixed

  • Fix issue truffle-migrate example (#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 of babel to be installed along with the CLI (#909)
  • Show a reasonable error message if a zos.json or zos.network.json file is malformed (#881)
  • Store proxy admin and proxy factory addresses in zos.network.json upon a push if 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.omit as 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

12 Apr 18:50
Compare
Choose a tag to compare

Fixed

  • Do not modify Contract instance address when calling Contract#at but generate a clone instead (#810)

v2.2.2

14 Mar 22:59
Compare
Choose a tag to compare

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 push via the --force flag (#770)

v2.2.1

26 Feb 20:42
Compare
Choose a tag to compare

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-solidity as a dependency (#739)

Fixed

  • Provider initialization issue on zos check command (#737)
  • Error messages that refer to truffle.js config file when actually it is truffle-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

14 Feb 16:46
Compare
Choose a tag to compare

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 ProxyAdmin contract to manage proxy instances (#588 and #625) (see audit report)
  • Contributing guidelines (#553)
  • Example using truffle migrations (#416)
  • Tests for verify command (#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

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

  • truffle-contracts from codebase (#451)
  • truffle-resolver from CLI and honor from in config (#612)
  • Lightweight terminology (#550)

v2.1.2

01 Feb 15:31
Compare
Choose a tag to compare

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 web3@0.18 (#9571fd4)
  • Use patched versions of ethereumjs-abi@0.6 (#9571fd4)
  • Use pinned version 1.2.8 of truffle-flattener (#9571fd4)

v2.1.1

31 Jan 00:02
Compare
Choose a tag to compare

Added

  • Support compiling with globally installed truffle (#596)

Fixed

  • Storage layout check fixes (#606)

v2.1.0

10 Jan 16:30
Compare
Choose a tag to compare

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!

image1

Changelog

Added

  • Support Truffle 5 projects (04137b7)
  • Extend Initializable pragma 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 estimateGas function to estimate contract functions calls (#310)
  • Remove truffle-workflow-compile in favor of shell compilation (423d8f9)
  • Delete mock contracts when publishing package (#293)
  • Update truffle-migrate example to use latest ZeppelinOS version (#574)

Fixes

  • Fix encodeCall address handling (#569)
  • Do not delete deployment info from other networks in truffle artifacts (#415)
  • Remove legacy code from App and Lib distinction (#449)
  • Remove sinon as a main dependency (1c64175)
  • Fix ETH Gas Station integration request (8515895)