Update ERC-7730: Generalize "mustMatch" feature with boundaries object with constraints leading to automatic signing refusal - #1923
Draft
forshtat wants to merge 2 commits into
Conversation
Lets spec authors declare a valid range (`min`/`max`), disqualifying exact values (`excludes`), and a required exact-match set (`mustMatch`) on a field's underlying value, independent of `format`. Wallets SHOULD refuse to sign by default when violated, and MAY offer an explicit override. `mustMatch` moves out of `visible` (v3.0.0-next only) into `boundaries`: it was never a display concern, it forced the field to always be hidden, and it couldn't express range checks. `visible` now covers display only (`always`/`never`/`optional`/`ifNotIn`); `boundaries` covers refusal only, and no longer requires hiding the field. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
|
✅ All reviewers have approved. |
boundaries for refusal-triggering value constraintsboundaries for refusal-triggering value constraints
forshtat
commented
Aug 2, 2026
boundaries for refusal-triggering value constraintsboundaries object with constraints leading to automatic signing refusal
|
The commit 48c225d (as a parent of bacb1c5) contains errors. |
This was referenced Aug 14, 2026
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
Early-stage idea, opened as a draft to gather feedback before finalizing.
Sometimes a parameter only makes sense within a bounded range (e.g.
pauseAccount(uint256 time)intended to take a duration of at most ~10 days). A call with a wildly out-of-range value (time = 864000000, ~27 years) is very likely a mistake or malicious intent. Clear signing shows the raw value, but there's currently no way for a spec author to tell a wallet "this value is implausible, don't sign it without extra friction."This PR adds an optional
boundariesproperty to the field formatter (v3.0.0-nextschema only):Wallets SHOULD refuse to sign by default when the underlying value violates the declared boundaries, and MAY offer an explicit override. It's independent of
formatand ofvisible— the field still displays normally.As part of this,
mustMatchmoves out ofvisibleintoboundaries. It was never really a display concern — it forced the field to always be hidden and had nothing to do with visibility, it just didn't have anywhere else to live.visiblenow covers display only (always/never/optional/ifNotIn);boundariescovers refusal only, and no longer requires hiding the field to validate it.Open questions (feedback welcome)
tokenAmount's existingthreshold/message(the "Unlimited" display swap) be related to or folded intoboundaries? They're triggered by a similar condition (crossing a limit) but take different actions (display substitution vs. refusal) — leaning towards keeping them separate to avoid mixing display and refusal concerns again, but open to discussion.bytesvalues, array-valued fields, and per-field severity levels (e.g. warn vs. refuse) are intentionally out of scope for now.Test plan
example-boundaries.jsonvalidates against the updated schemav3.0.0-next-targeted examples still validate (no regressions)boundariesand the open questions above🤖 Generated with Claude Code