OpenZeppelin Contracts v3.1

We’re excited to announce the release of OpenZeppelin Contracts v3.1 :sparkles:

This is the first release since v3.0, our last major release. It includes the long-awaited ERC1155 token and helpers for safe calls and downcasts, as well as a number of minor improvements.

To install this release, run:

npm install --save-dev @openzeppelin/contracts


This is a new token standard developed by the gaming industry, focusing on gas efficiency. It’s key difference is that it is a multi-token contract: a single ERC1155 can be used to represent an arbitrary number of tokens, which is very useful in applications that require many tokens by removing the high gas costs associated with deploying them. Check out our new documentation page to learn more!.

More Replacements for call

The low-level call primitive can be hard to use correctly and is often considered unsafe. With the addition of sendValue in Contracts and try-catch in Solidity, there’s only a few scenarios in which call is still needed, the most troublesome one being forwarding calls.

The new functionCall helpers can forward call data to a recipient contract while imitating Solidity’s function call semantics, such as bubbling up revert reasons and rejecting calls to EOAs. We expect the addition of these functions to greatly reduce the need to rely on call.

Using SafeMath on Small Signed Integers

We’ve expanded the scope of the SafeCast library to also include signed integer downcasting, which allows for users that need small types (such as int8 or int32) to perform checked arithmetic on them by using SafeMath, and then downcast the result to the intended size.

What’s Next

Version 3.2 will likely include code for proxy contracts, the last big item on our Q2 2020 Roadmap. We’re also already working on EIP2612 for permit approvals in ERC20 and will include it in a release as soon as the EIP is finalized.

Fixed-point arithmetic was dropped after the Solidity team decided to implement native support for it (see this issue for some recent discussion).


OpenZeppelin Contracts Ethereum Package v3.1 should be released two weeks after OpenZeppelin Contracts v3.1.

1 Like