Skip to content

Commit 67d5c39

Browse files
committed
Nit
1 parent 1cdd64e commit 67d5c39

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- `SignerERC7913`: Abstract signer that verifies signatures using the ERC-7913 workflow.
44
- `ERC7913SignatureVerifierP256` and `ERC7913SignatureVerifierRSA`: Ready to use ERC-7913 verifiers that implement key verification for P256 (secp256r1) and RSA keys.
5+
56
## 12-04-2025
67

78
- `ERC7913Utils`: Utilities library for verifying signatures by ERC-7913 formatted signers.

contracts/utils/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Miscellaneous contracts and libraries containing utility functions you can use t
2121

2222
{{ERC7739Utils}}
2323

24-
=== Abstract signers
24+
=== Abstract Signers
2525

2626
{{AbstractSigner}}
2727

contracts/utils/cryptography/ERC7913Utils.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
pragma solidity ^0.8.20;
44

55
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
6+
import {Bytes} from "@openzeppelin/contracts/utils/Bytes.sol";
67
import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol";
78

89
/**
@@ -16,6 +17,8 @@ import {IERC7913SignatureVerifier} from "../../interfaces/IERC7913.sol";
1617
* See https://eips.ethereum.org/EIPS/eip-7913[ERC-7913].
1718
*/
1819
library ERC7913Utils {
20+
using Bytes for bytes;
21+
1922
/**
2023
* @dev Verifies a signature for a given signer and hash.
2124
*
@@ -28,7 +31,7 @@ library ERC7913Utils {
2831
* - Otherwise: verification is done using {IERC7913SignatureVerifier}
2932
*/
3033
function isValidSignatureNow(
31-
bytes calldata signer,
34+
bytes memory signer,
3235
bytes32 hash,
3336
bytes memory signature
3437
) internal view returns (bool) {
@@ -37,7 +40,7 @@ library ERC7913Utils {
3740
} else if (signer.length == 20) {
3841
return SignatureChecker.isValidSignatureNow(address(bytes20(signer)), hash, signature);
3942
} else {
40-
try IERC7913SignatureVerifier(address(bytes20(signer[0:20]))).verify(signer[20:], hash, signature) returns (
43+
try IERC7913SignatureVerifier(address(bytes20(signer))).verify(signer.slice(20), hash, signature) returns (
4144
bytes4 magic
4245
) {
4346
return magic == IERC7913SignatureVerifier.verify.selector;

0 commit comments

Comments
 (0)