Rename isValidERC7913SignatureNow to isValidSignatureNow (#5719)
This commit is contained in:
@ -27,7 +27,7 @@ library SignatureChecker {
|
||||
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
|
||||
* change through time. It could return true at block N and false at block N+1 (or the opposite).
|
||||
*
|
||||
* NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidERC7913SignatureNow}.
|
||||
* NOTE: For an extended version of this function that supports ERC-7913 signatures, see {isValidSignatureNow-bytes-bytes32-bytes-}.
|
||||
*/
|
||||
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
|
||||
if (signer.code.length == 0) {
|
||||
@ -73,7 +73,7 @@ library SignatureChecker {
|
||||
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
|
||||
* change through time. It could return true at block N and false at block N+1 (or the opposite).
|
||||
*/
|
||||
function isValidERC7913SignatureNow(
|
||||
function isValidSignatureNow(
|
||||
bytes memory signer,
|
||||
bytes32 hash,
|
||||
bytes memory signature
|
||||
@ -102,7 +102,7 @@ library SignatureChecker {
|
||||
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
|
||||
* change through time. It could return true at block N and false at block N+1 (or the opposite).
|
||||
*/
|
||||
function areValidERC7913SignaturesNow(
|
||||
function areValidSignaturesNow(
|
||||
bytes32 hash,
|
||||
bytes[] memory signers,
|
||||
bytes[] memory signatures
|
||||
@ -115,7 +115,7 @@ library SignatureChecker {
|
||||
bytes memory signer = signers[i];
|
||||
|
||||
// If one of the signatures is invalid, reject the batch
|
||||
if (!isValidERC7913SignatureNow(signer, hash, signatures[i])) return false;
|
||||
if (!isValidSignatureNow(signer, hash, signatures[i])) return false;
|
||||
|
||||
bytes32 id = keccak256(signer);
|
||||
// If the current signer ID is greater than all previous IDs, then this is a new signer.
|
||||
|
||||
@ -209,7 +209,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner {
|
||||
* Returns whether whether the signers are authorized and the signatures are valid for the given hash.
|
||||
*
|
||||
* IMPORTANT: Sorting the signers by their `keccak256` hash will improve the gas efficiency of this function.
|
||||
* See {SignatureChecker-areValidERC7913SignaturesNow} for more details.
|
||||
* See {SignatureChecker-areValidSignaturesNow-bytes32-bytes[]-bytes[]} for more details.
|
||||
*
|
||||
* Requirements:
|
||||
*
|
||||
@ -225,7 +225,7 @@ abstract contract MultiSignerERC7913 is AbstractSigner {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return hash.areValidERC7913SignaturesNow(signers, signatures);
|
||||
return hash.areValidSignaturesNow(signers, signatures);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -41,11 +41,14 @@ abstract contract SignerERC7913 is AbstractSigner {
|
||||
_signer = signer_;
|
||||
}
|
||||
|
||||
/// @dev Verifies a signature using {SignatureChecker-isValidERC7913SignatureNow} with {signer}, `hash` and `signature`.
|
||||
/**
|
||||
* @dev Verifies a signature using {SignatureChecker-isValidSignatureNow-bytes-bytes32-bytes-}
|
||||
* with {signer}, `hash` and `signature`.
|
||||
*/
|
||||
function _rawSignatureValidation(
|
||||
bytes32 hash,
|
||||
bytes calldata signature
|
||||
) internal view virtual override returns (bool) {
|
||||
return SignatureChecker.isValidERC7913SignatureNow(signer(), hash, signature);
|
||||
return SignatureChecker.isValidSignatureNow(signer(), hash, signature);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user