OpenZeppelin Contracts v2.5

We’re very happy the announce the release of OpenZeppelin Contracts v2.5!

This new release features:

  • EnumerableSet: similar to Solidity’s mapping, but that lets you retrieve all the keys! Useful for dapps that need to display a set of accounts with some property, and cannot rely on events alone.
  • Create2: a simple library for using the CREATE2 opcode, allowing for deployment and pre-computation of addresses when using it.
    To learn more about all the cool things you can do with it, head to Getting the Most out of CREATE2
  • ERC721Metadata.baseURI: a neat extension for massive gas savings when the token URIs share a prefix, like<id>

There are also some minor improvements, such as gas optimizations for ReentrancyGuard and additional extensibility of ERC777, among others.

For the complete list of changes, head to our changelog.

To install the new release, run:

$ npm install @openzeppelin/contracts@latest

New Documentation :books:

We’ve also recently done some some improvements to our documentation website, including new detailed guides and documentation for our other tools, such as the Test Helpers, our blazing-fast Test Environment and the OpenZeppelin Command Line Interface. Check them out for a radically better development experience!

Saying Goodbye to Solidity v0.5 :wave:

December 2019 saw the release of Solidity v0.6. This new version of the language has major improvements, and we’re already underway to release the next version of OpenZeppelin Contracts with support for Solidity v0.6.

However, it also includes a lot of breaking changes, making it difficult to support both v0.5 and v0.6 code at the same time. For this reason, we’ve decided OpenZeppelin Contracts v2.5 will be the last version supporting Solidity v0.5.

The exciting good news it that the next OpenZeppelin Contracts release will be v3.0, where we’ll get to redesign some quirky bits of the library, improving ease of use and flexibility. Stay tuned!


EnumerableSet – this is so nice. I was missing this data structure so much.


Updated the title and content reflecting the end of the release candidate period and the final 2.5 release.

1 Like

Awesome work! Will these changes be making their way to the upgrade-able contracts a la:


Hi @cthacker,

A version 2.5 of OpenZeppelin Contracts Ethereum Package equivalent to OpenZeppelin Contracts 2.5 is planned soon.

I just created a IterableMapping contract for my own use as I was sick of reimplementing it everywhere.

Guess I should have done that a long time ago.

1 Like

Considering only the ERC721 would need this I assume it would be ready pretty soon :crossed_fingers:

1 Like

Yeah the contracts ethereum package is also behind on solidity .6 so I think it needs that merged in as well.

1 Like

For anyone wanting something like EnumerableSet but with support for more types, as well as enumerable mappings:


A post was split to a new topic: Can a Proxy written in Solidity 0.5 upgrade a Solidity 0.5 contract to a Solidity 0.6 contract?