feat: widen v2 schema fields to accept constants and map references#2503
Closed
lcastillo-ledger wants to merge 4 commits into
Closed
feat: widen v2 schema fields to accept constants and map references#2503lcastillo-ledger wants to merge 4 commits into
lcastillo-ledger wants to merge 4 commits into
Conversation
Update the ERC-7730 v2 JSON schema and spec to allow constant references ($.metadata.constants.*) and map references alongside literal values in many fields. Schema changes: - Add reusable definitions: stringValueOrMap, integerValueOrMap, stringOrArrayValueOrMap, scalarValueOrMap - Update parameter fields (token, callee, selector, amount, spender, chainId, collection, nativeCurrencyAddress, threshold, message, senderAddress) to use shared definitions - Update metadata fields (owner, contractName) and context fields (domain.name, domain.version) to accept map references - Update display fields (label, value, interpolatedIntent, intent) to accept map references - Tighten mapReference definition: require map + keyPath, disallow additional properties Spec changes: - Update eip712.domain description to note constant/map reference support - Update intent description to document three forms (string, object, map ref) - Update field format specification for value and label to note they accept constant/map references Made-with: Cursor
Reference display nodes can override shared definitions with path, params, visibility, and labels, but they currently reject optional $id metadata. Allow $id in the v2 schema and document it so referenced field overrides can be identified without failing validation. Made-with: Cursor
lcastillo-ledger
marked this pull request as ready for review
April 8, 2026 08:34
… into feat/v2-schema-maps-and-constants
2 tasks
lcastillo-ledger
added a commit
to lcastillo-ledger/ERCs
that referenced
this pull request
Apr 10, 2026
…rences Add reusable JSON schema definitions (stringValueOrMap, integerValueOrMap, stringOrArrayValueOrMap, scalarValueOrMap) and widen parameter fields, metadata fields, context fields, and display fields to accept map references. Schema changes: - Add 4 reusable $definitions for value-or-map-reference types - Widen ~20 fields across tokenAmount, calldata, nftName, addressName, interoperableAddressName params to use centralized $ref helpers - Widen metadata.owner, metadata.contractName, eip712.domain.name, eip712.domain.version to accept constant/map references - Widen display intent, interpolatedIntent, field label, field value - Tighten mapReference: enforce required [map, keyPath] and no extra props - Add optional $id on display reference entries Spec changes: - Document constant/map reference support for domain, intent, value, label - Document optional $id on field reference overrides Companion registry PR: ethereum/clear-signing-erc7730-registry#2503 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Collaborator
Author
|
Closing this PR — the same changes are being applied upstream in ethereum/ERCs#1663, which modifies the canonical spec and schema files directly. Once that ERC PR is merged, the changes will be automatically synced to this repository's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stringValueOrMap,integerValueOrMap,stringOrArrayValueOrMap,scalarValueOrMap) to factor constant/map reference supporttoken,callee,selector,amount,spender,chainId,collection,nativeCurrencyAddress,threshold,message,senderAddress) to accept map referencesowner,contractName) and context fields (domain.name,domain.version) to accept constant and map referenceslabel,value,interpolatedIntent,intent) to accept map referencesmapReferencedefinition: enforcerequired: ["map", "keyPath"]andadditionalProperties: false$idon displayreferenceentries (merged from fix: allow on display references #2506)eip712.domain,intent,label,value, and reference overrides to document the new reference formsCompanion linter PR: LedgerHQ/python-erc7730#291
Authors
$idsupport on display references (fix: allow on display references #2506)Test plan
example-maps.jsonfrom ERC repo$refand$idMade with Cursor