@openzeppelin/contracts
Advanced tools
Changelog
4.0.0 (2021-03-23)
Context
: making _msgData
return bytes calldata
instead of bytes memory
(#2492)ERC20
: removed the _setDecimals
function and the storage slot associated to decimals. (#2502)Strings
: addition of a toHexString
function. (#2504)EnumerableMap
: change implementation to optimize for key → value
lookups instead of enumeration. (#2518)GSN
: deprecate GSNv1 support in favor of upcoming support for GSNv2. (#2521)ERC165
: remove uses of storage in the base ERC165 implementation. ERC165 based contracts now use storage-less virtual functions. Old behavior remains available in the ERC165Storage
extension. (#2505)Initializable
: make initializer check stricter during construction. (#2531)ERC721
: remove enumerability of tokens from the base implementation. This feature is now provided separately through the ERC721Enumerable
extension. (#2511)AccessControl
: removed enumerability by default for a more lightweight contract. It is now opt-in through AccessControlEnumerable
. (#2512)ERC2771Context
and a MinimalForwarder
for meta-transactions. (#2508)ERC20Capped
: optimize gas usage by enforcing the check directly in _mint
. (#2524)UpgradeableProxy
to ERC1967Proxy
. (#2547)ERC777
: optimize the gas costs of the constructor. (#2551)ERC721URIStorage
: add a new extension that implements the _setTokenURI
behavior as it was available in 3.4.0. (#2555)AccessControl
: added ERC165 interface detection. (#2562)ERC1155
: make uri
public so overloading function can call it using super. (#2576)AccessControlEnumerable
: Fixed renounceRole
not updating enumerable set of addresses for a role. (#2572)Since this version has moved a few contracts to different directories, users upgrading from a previous version will need to adjust their import statements. To make this easier, the package includes a script that will migrate import statements automatically. After upgrading to the latest version of the package, run:
npx openzeppelin-contracts-migrate-imports
Make sure you're using git or another version control system to be able to recover from any potential error in our script.
Changelog
3.4.0 (2021-02-02)
BeaconProxy
: added new kind of proxy that allows simultaneous atomic upgrades. (#2411)EIP712
: added helpers to verify EIP712 typed data signatures on chain. (#2418)ERC20Permit
: added an implementation of the ERC20 permit extension for gasless token approvals. (#2237)ERC20PresetFixedSupply
and ERC777PresetFixedSupply
. (#2399)Address
: added functionDelegateCall
, similar to the existing functionCall
. (#2333)Clones
: added a library for deploying EIP 1167 minimal proxies. (#2449)Context
: moved from contracts/GSN
to contracts/utils
. (#2453)PaymentSplitter
: replace usage of .transfer()
with Address.sendValue
for improved compatibility with smart wallets. (#2455)UpgradeableProxy
: bubble revert reasons from initialization calls. (#2454)SafeMath
: fix a memory allocation issue by adding new SafeMath.tryOp(uint,uint)→(bool,uint)
functions. SafeMath.op(uint,uint,string)→uint
are now deprecated. (#2462)EnumerableMap
: fix a memory allocation issue by adding new EnumerableMap.tryGet(uint)→(bool,address)
functions. EnumerableMap.get(uint)→string
is now deprecated. (#2462)ERC165Checker
: added batch getSupportedInterfaces
. (#2469)RefundEscrow
: beneficiaryWithdraw
will forward all available gas to the beneficiary. (#2480)ERC777
: fix potential reentrancy issues for custom extensions to ERC777
. (#2483)If you're using our implementation of ERC777 from version 3.3.0 or earlier, and you define a custom _beforeTokenTransfer
function that writes to a storage variable, you may be vulnerable to a reentrancy attack. If you're affected and would like assistance please write to security@openzeppelin.com. Read more in the pull request.