ERC7739Upgradeable
Inherits: Initializable, AbstractSigner, EIP712Upgradeable, IERC1271
Validates signatures wrapping the message hash in a nested EIP712 type. See {ERC7739Utils}. Linking the signature to the EIP-712 domain separator is a security measure to prevent signature replay across different EIP-712 domains (e.g. a single offchain owner of multiple contracts). This contract requires implementing the {_rawSignatureValidation} function, which passes the wrapped message hash, which may be either an typed data or a personal sign nested type. NOTE: xref:api:utils/cryptography#EIP712[EIP-712] uses xref:api:utils/cryptography#ShortStrings[ShortStrings] to optimize gas costs for short strings (up to 31 characters). Consider that strings longer than that will use storage, which may limit the ability of the signer to be used within the ERC-4337 validation phase (due to https://eips.ethereum.org/EIPS/eip-7562#storage-rules[ERC-7562 storage access rules]).
Functions
__ERC7739_init
function __ERC7739_init() internal onlyInitializing;
__ERC7739_init_unchained
function __ERC7739_init_unchained() internal onlyInitializing;
isValidSignature
*Attempts validating the signature in a nested EIP-712 type. A nested EIP-712 type might be presented in 2 different ways:
- As a nested EIP-712 typed data
- As a personal signature (an EIP-712 mimic of the
eth_personalSign
for a smart contract)*
function isValidSignature(bytes32 hash, bytes calldata signature) public view virtual returns (bytes4 result);
_isValidNestedPersonalSignSignature
Nested personal signature verification.
function _isValidNestedPersonalSignSignature(bytes32 hash, bytes calldata signature) private view returns (bool);
_isValidNestedTypedDataSignature
Nested EIP-712 typed data verification.
function _isValidNestedTypedDataSignature(bytes32 hash, bytes calldata encodedSignature) private view returns (bool);