ERC712Lib
ERC712Lib
Contains utility functions for the ERC712 implementation.
_TYPE_HASH
init
Initializes the storage with app name and version
Parameters
name
string
The name of the app as used for the EIP712 domain separator.
version
string
The version of the app as used for the EIP712 domain separator.
_domainSeparatorV4
Returns the domain separator for the current chain.
_hashTypedDataV4
_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:
_The name parameter for the EIP712 domain.
NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs are a concern._
_EIP712Version
_The version parameter for the EIP712 domain.
NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs are a concern._
_EIP712NameHash
_The hash of the name parameter for the EIP712 domain.
NOTE: In previous versions this function was virtual. In this version you should override _EIP712Name
instead._
_EIP712VersionHash
_The hash of the version parameter for the EIP712 domain.
NOTE: In previous versions this function was virtual. In this version you should override _EIP712Version
instead._
Was this helpful?