-
Notifications
You must be signed in to change notification settings - Fork 182
/
IEIP712.sol
36 lines (33 loc) · 1.23 KB
/
IEIP712.sol
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
// SPDX-FileCopyrightText: 2023 OpenZeppelin, Lido <info@lido.fi>
// SPDX-License-Identifier: GPL-3.0
// See contracts/COMPILERS.md
// solhint-disable-next-line
pragma solidity >=0.4.24 <0.9.0;
/**
* @dev Helper interface of EIP712.
*
* Has an access to the CHAIN_ID opcode and relies on immutables internally
* Both are unavailable for Solidity 0.4.24.
*/
interface IEIP712 {
/**
* @dev Returns the domain separator for the current chain.
*/
function domainSeparatorV4(address _stETH) external view returns (bytes32);
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function hashTypedDataV4(address _stETH, bytes32 _structHash) external view returns (bytes32);
}