Releases: OpenZeppelin/openzeppelin-contracts-upgradeable
v4.4.1
Initializable: change the existinginitializermodifier and add a newonlyInitializingmodifier to prevent reentrancy risk. (#3006)
Breaking change
It is no longer possible to call an initializer-protected function from within another initializer function outside the context of a constructor. Projects using OpenZeppelin upgradeable proxies should continue to work as is, since in the common case the initializer is invoked in the constructor directly. If this is not the case for you, the suggested change is to use the new onlyInitializing modifier in the following way:
contract A {
- function initialize() public initializer { ... }
+ function initialize() internal onlyInitializing { ... }
}
contract B is A {
function initialize() public initializer {
A.initialize();
}
}v4.4.0
Check out the first OpenZeppelin Community Call where the team discussed everything that is included in this release.
And if you missed it, we recently announced an official bug bounty program for OpenZeppelin Contracts. Check it out!
Ownable: add an internal_transferOwnership(address). (#2568)AccessControl: add internal_grantRole(bytes32,address)and_revokeRole(bytes32,address). (#2568)AccessControl: mark_setupRole(bytes32,address)as deprecated in favor of_grantRole(bytes32,address). (#2568)AccessControlEnumerable: hook into_grantRole(bytes32,address)and_revokeRole(bytes32,address). (#2946)EIP712: cacheaddress(this)to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. (#2852)- Add internal
_setApprovalForAlltoERC721andERC1155. (#2834) Governor: shift vote start and end by one block to better match Compound's GovernorBravo and prevent voting at the Governor level if the voting snapshot is not ready. (#2892)GovernorCompatibilityBravo: consider quorum an inclusive rather than exclusive minimum to match Compound's GovernorBravo. (#2974)GovernorSettings: a new governor module that manages voting settings updatable through governance actions. (#2904)PaymentSplitter: now supports ERC20 assets in addition to Ether. (#2858)ECDSA: add a variant oftoEthSignedMessageHashfor arbitrary length message hashing. (#2865)MerkleProof: add aprocessProoffunction that returns the rebuilt root hash given a leaf and a proof. (#2841)VestingWallet: new contract that handles the vesting of Ether and ERC20 tokens following a customizable vesting schedule. (#2748)Governor: enable receiving Ether when a Timelock contract is not used. (#2748)GovernorTimelockCompound: fix ability to use Ether stored in the Timelock contract. (#2748)
v4.3.3
ERC1155Supply: HandletotalSupplychanges by hooking into_beforeTokenTransferto ensure consistency of balances and supply duringIERC1155Receiver.onERC1155Receivedcalls.
v4.3.2
UUPSUpgradeable: Add modifiers to preventupgradeToandupgradeToAndCallbeing executed on any contract that is not the active ERC1967 proxy. This prevents these functions being called on implementation contracts or minimal ERC1167 clones, in particular.
v4.3.1
TimelockController: Add additional isOperationReady check.
v3.4.2-solc-0.7
TimelockController: Add additional isOperationReady check.
v3.4.2
v4.3.0
Visit our blog for the full 4.3 announcement as well as Governor announcement!
ERC2771Context: use private variable from storage to store the forwarder address. Fixes issues where_msgSender()was not callable from constructors. (#2754)EnumerableSet: addvalues()functions that returns an array containing all values in a single call. (#2768)Governor: added a modular system ofGovernorcontracts based onGovernorAlphaandGovernorBravo. (#2672)- Add an
interfacesfolder containing solidity interfaces to final ERCs. (#2517) ECDSA: addtryRecoverfunctions that will not throw if the signature is invalid, and will return an error flag instead. (#2661)SignatureChecker: Reduce gas usage of theisValidSignatureNowfunction for the "signature by EOA" case. (#2661)
v4.2.0
Read the full announcement in the blog!
ERC20Votes: add a new extension of theERC20token with support for voting snapshots and delegation. (#2632)ERC20VotesComp: Variant ofERC20Votesthat is compatible with Compound'sComptoken interface but restricts supply touint96. (#2706)ERC20Wrapper: add a new extension of theERC20token which wraps an underlying token. Deposit and withdraw guarantee that the total supply is backed by a corresponding amount of underlying token. (#2633)- Enumerables: Improve gas cost of removal in
EnumerableSetandEnumerableMap. - Enumerables: Improve gas cost of lookup in
EnumerableSetandEnumerableMap. Counter: add a reset method. (#2678)- Tokens: Wrap definitely safe subtractions in
uncheckedblocks. Math: Add aceilDivmethod for performing ceiling division.ERC1155Supply: add a newERC1155extension that keeps track of the totalSupply of each tokenId. (#2593)BitMaps: add a newBitMapslibrary that provides a storage efficient datastructure foruint256toboolmapping with contiguous keys. (#2710)
Breaking Changes
ERC20FlashMintis no longer a Draft ERC. (#2673))
How to update: Change your import paths by removing the draft- prefix from @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol.
v4.1.0
Read the full announcement in the blog or check out the changelog.
IERC20Metadata: add a new extended interface that includes the optionalname(),symbol()anddecimals()functions. (#2561)ERC777: make reception acquirement optional in_mint. (#2552)ERC20Permit: add a_useNonceto enable further usage of ERC712 signatures. (#2565)ERC20FlashMint: add an implementation of the ERC3156 extension for flash-minting ERC20 tokens. (#2543)SignatureChecker: add a signature verification library that supports both EOA and ERC1271 compliant contracts as signers. (#2532)Multicall: add abstract contract withmulticall(bytes[] calldata data)function to bundle multiple calls together (#2608)ECDSA: add support for ERC2098 short-signatures. (#2582)AccessControl: add aonlyRolemodifier to restrict specific function to callers bearing a specific role. (#2609)StorageSlot: add a library for reading and writing primitive types to specific storage slots. (#2542)- UUPS Proxies: add
UUPSUpgradeableto implement the UUPS proxy pattern together withEIP1967Proxy. (#2542)