v5.6.0-rc.0Pre-release
Added 13
- ERC4337Utils added paymasterSignature function to extract the signature in paymasterAndData after Entrypoint v0.9
- ERC4337Utils added paymasterData variant that receives a flag to exclude the signature from the returned data
- ERC4337Utils added variants of packValidationData that receive a ValidationRange argument for timestamp or block number
- ERC1155 introduced _checkAuthorized internal virtual function to encapsulate isApprovedForAll and msg.sender checks
- ERC4626 allows overriding underlying assets transfer mechanisms through new internal virtual functions _transferIn and _transferOut
- ERC721URIStorage added _suffixURI internal getter for retrieving custom tokenURI without the base prefix
- Added BridgeERC20Core, BridgeERC20 and BridgeERC7802 bridge contracts to handle crosschain movements of ERC-20 and ERC-7802 tokens
- Added CrosschainLinked helper contract to facilitate communication between a contract on one chain and counterparts on remote chains through ERC-7786 gateways
- Added ERC20Crosschain extension to embed an ERC-7786 based crosschain bridge directly in the token contract
- MessageHashUtils added helper functions to build EIP-712 domain typehash and separator with fields selectively enabled/disabled
- SignatureChecker added isValidERC1271SignatureNowCalldata variant that takes the signature from calldata
- Added TrieProof library for verifying Ethereum Merkle-Patricia trie inclusion proofs
- DoubleEndedQueue added tryPushBack, tryPopBack, tryPushFront, tryPopFront, tryFront, tryBack, and tryAt function variants that do not revert
Changed 7
- ERC1155 batch transfers with exactly one id/value now call IERC1155Receiver.onERC1155BatchReceived instead of onERC1155Received
- ERC1967Proxy and TransparentUpgradeableProxy now mandate initialization during construction and revert with ERC1967ProxyUninitialized if no initialize call is provided
- ERC721 and ERC1155 now prevent setting an operator for address(0)
- RLP encode(bytes32) function now encodes bytes32 as a fixed size item instead of as a scalar
- ERC4337Utils parseValidationData now returns a ValidationRange as the last return tuple value indicating whether validationData is compared against a timestamp or block number
- Account updated default version of the ERC-4337 entrypoint to v0.9
- AccountERC7579 no longer reverts and performs the uninstall if the onUninstall hook of a module reverts
From openzeppelin-contracts
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)