Skip to content

Commit

Permalink
Add missing documentation contract (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestognw authored Jan 8, 2025
1 parent 37fbc20 commit b222457
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions contracts/mocks/docs/utils/cryptography/ERC7739SignerECDSA.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// contracts/ERC7739SignerECDSA.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";

import {ERC7739Signer} from "../../../../utils/cryptography/ERC7739Signer.sol";

contract ERC7739SignerECDSA is ERC7739Signer {
address private immutable _signer;

constructor(address signerAddr) EIP712("ERC7739SignerECDSA", "1") {
_signer = signerAddr;
}

function _rawSignatureValidation(
bytes32 hash,
bytes calldata signature
) internal view virtual override returns (bool) {
(address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
return _signer == recovered && err == ECDSA.RecoverError.NoError;
}
}

0 comments on commit b222457

Please sign in to comment.