v5.5.0
Added 10
- InteroperableAddress: Add a library for formatting and parsing ERC-7930 interoperable addresses
- ERC7786Recipient: Generic ERC-7786 cross-chain message recipient contract
- IERC7786: Add the interface for ERC-7786 Cross-Chain Messaging Gateway
- SignerWebAuthn: Add an abstract signer that verifies WebAuthn signatures with a P256 fallback
- Add constructors to the different signers
- ERC7913WebAuthnVerifier: Add an ERC-7913 verifier that verifies WebAuthn Authentication Assertions for P256 identities
- WebAuthn: Add a library for verifying WebAuthn Authentication Assertions
- ECDSA: Add parse and parseCalldata to parse bytes signatures of length 65 or 64 into v, r, s components
- ECDSA: Add recoverCalldata and tryRecoverCalldata, variants of recover and tryRecover that are more efficient when signatures are in calldata
- SignatureChecker: Add isValidSignatureNowCalldata for efficient processing of calldata signatures
Changed 5
- Account: Add signature argument to the internal _validateUserOp function for custom signature handling logic
- AccountERC7579: Installing and uninstalling fallback modules now require initData and deInitData arguments to be at least 4 bytes long and reverts with ERC7579CannotDecodeFallbackData instead of treating missing bytes as 0x00
- ERC6909 and its extensions are no longer marked as draft since EIP-6909 is now final, requiring updated import paths
- Update minimum pragma to 0.8.24 in AccessControlEnumerable, Arrays, CircularBuffer, EIP712, EnumerableMap, EnumerableSet, ERC1155, ERC1155Burnable, ERC1155Pausable, ERC1155Supply, ERC1155URIStorage, ERC20Votes, ERC4626, ERC721Burnable, ERC721Consecutive, ERC721Enumerable, ERC721Pausable, ERC721Royalty, ERC721URIStorage, ERC721Votes, ERC721Wrapper, ERC7739, Heap, MerkleTree, MessageHashUtils, Strings, Votes and VotesExtended
- ERC4626: Compute maxWithdraw using maxRedeem and previewRedeem so that changes to the preview functions affect the max functions
Fixed 2
- AccountERC7579: Prevent revert in isModuleInstalled for fallback modules when additionalContext has fewer than 4 bytes, returning false instead to ensure ERC-7579 compliance
- ERC165Checker: Ensure supportsERC165 function returns false if the target reverts during the supportsInterface(0xffffffff) call
Removed 2
- SignerERC7702 is renamed to SignerEIP7702, requiring updated imports and inheritance
- ERC721Holder, ERC1155Holder, ReentrancyGuard and ReentrancyGuardTransient are flagged as stateless and are no longer transpiled
Deprecated 2
- Initializable and UUPSUpgradeable are no longer transpiled; an alias is present in the @openzeppelin/contracts-upgradeable package that will be removed in the next major release
- ECDSA signature malleability protection is partly deprecated
From openzeppelin-contracts
Bug fixes
AccountERC7579: Prevent revert inisModuleInstalledfor fallback modules whenadditionalContexthas fewer than 4 bytes. The function now returnsfalseinstead of reverting, ensuring ERC-7579 compliance. (#5961)ERC165Checker: Ensure thesupportsERC165function returns false if the target reverts during thesupportsInterface(0xffffffff)call. (#5810)
Breaking changes
Account: Addsignatureargument to the internal_validateUserOpfunction for custom signature handling logic. Developers overriding it must now provide the signature from the user operation (i.e.userOp.signature) to keep compatibility. (#5976)AccountERC7579: Installing and uninstalling fallback modules now require the correspondinginitDataanddeInitDataarguments to be at least 4 bytes long (matching the selector to which the fallback module is registered). It now reverts withERC7579CannotDecodeFallbackDatainstead of treating the missing bytes as0x00. (#5974)ERC6909and its extensions (ERC6909ContentURI,ERC6909MetadataandERC6909TokenSupply) are no longer marked as draft since EIP-6909 is now final. Developers must update the import paths. Contracts behavior is not modified. (#5929)SignerERC7702is renamed asSignerEIP7702. Imports and inheritance must be updated to that new name and path. Behavior is unmodified. (#5932)ERC721Holder,ERC1155Holder,ReentrancyGuardandReentrancyGuardTransientare flagged as stateless and are no longer transpiled. Developers using their upgradeable variants from@openzeppelin/contracts-upgradeablemust update their imports to use the equivalent version available in@openzeppelin/contracts. (#5944, #5942)- Update minimum pragma to 0.8.24 in
AccessControlEnumerable,Arrays,CircularBuffer,EIP712,EnumerableMap,EnumerableSet,ERC1155,ERC1155Burnable,ERC1155Pausable,ERC1155Supply,ERC1155URIStorage,ERC20Votes,ERC4626,ERC721Burnable,ERC721Consecutive,ERC721Enumerable,ERC721Pausable,ERC721Royalty,ERC721URIStorage,ERC721Votes,ERC721Wrapper,ERC7739,Heap,MerkleTree,MessageHashUtils,Strings,VotesandVotesExtended. (#5723, #5726, #5965)
Deprecation
InitializableandUUPSUpgradeableare no longer transpiled. An alias is present in the@openzeppelin/contracts-upgradeablepackage that redirect to the corresponding file in@openzeppelin/contracts. These alias will be removed in the next major release. Developers are advised to update their imports to get these files directly from the@openzeppelin/contractspackage. #5941ECDSAsignature malleability protection is partly deprecated. See documentation for more details. #5814
Changes by category
Tokens
ERC4626: computemaxWithdrawusingmaxRedeemandpreviewRedeemso that changes to the preview functions affect the max functions. (#5130)
Cross-chain
InteroperableAddress: Add a library for formatting and parsing ERC-7930 interoperable addresses. (#5736)ERC7786Recipient: Generic ERC-7786 cross-chain message recipient contract. (#5904)IERC7786: Add the (draft) interface for ERC-7786 "Cross-Chain Messaging Gateway" (#5737)
Cryptography
Signers
SignerWebAuthn: Add an abstract signer that verifies WebAuthn signatures, with a P256 fallback. (#5809)- Add constructors to the different signers. (#5757)
Verifiers
ERC7913WebAuthnVerifier: Add an ERC-7913 verifier that verifies WebAuthn Authentication Assertions for P256 identities. (#5809)
Other
WebAuthn: Add a library for verifying WebAuthn Authentication Assertions. (#5809)ECDSA: AddparseandparseCalldatato parse bytes signatures of length 65 or 64 (erc-2098) into its v,r,s components. (#5814)ECDSA: AddrecoverCalldataandtryRecoverCalldata, variants ofrecoverandtryRecoverthat are more efficient when signatures are in calldata. (#5788)SignatureChecker: AddisValidSignatureNowCalldata(address,bytes32,bytes calldata)for efficient processing of calldata signatures. (#5788)
Structures
Checkpoints: Add a new checkpoint variantCheckpoint256usinguint256type for the value and key. (#5748)Accumulators: A library for merging an arbitrary dynamic number of bytes buffers. (#5680)
Utils
Arrays: Addsliceandsplicefunctions for value types (uint256[],bytes32[],address[]). (#5983)Base58: Add a library for encoding and decoding bytes buffers into base58 strings. (#5762)Base64: Add a newdecodefunction that parses base64 encoded strings. (#5765)Bytes: Addconcatthat merges abytes[]array of buffers into a singlebytesbuffer. (#5882)Bytes: AddreverseBytes32,reverseBytes16,reverseBytes8,reverseBytes4, andreverseBytes2functions to reverse byte order for converting between little-endian and big-endian representations. (#5724)Bytes: Addsplice(bytes,uint256)andsplice(bytes,uint256,uint256)functions that move a specified range of bytes to the start of the buffer and truncate it in place, as an alternative toslice. (#5733)Bytes: Add aclzfunction to count the leading zero bits in abytesbuffer. (#5725)Bytes: Add anequalfunction to compare byte buffers. (#5726)Bytes: FixlastIndexOf(bytes,byte,uint256)with empty buffers and finite position to correctly returntype(uint256).maxinstead of accessing uninitialized memory sections. (#5797)IERC7751: Add the interface for custom error wrapping of bubbled up reverts. (#5816)LowLevelCall: Add a library to perform low-level calls and deal with thereturndatamore granularly. (#5094)Math: Add aclzfunction to count the leading zero bits in auint256value. (#5725)Memory: Add library with utilities to manipulate memory (#5189)Memory: Add a UDVT for handling slices on memory space similarly to calldata slices. (#5680)ReentrancyGuardandReentrancyGuardTransient: AddnonReentrantView, a read-only version of thenonReentrantmodifier. (#5800)ReentrancyGuard,ReentrancyGuardTransient: Add an internal_reentrancyGuardStorageSlotfunction allowing slot customization via override. (#5892)RelayedCall: Add a library to perform indirect calls through minimal and predictable relayers. (#5630)RLP: Add a library for encoding and decoding data in Ethereum's Recursive Length Prefix format. (#5680)Strings: AddtoHexString(bytes). (#5761)