Releases: OpenZeppelin/openzeppelin-contracts-upgradeable
Releases · OpenZeppelin/openzeppelin-contracts-upgradeable
v5.6.0-rc.0
Breaking changes
ERC1155: Performing batch transfers with exactly one id/value in the batch no-longer callsIERC1155Receiver.onERC1155Received.IERC1155Receiver.onERC1155BatchReceivedis called instead (with arrays of length one). (#6170)ERC1967ProxyandTransparentUpgradeableProxy: Mandate initialization during construction. Deployment now reverts withERC1967ProxyUninitializedif an initialize call is not provided. Developers that rely on the previous behavior and want to disable this check can do so by overriding the internal_unsafeAllowUninitializedfunction to return true. (#5906)ERC721andERC1155: Prevent setting an operator foraddress(0). In the case ofERC721this type of operator allowance could lead to obfuscated mint permission. (#6171)RLP: Theencode(bytes32)function now encodesbytes32as a fixed size item and not as a scalar inencode(uint256). Users must replace calls toencode(bytes32)withencode(uint256(bytes32))to preserve the same behavior. (#6167)ERC4337Utils: TheparseValidationDatanow returns aValidationRangeas the last return tuple value indicating whether thevalidationDatais compared against a timestamp or block number. Developers must update their code to handle this new return value (e.g.(aggregator, validAfter, validUntil) -> (aggregator, validAfter, validUntil, range)). (#6215)
Changes by category
Account
Account: Update default version of the ERC-4337 entrypoint to v0.9. (#6135)AccountERC7579: Do not revert and perform the uninstall if theonUninstallhook of a module reverts. (#6142)ERC4337Utils: Added thepaymasterSignaturefunction to extract the signature inpaymasterAndDataafter Entrypoint v0.9. Similarly, a variant ofpaymasterDatathat receives a flag to exclude the signature from the returned data. (#6215)ERC4337Utils: Added variants ofpackValidationData(address,uint48,uint48)andpackValidationData(bool,uint48,uint48)that receive aValidationRangeargument, could be timestamp or block number. Similarly, theparseValidationDatanow returns aValidationRangetoo. (#6215)
Tokens
ERC1155: Introduce the_checkAuthorizedinternal virtual function to encapsulateisApprovedForAllandmsg.sender == fromchecks. (#6133)ERC1155: CallIERC1155Receiver.onERC1155BatchReceivedwhen performing a batch transfers with exactly one id/value in the batch. (#6170)ERC4626: Allow overriding underlying assets transfer mechanisms through new internal virtual functions (_transferInand_transferOut). (#5970)ERC721URIStorage: Add_suffixURI, an internal getter for retrieving the custom tokenURI without the base prefix. (#6175)
Cross-chain
BridgeERC20Core,BridgeERC20andBridgeERC7802: Added bridge contracts to handle crosschain movements of ERC-20 (and ERC-7802) tokens. (#5914)CrosschainLinked: Added a new helper contract to facilitate communication between a contract on one chain and counterparts on remote chains through ERC-7786 gateways. (#5914)ERC20Crosschain: Added an ERC-20 extension to embed an ERC-7786 based crosschain bridge directly in the token contract. (#5914)
Cryptography
MessageHashUtils: Add helper functions to build EIP-712 domain typehash and separator with fields selectively enabled/disabled. (#5908)SignatureChecker: AddisValidERC1271SignatureNowCalldata, a variant ofisValidERC1271SignatureNowthat takes the signature from calldata. (#6123)TrieProof: Add library for verifying Ethereum Merkle-Patricia trie inclusion proofs. (#5826)
Structures
DoubleEndedQueue: AddtryPushBack,tryPopBack,tryPushFront,tryPopFront,tryFront,tryBack, andtryAtfunction variants that do not revert. (#6020)EnumerableMap: Add support forBytes4ToAddressMaptypes. (#6091)EnumerableSet: Add support forBytes4Settype. (#6091)
Utils
Arrays: Addreplacefunctions enabling in-place array modification ofaddress[],bytes32[]anduint256[]arrays, with new content from another array. (#5995)Arrays: Addsliceandsplicefunctions for value types (uint256[],bytes32[],address[]). (#5965)Bytes: Addreplacefunctions that replaces a portion of a bytes buffer with content from another buffer. (#5995)Bytes: Add thetoNibblesfunction that expands the nibbles (4 bits chunk) of abytesbuffer. Used for manipulating Patricia Merkle Trees keys and paths. (#5826)RLP: Encodebytes32as a fixed size item and not as a scalar inencode(bytes32). Scalar RLP encoding remains available by casting to auint256and using theencode(uint256)function. (#6167)RLP: Fix RLP encoding validity check when decoding long lists or strings (#6051)
v5.5.0
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)
v5.5.0-rc.1
Bug fixes
AccountERC7579: Prevent revert inisModuleInstalledfor fallback modules whenadditionalContexthas fewer than 4 bytes. The function now returnsfalseinstead of reverting, ensuring ERC-7579 compliance. (#5961)
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)
Changes by category
Utils
Arrays: Addsliceandsplicefunctions for value types (uint256[],bytes32[],address[]). (#5983)
v5.5.0-rc.0
Bug fixes
ERC165Checker: Ensure thesupportsERC165function returns false if the target reverts during thesupportsInterface(0xffffffff)call. (#5810)
Breaking changes
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
Votes,VotesExtended,ERC20Votes,Strings,ERC1155URIStorage,MessageHashUtils,ERC721URIStorage,ERC721Votes,ERC721Wrapper,ERC721Burnable,ERC721Consecutive,ERC721Enumerable,ERC721Pausable,ERC721Royalty,ERC721Wrapper,EIP712,ERC4626andERC7739. (#5726)
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
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)
v5.4.0
Breaking changes
- Update minimum pragma to 0.8.24 in
SignatureChecker,Governorand Governor's extensions. (#5716).
Pragma changes
- Reduced pragma requirement of interface files
Changes by category
Account
Account: Added a simple ERC-4337 account implementation with minimal logic to process user operations. (#5657)AccountERC7579: Extension ofAccountthat implements support for ERC-7579 modules of type executor, validator, and fallback handler. (#5657)AccountERC7579Hooked: Extension ofAccountERC7579that implements support for ERC-7579 hook modules. (#5657)EIP7702Utils: Add a library for checking if an address has an EIP-7702 delegation in place. (#5587)IERC7821,ERC7821: Interface and logic for minimal batch execution. No support for additionalopDatais included. (#5657)
Governance
GovernorNoncesKeyed: Extension ofGovernorthat adds support for keyed nonces when voting by sig. (#5574)
Tokens
ERC20Bridgeable: Implementation of ERC-7802 that makes an ERC-20 compatible with crosschain bridges. (#5739)
Cryptography
Signers
AbstractSigner,SignerECDSA,SignerP256, andSignerRSA: Add an abstract contract and various implementations for contracts that deal with signature verification. (#5657)SignerERC7702: Implementation ofAbstractSignerfor Externally Owned Accounts (EOAs). Useful with ERC-7702. (#5657)SignerERC7913: Abstract signer that verifies signatures using the ERC-7913 workflow. (#5659)MultiSignerERC7913: Implementation ofAbstractSignerthat supports multiple ERC-7913 signers with a threshold-based signature verification system. (#5659)MultiSignerERC7913Weighted: Extension ofMultiSignerERC7913that supports assigning different weights to each signer, enabling more flexible governance schemes. (#5741)
Verifiers
ERC7913P256VerifierandERC7913RSAVerifier: Ready to use ERC-7913 verifiers that implement key verification for P256 (secp256r1) and RSA keys. (#5659)
Other
SignatureChecker: Add support for ERC-7913 signatures alongside existing ECDSA and ERC-1271 signature verification. (#5659)ERC7739: An abstract contract to validate signatures following the rehashing scheme fromERC7739Utils. (#5664)ERC7739Utils: Add a library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on the ERC-7739. (#5664)
Structures
EnumerableMap: Add support forBytesToBytesMaptype. (#5658)EnumerableMap: Addkeys(uint256,uint256)that returns a subset (slice) of the keys in the map. (#5713)EnumerableSet: Add support forStringSetandBytesSettypes. (#5658)EnumerableSet: Addvalues(uint256,uint256)that returns a subset (slice) of the values in the set. (#5713)
Utils
Arrays: AddunsafeAccess,unsafeMemoryAccessandunsafeSetLengthforbytes[]andstring[]. (#5568)Blockhash: Add a library that provides access to historical block hashes using EIP-2935's history storage, extending the standard 256-block limit to 8191 blocks. (#5642)Bytes: FixlastIndexOf(bytes,byte,uint256)with empty buffers and finite position to correctly returntype(uint256).maxinstead of accessing uninitialized memory sections. (#5797)
v5.4.0-rc.1
- Add constructors to the different signers.
v5.4.0-rc.0
Breaking changes
- Update minimum pragma to 0.8.24 in
SignatureChecker,Governorand Governor's extensions. (#5716).
Pragma changes
- Reduced pragma requirement of interface files
Changes by category
Account
Account: Added a simple ERC-4337 account implementation with minimal logic to process user operations. (#5657)AccountERC7579: Extension ofAccountthat implements support for ERC-7579 modules of type executor, validator, and fallback handler. (#5657)AccountERC7579Hooked: Extension ofAccountERC7579that implements support for ERC-7579 hook modules. (#5657)EIP7702Utils: Add a library for checking if an address has an EIP-7702 delegation in place. (#5587)IERC7821,ERC7821: Interface and logic for minimal batch execution. No support for additionalopDatais included. (#5657)
Governance
GovernorNoncesKeyed: Extension ofGovernorthat adds support for keyed nonces when voting by sig. (#5574)
Tokens
ERC20Bridgeable: Implementation of ERC-7802 that makes an ERC-20 compatible with crosschain bridges. (#5739)
Cryptography
Signers
AbstractSigner,SignerECDSA,SignerP256, andSignerRSA: Add an abstract contract and various implementations for contracts that deal with signature verification. (#5657)SignerERC7702: Implementation ofAbstractSignerfor Externally Owned Accounts (EOAs). Useful with ERC-7702. (#5657)SignerERC7913: Abstract signer that verifies signatures using the ERC-7913 workflow. (#5659)MultiSignerERC7913: Implementation ofAbstractSignerthat supports multiple ERC-7913 signers with a threshold-based signature verification system. (#5659)MultiSignerERC7913Weighted: Extension ofMultiSignerERC7913that supports assigning different weights to each signer, enabling more flexible governance schemes. (#5741)
Verifiers
ERC7913P256VerifierandERC7913RSAVerifier: Ready to use ERC-7913 verifiers that implement key verification for P256 (secp256r1) and RSA keys. (#5659)
Other
SignatureChecker: Add support for ERC-7913 signatures alongside existing ECDSA and ERC-1271 signature verification. (#5659)ERC7739: An abstract contract to validate signatures following the rehashing scheme fromERC7739Utils. (#5664)ERC7739Utils: Add a library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on the ERC-7739. (#5664)
Structures
EnumerableMap: Add support forBytesToBytesMaptype. (#5658)EnumerableMap: Addkeys(uint256,uint256)that returns a subset (slice) of the keys in the map. (#5713)EnumerableSet: Add support forStringSetandBytesSettypes. (#5658)EnumerableSet: Addvalues(uint256,uint256)that returns a subset (slice) of the values in the set. (#5713)
Utils
v5.3.0
Breaking Changes
- Replace
GovernorCountingOverridable.VoteReceiptstruct parameter member nameshasOverridenandoverridenWeightforhasOverriddenandoverriddenWeightrespectively.
Custom error changes
- Replace
GovernorAlreadyOverridenVotewithGovernorAlreadyOverriddenVote. - Replace
GovernorOnlyProposerwithGovernorUnableToCancel.
Changes by category
Account
ERC4337Utils: Update thehashfunction to callgetUserOpHashon the specified entrypoint and add anENTRYPOINT_V08constant. (#5614)ERC7579Utils: Add ABI decoding checks on calldata bounds withindecodeBatch. (#5371)ERC7579Utils: Replaceaddress(0)withaddress(this)during execution for calldata compression efficiency. (#5614)
Governance
IGovernor: Add thegetProposalIdfunction to the governor interface. (#5290)GovernorProposalGuardian: Add a governance extension that defines a proposal guardian who can cancel proposals at any stage in their lifecycle. (#5303)GovernorSequentialProposalId: Adds aGovernorextension that sequentially numbers proposal ids instead of using the hash. (#5290)GovernorSuperQuorum: Add a governance extension to support a super quorum. Proposals that meet the super quorum (and have a majority of for votes) advance to theSucceededstate before the proposal deadline. (#5526)GovernorVotesSuperQuorumFraction: Add a variant of theGovernorSuperQuorumextensions where the super quorum is expressed as a fraction of the total supply. (#5526)TimelockController: Receive function is now virtual. (#5509)
Structures
EnumerableSet: Addclearfunction to EnumerableSets which deletes all values in the set. (#5486)EnumerableMap: Addclearfunction to EnumerableMaps which deletes all entries in the map. (#5486)MerkleTree: Add an update function that replaces a previously inserted leaf with a new value, updating the tree root along the way. (#5526)
Tokens
ERC4626: Use theassetgetter intotalAssets,_depositand_withdraw. (#5322)IERC6909: Add the interface for ERC-6909. (#5343)ERC6909: Add a standard implementation of ERC6909. (#5394)ERC6909TokenSupply: Add an extension of ERC6909 which tracks total supply for each token id. (#5394)ERC6909Metadata: Add an extension of ERC6909 which adds metadata functionality. (#5394)ERC6909ContentURI: Add an extension of ERC6909 which adds content URI functionality. (#5394)SafeERC20: AddtrySafeTransferandtrySafeTransferFromthat do not revert and return false if the transfer is not successful. (#5483)
Other
Address: bubble up revert data onsendValuefailed call. (#5379)Calldata: Library withemptyBytesandemptyStringfunctions to generate emptybytesandstringcalldata types. (#5422)ERC2771Forwarder: Expose the_isTrustedByTargetinternal function to check whether a target trusts the forwarder. (#5416)Hashes: ExposeefficientKeccak256for hashing non-commutative pairs of bytes32 without allocating extra memory. (#5442)Initializable: Add_initializableStorageSlotfunction that returns a pointer to the storage struct. The function allows customizing with a custom storage slot with anoverride. (#5526)Math: Addadd512,mul512andmulShr. (#5526)Math: Add saturating arithmetic operationssaturatingAdd,saturatingSubandsaturatingMul. (#5526)MessageHashUtils: AddtoDataWithIntendedValidatorHash(address, bytes32). (#5526)P256: Adjust precompile detection inverifyNativeto consider emptyreturndataon invalid verification. Previously, invalid signatures would've reverted with aMissingPrecompileerror in chains with RIP-7212 support. (#5620)Pausable: Stop explicitly settingpausedtofalseduring construction. (#5448)Strings: AddespaceJSONthat escapes special characters in JSON strings. (#5526)
v5.3.0-rc.0
Breaking Changes
- Replace
GovernorCountingOverridable.VoteReceiptstruct parameter member nameshasOverridenandoverridenWeightforhasOverriddenandoverriddenWeightrespectively.
Custom error changes
- Replace
GovernorAlreadyOverridenVotewithGovernorAlreadyOverriddenVote.
Changes by category
Account
ERC7579Utils: Add ABI decoding checks on calldata bounds withindecodeBatch. (#5371)
Governance
IGovernor: Add thegetProposalIdfunction to the governor interface. (#5290)GovernorProposalGuardian: Add a governance extension that defines a proposal guardian who can cancel proposals at any stage in their lifecycle. (#5303)GovernorSequentialProposalId: Adds aGovernorextension that sequentially numbers proposal ids instead of using the hash. (#5290)GovernorSuperQuorum: Add a governance extension to support a super quorum. Proposals that meet the super quorum (and have a majority of for votes) advance to theSucceededstate before the proposal deadline. (#5526)GovernorVotesSuperQuorumFraction: Add a variant of theGovernorSuperQuorumextensions where the super quorum is expressed as a fraction of the total supply. (#5526)TimelockController: Receive function is now virtual. (#5509)
Structures
EnumerableSet: Addclearfunction to EnumerableSets which deletes all values in the set. (#5486)EnumerableMap: Addclearfunction to EnumerableMaps which deletes all entries in the map. (#5486)MerkleTree: Add an update function that replaces a previously inserted leaf with a new value, updating the tree root along the way. (#5526)
Tokens
ERC4626: Use theassetgetter intotalAssets,_depositand_withdraw. (#5322)IERC6909: Add the interface for ERC-6909. (#5343)ERC6909: Add a standard implementation of ERC6909. (#5394)ERC6909TokenSupply: Add an extension of ERC6909 which tracks total supply for each token id. (#5394)ERC6909Metadata: Add an extension of ERC6909 which adds metadata functionality. (#5394)ERC6909ContentURI: Add an extension of ERC6909 which adds content URI functionality. (#5394)SafeERC20: AddtrySafeTransferandtrySafeTransferFromthat do not revert and return false if the transfer is not successful. (#5483)
Other
Address: bubble up revert data onsendValuefailed call. (#5379)Calldata: Library withemptyBytesandemptyStringfunctions to generate emptybytesandstringcalldata types. (#5422)ERC2771Forwarder: Expose the_isTrustedByTargetinternal function to check whether a target trusts the forwarder. (#5416)Hashes: ExposeefficientKeccak256for hashing non-commutative pairs of bytes32 without allocating extra memory. (#5442)Initializable: Add_initializableStorageSlotfunction that returns a pointer to the storage struct. The function allows customizing with a custom storage slot with anoverride. (#5526)Math: Addadd512,mul512andmulShr. (#5526)Math: Add saturating arithmetic operationssaturatingAdd,saturatingSubandsaturatingMul. (#5526)MessageHashUtils: AddtoDataWithIntendedValidatorHash(address, bytes32). (#5526)Pausable: Stop explicitly settingpausedtofalseduring construction. (#5448)Strings: AddespaceJSONthat escapes special characters in JSON strings. (#5526)
v5.2.0
Breaking Changes
Custom error changes
This version comes with changes to the custom error identifiers. Contracts previously depending on the following errors should be replaced accordingly:
- Replace
Errors.FailedCallwith a bubbled-up revert reason inAddress.sendValue.
Changes by category
General
- Update some pragma directives to ensure that all file requirements match that of the files they import. (#5273)
Account
ERC4337Utils: Add a reusable library to manipulate user operations and interact with ERC-4337 contracts (#5274)ERC7579Utils: Add a reusable library to interact with ERC-7579 modular accounts (#5274)
Governance
GovernorCountingOverridable: Add a governor counting module that enables token holders to override the vote of their delegate. (#5192)VotesExtended: Create an extension ofVoteswhich checkpoints balances and delegates. (#5192)
Proxy
Clones: AddcloneWithImmutableArgsandcloneDeterministicWithImmutableArgsvariants that create clones with per-instance immutable arguments. The immutable arguments can be retrieved usingfetchCloneArgs. The correspondingpredictDeterministicWithImmutableArgsfunction is also included. (#5109)
Tokens
ERC1363Utils: Add helper similar to the existingERC721UtilsandERC1155Utils(#5133)
Utils
Address: bubble up revert data onsendValuefailed call (#5418)Bytes: Add a library of common operations that operate onbytesobjects. (#5252)CAIP2andCAIP10: Add libraries for formatting and parsing CAIP-2 and CAIP-10 identifiers. (#5252)NoncesKeyed: Add a variant ofNoncesthat implements the ERC-4337 entrypoint nonce system. (#5272)Packing: Add variants for packingbytes10andbytes22(#5274)Strings: AddparseUint,parseInt,parseHexUintandparseAddressto parse strings into numbers and addresses. Also provide variants of these functions that parse substrings, andtryXxxvariants that do not revert on invalid input. (#5166)