Skip to content
Lattice

IEIP712

Git Source

Title: IEIP712

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/EIP712.sol)

Interface for EIP-712 typed structured data hashing and signing, including ERC-5267 domain discovery.

Functions

eip712Domain

Returns the fields and values that describe the domain separator used for signing.

Implements ERC-5267.

function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );

Returns

NameTypeDescription
fieldsbytes1A bitmask where bit i indicates that field i is active in the domain.
Bit 0 = name, bit 1 = version, bit 2 = chainId, bit 3 = verifyingContract, bit 4 = salt.
namestringThe user-readable name of the signing domain.
versionstringThe current major version of the signing domain.
chainIduint256The EIP-155 chain ID.
verifyingContractaddressThe address of the contract that will verify the signature.
saltbytes32An optional disambiguating salt.
extensionsuint256[]An array of EIP-7702 extensions (empty for this implementation).

Errors

EIP712InvalidName

Thrown when the provided name is invalid (empty).

error EIP712InvalidName();

EIP712InvalidVersion

Thrown when the provided version is invalid (empty).

error EIP712InvalidVersion();