Skip to main content
Standardized contract method for exposing EIP-712 domain parameters.
Implements ERC-5267 for retrieving domain separator fields.

Overview

ERC-5267 defines eip712Domain() function that contracts implement to expose their EIP-712 domain parameters. This enables:
  • Wallets to verify domain before signing
  • Tools to discover domain without hardcoding
  • Standardized domain querying across contracts

Function Signature

Fields Bitmap

The fields byte indicates which domain fields are defined: Example:
  • 0x0f = name + version + chainId + verifyingContract
  • 0x1f = all fields present
  • 0x0d = name + chainId + verifyingContract (no version)

API

toErc5267Response

toErc5267Response(domain: DomainType): ERC5267Response Converts Domain to ERC-5267 response format with field bitmap. Example:

getFieldsBitmap

getFieldsBitmap(domain: DomainType): Uint8Array Calculates fields bitmap from domain. Example:

Usage Patterns

Query Contract Domain

Verify Domain Match

Wallet Domain Display

Implementation Helper

Solidity contract implementing ERC-5267:

Specification

Defined in: src/primitives/Domain/toErc5267Response.js See also: