We’re excited to announce the release of OpenZeppelin Contracts v3.1
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 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.
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
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
int32) to perform checked arithmetic on them by using
SafeMath, and then downcast the result to the intended size.
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.