# OpenZeppelin 2.2.0

**URL:** <https://forum.openzeppelin.com/t/openzeppelin-2-2-0/408>\
**Category:** Announcements\
**Created:** [March 14, 2019, 9:54pm UTC](https://forum.openzeppelin.com/t/openzeppelin-2-2-0/408 "2019-03-14T21:54:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nventuro](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nventuro/32/8_2.png) [@nventuro](https://forum.openzeppelin.com/u/nventuro)\
**Post date:** [March 14, 2019, 9:54pm UTC](https://forum.openzeppelin.com/t/openzeppelin-2-2-0/408/1 "2019-03-14T21:54:18Z")

</div>

_No changes from the release candidate for this one, we’re ironing out the kinks from the release process! 🚫 🐛_

This minor release includes a way to store token balances and supply so that they can be later queried in a gas-efficient manner 🔖, allows safe interaction with some old, non-compliant tokens 🔒, prevents user errors when using ECDSA signatures 📝 (the magic behind metatransactions! ✨), and provides multiple minor additions and improvements to the API.

To install the release run `npm install openzeppelin-solidity@latest`.

We would love your help by reviewing newly added contracts, their interface and documentation so that we can make names clearer, features easier to use, and the library better as a whole! Your feedback is extremely useful to us 🙂

## Highlights

### New features

- `ERC20Snapshot`: this variant allows for snapshots to be created on demand, storing the current token balances and total supply so that they can be later retrieved in a gas-efficient manner and e.g. calculate dividends at a past time. ([#1617](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1617))
- `SafeERC20`: the `ERC20` standard requires that all function calls (e.g. `transfer`, `approve`, etc.) return a boolean value indicating success. However, they are multiple widely used tokens out there that return no such value: they simply `revert` when encountering an error condition. Since Solidity v0.4.22, special code was needed to interact with this non-compliant tokens: now, all of `SafeERC20` can be used to safely call both compliant and non-compliant tokens, without the developer having to worry about it. ([#1655](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1655))
- `TimedCrowdsale`: an internal `_extendTime(uint256 newClosingTime)` function was added (with a corresponding `TimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)` event) allowing for users to safely develop mechanisms to extend the durations of unclosed crowdsales. Note that due to it being internal, there’s no out-of-the-box way to do it: this feature is opt-in and must be explicitly invoked by users.

### Improvements

- `ECDSA`: `recover` no longer accepts malleable signatures (those using upper-range values for `s`, or 0/1 for `v`). This helps prevent multiple issues when using signatures as unique identifiers. Read more about common ECDSA issues [here](https://yondon.blog/2019/01/01/how-not-to-use-ecdsa/). ([#1622](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1622))
- `ERC721`'s transfers are now more gas efficient due to removal of unnecessary `SafeMath` calls. ([#1610](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1610))

### Bugfixes:

- (minor) `SafeERC20`: `safeApprove` wasn’t properly checking for a zero allowance when attempting to set a non-zero allowance. This bug was reported independently by @nikeshnazareth. Thanks a lot! ([#1647](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1647))

### Breaking changes:

- `TokenMetadata` (in drafts) has been renamed to `ERC20Metadata`. ([#1618](https://github.com/OpenZeppelin/openzeppelin-solidity/pull/1618))

You can also see all details of this release in our [changelog](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v2.2.0/CHANGELOG.md#220-2019-03-14).

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [April 26, 2019, 4:15pm UTC](https://forum.openzeppelin.com/t/openzeppelin-2-2-0/408/3 "2019-04-26T16:15:20Z")

</div>


