Skip to content

fix: make domain.name optional in v2 to legacy EIP-712 conversion#283

Open
lcastillo-ledger wants to merge 1 commit intomainfrom
fix/v2-optional-domain-name
Open

fix: make domain.name optional in v2 to legacy EIP-712 conversion#283
lcastillo-ledger wants to merge 1 commit intomainfrom
fix/v2-optional-domain-name

Conversation

@lcastillo-ledger
Copy link
Collaborator

Summary

  • Make domain.name optional when converting v2 ERC-7730 descriptors to the legacy Ledger EIP-712 format
  • When domain.name is absent, fall back to metadata.owner for the legacy descriptor's display name
  • This fixes conversion failures for contracts like Safe whose on-chain EIP712Domain only contains [chainId, verifyingContract] (no name field)

Context

Safe smart contracts (v1.3.0+) define their EIP-712 domain separator with only chainId and verifyingContract — the name field is not part of the domain. The v2 to legacy EIP-712 converter was unconditionally requiring domain.name and erroring with "Missing domain name" when it was absent, making it impossible to convert descriptors for these contracts.

The dapp_name field in the legacy format is a display-only label (not part of the EIP-712 domain hash), so falling back to metadata.owner is both safe and semantically appropriate.

Test plan

  • Convert a v2 EIP-712 descriptor with domain.name set → should use domain.name as before
  • Convert a v2 EIP-712 descriptor without domain or with domain.name absent → should fall back to metadata.owner instead of failing
  • Verify Safe EIP-712 descriptors (SafeTx with no domain name) convert successfully

Made with Cursor

Some EIP-712 contracts (e.g. Safe) do not include a `name` field in
their EIP712Domain. The v2 to legacy EIP-712 converter was requiring
`domain.name` to be present and failing with "Missing domain name"
when it was absent.

Make `dapp_name` fall back to `metadata.owner` when `domain.name` is
not set, so descriptors for contracts with a minimal EIP712Domain
(e.g. only chainId + verifyingContract) can still be converted.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant