-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathISapient.sol
More file actions
38 lines (31 loc) · 1.46 KB
/
ISapient.sol
File metadata and controls
38 lines (31 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.27;
import { Payload } from "../Payload.sol";
/// @title ISapient
/// @author Agustin Aguilar, Michael Standen
/// @notice Sapient signers take an explicit payload and return their own "imageHash" as result
/// @dev The consumer of this signer must validate if the imageHash is valid or not, for the desired configuration
interface ISapient {
/// @notice Recovers the image hash of a given signature
/// @param payload The payload to recover the signature from
/// @param signature The signature to recover the image hash from
/// @return imageHash The recovered image hash
function recoverSapientSignature(
Payload.Decoded calldata payload,
bytes calldata signature
) external view returns (bytes32 imageHash);
}
/// @title ISapientCompact
/// @author Agustin Aguilar, Michael Standen
/// @notice Sapient signers take a compacted payload and return their own "imageHash" as result
/// @dev The consumer of this signer must validate if the imageHash is valid or not, for the desired configuration
interface ISapientCompact {
/// @notice Recovers the image hash of a given signature, using a hashed payload
/// @param digest The digest of the payload
/// @param signature The signature to recover the image hash from
/// @return imageHash The recovered image hash
function recoverSapientSignatureCompact(
bytes32 digest,
bytes calldata signature
) external view returns (bytes32 imageHash);
}