generated from LooksRare/solidity-template
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea43957
commit 825674d
Showing
3 changed files
with
60 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.17; | ||
|
||
import {SignatureChecker} from "../../../contracts/SignatureChecker.sol"; | ||
import {SignatureCheckerCalldata} from "../../../contracts/SignatureCheckerCalldata.sol"; | ||
import {SignatureCheckerMemory} from "../../../contracts/SignatureCheckerMemory.sol"; | ||
|
||
contract PublicSignatureChecker { | ||
function verify(bytes32 hash, address signer, bytes calldata signature) external view returns (bool) { | ||
function verifyCalldata(bytes32 hash, address signer, bytes calldata signature) external view returns (bool) { | ||
// It will revert if it is wrong | ||
SignatureChecker.verify(hash, signer, signature); | ||
SignatureCheckerCalldata.verify(hash, signer, signature); | ||
return true; | ||
} | ||
|
||
function verifyMemory(bytes32 hash, address signer, bytes memory signature) external view returns (bool) { | ||
// It will revert if it is wrong | ||
SignatureCheckerMemory.verify(hash, signer, signature); | ||
return true; | ||
} | ||
} |