@openzeppelin/contracts
Advanced tools
Changelog
2.5.0 (2020-02-04)
SafeCast.toUintXX
: new library for integer downcasting, which allows for safe operation on smaller types (e.g. uint32
) when combined with SafeMath
. (#1926)ERC721Metadata
: added baseURI
, which can be used for dramatic gas savings when all token URIs share a prefix (e.g. http://api.myapp.com/tokens/<id>
). (#1970)EnumerableSet
: new library for storing enumerable sets of values. Only AddressSet
is supported in this release. (#2061)Create2
: simple library to make usage of the CREATE2
opcode easier. (#1744)ERC777
: _burn
is now internal, providing more flexibility and making it easier to create tokens that deflate. (#1908)ReentrancyGuard
: greatly improved gas efficiency by using the net gas metering mechanism introduced in the Istanbul hardfork. (#1992, #1996)ERC777
: improve extensibility by making _send
and related functions internal
. (#2027)ERC721
: improved revert reason when transferring tokens to a non-recipient contract. (#2018)ERC165Checker
now requires a minimum Solidity compiler version of 0.5.10. (#1829)Changelog
2.4.0 (2019-10-29)
Address.toPayable
: added a helper to convert between address types without having to resort to low-level casting. (#1773)Address.sendValue
: added a replacement to Solidity's transfer
, removing the fixed gas stipend. (#1962)PullPayment.withdrawPaymentsWithGas(address payable payee)
Escrow.withdrawWithGas(address payable payee)
SafeMath
: added support for custom error messages to sub
, div
and mod
functions. (#1828)Address.isContract
: switched from extcodesize
to extcodehash
for less gas usage. (#1802)ERC20
and ERC777
updated to throw custom errors on subtraction overflows. (#1828)PullPayment.withdrawPayments(address payable payee)
Escrow.withdraw(address payable payee)
Changelog
2.3.0 (2019-05-27)
ERC1820
: added support for interacting with the ERC1820 registry contract (IERC1820Registry
), as well as base contracts that can be registered as implementers there. (#1677)ERC777
: support for the ERC777 token, which has multiple improvements over ERC20
(but is backwards compatible with it) such as built-in burning, a more straightforward permission system, and optional sender and receiver hooks on transfer (mandatory for contracts!). (#1684)PostDeliveryCrowdsale
: some validations where skipped when paired with other crowdsale flavors, such as AllowanceCrowdsale
, or MintableCrowdsale
and ERC20Capped
, which could cause buyers to not be able to claim their purchased tokens. (#1721)ERC20._transfer
: the from
argument was allowed to be the zero address, so it was possible to internally trigger a transfer of 0 tokens from the zero address. This address is not a valid destinatary of transfers, nor can it give or receive allowance, so this behavior was inconsistent. It now reverts. (#1752)