diff --git a/contracts/utils/cryptography/ERC7739Utils.sol b/contracts/utils/cryptography/ERC7739Utils.sol index eed6acd..bcf6de3 100644 --- a/contracts/utils/cryptography/ERC7739Utils.sol +++ b/contracts/utils/cryptography/ERC7739Utils.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.20; +import {Calldata} from "@openzeppelin/contracts/utils/Calldata.sol"; + /** * @dev Utilities to process https://ercs.ethereum.org/ERCS/erc-7739[ERC-7739] typed data signatures * that are specific to an EIP-712 domain. @@ -71,13 +73,13 @@ library ERC7739Utils { unchecked { uint256 sigLength = encodedSignature.length; - if (sigLength < 4) return (_emptyCalldataBytes(), 0, 0, _emptyCalldataString()); + if (sigLength < 4) return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); uint256 contentsDescrEnd = sigLength - 2; // Last 2 bytes uint256 contentsDescrLength = uint16(bytes2(encodedSignature[contentsDescrEnd:])); if (contentsDescrLength + 64 > contentsDescrEnd) - return (_emptyCalldataBytes(), 0, 0, _emptyCalldataString()); + return (Calldata.emptyBytes(), 0, 0, Calldata.emptyString()); uint256 contentsHashEnd = contentsDescrEnd - contentsDescrLength; uint256 separatorEnd = contentsHashEnd - 32; @@ -195,23 +197,7 @@ library ERC7739Utils { } } } - return (_emptyCalldataString(), _emptyCalldataString()); - } - - // slither-disable-next-line write-after-write - function _emptyCalldataBytes() private pure returns (bytes calldata result) { - assembly ("memory-safe") { - result.offset := 0 - result.length := 0 - } - } - - // slither-disable-next-line write-after-write - function _emptyCalldataString() private pure returns (string calldata result) { - assembly ("memory-safe") { - result.offset := 0 - result.length := 0 - } + return (Calldata.emptyString(), Calldata.emptyString()); } function _isForbiddenChar(bytes1 char) private pure returns (bool) { diff --git a/lib/@openzeppelin-contracts b/lib/@openzeppelin-contracts index d4ed5f9..352ab13 160000 --- a/lib/@openzeppelin-contracts +++ b/lib/@openzeppelin-contracts @@ -1 +1 @@ -Subproject commit d4ed5f9068bb634ecc423417b4f9554f48fae85b +Subproject commit 352ab136878f652658f8f4e3d70b4087563653c4 diff --git a/lib/@openzeppelin-contracts-upgradeable b/lib/@openzeppelin-contracts-upgradeable index 94c7b7c..7aa7f8c 160000 --- a/lib/@openzeppelin-contracts-upgradeable +++ b/lib/@openzeppelin-contracts-upgradeable @@ -1 +1 @@ -Subproject commit 94c7b7c87a69139c4e4d33ac142a1d1820b0d7d5 +Subproject commit 7aa7f8c91132a1b3ff614ed9d24281a0535f11cf diff --git a/lib/forge-std b/lib/forge-std index 83c5d21..726a6ee 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 83c5d212a01f8950727da4095cdfe2654baccb5b +Subproject commit 726a6ee5fc8427a0013d6f624e486c9130c0e336