Skip to content

Commit b222457

Browse files
authored
Add missing documentation contract (#62)
1 parent 37fbc20 commit b222457

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// contracts/ERC7739SignerECDSA.sol
2+
// SPDX-License-Identifier: MIT
3+
pragma solidity ^0.8.20;
4+
5+
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
6+
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
7+
8+
import {ERC7739Signer} from "../../../../utils/cryptography/ERC7739Signer.sol";
9+
10+
contract ERC7739SignerECDSA is ERC7739Signer {
11+
address private immutable _signer;
12+
13+
constructor(address signerAddr) EIP712("ERC7739SignerECDSA", "1") {
14+
_signer = signerAddr;
15+
}
16+
17+
function _rawSignatureValidation(
18+
bytes32 hash,
19+
bytes calldata signature
20+
) internal view virtual override returns (bool) {
21+
(address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
22+
return _signer == recovered && err == ECDSA.RecoverError.NoError;
23+
}
24+
}

0 commit comments

Comments
 (0)