From 459e65a50c8ff49617016f7066fbd64047b6d46d Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Thu, 19 Nov 2026 11:06:03 +0100 Subject: [PATCH 1/5] Set (u)fixed type min places to 0 instead of 1 --- schemas/type/elementary/fixed.schema.yaml | 2 +- schemas/type/elementary/ufixed.schema.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/type/elementary/fixed.schema.yaml b/schemas/type/elementary/fixed.schema.yaml index 61bf0206c2..e4b9cb775f 100644 --- a/schemas/type/elementary/fixed.schema.yaml +++ b/schemas/type/elementary/fixed.schema.yaml @@ -20,7 +20,7 @@ properties: description: How many decimal places, implying that a raw value `v` of this type should be interpreted as `v / (10**places)` - minimum: 1 + minimum: 0 maximum: 80 required: - kind diff --git a/schemas/type/elementary/ufixed.schema.yaml b/schemas/type/elementary/ufixed.schema.yaml index f548c20f28..58c63d73ab 100644 --- a/schemas/type/elementary/ufixed.schema.yaml +++ b/schemas/type/elementary/ufixed.schema.yaml @@ -20,7 +20,7 @@ properties: description: How many decimal places, implying that a raw value `v` of this type should be interpreted as `v / (10**places)` - minimum: 1 + minimum: 0 maximum: 80 required: - kind From 4c945652b801d814f05ce0332ac6145f87baca58 Mon Sep 17 00:00:00 2001 From: clonker <1685266+clonker@users.noreply.github.com> Date: Thu, 19 Nov 2026 11:14:51 +0100 Subject: [PATCH 2/5] Add changelog entry for (u)fixed min places --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 519bf11bde..07a07cdf22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,14 @@ The sections do not signal obligations; the prefixes do. ### Changed +- The `places` of a `fixed` or `ufixed` type may now be 0, as Solidity + allows. The minimum was 1 ([#420]). + - Schemas: **ethdebug/format/type/elementary/fixed**, + **ethdebug/format/type/elementary/ufixed** + - Producers: optional: a `fixed` or `ufixed` type may have `places: 0`. + - Consumers: required: the `minimum` of `places` is now 0. A consumer must + accept `places: 0`, which means the raw value is read unscaled. + - The members of a `define` no longer depend on their order, since JSON objects are unordered. A member may use any other member of the same `define`. Inside its own expression, its own name means the variable of the @@ -763,3 +771,4 @@ First published version of the specification. [#402]: https://github.com/ethdebug/format/pull/402 [#404]: https://github.com/ethdebug/format/pull/404 [#408]: https://github.com/ethdebug/format/pull/408 +[#420]: https://github.com/ethdebug/format/pull/420 From e8ec1b95b744a6ca6596796d78ada42a1b1725f1 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 19 Nov 2026 14:47:39 -0500 Subject: [PATCH 3/5] format: accept zero places in the fixed and ufixed guards Add a places: 0 example to each schema so the guard tests cover it. --- packages/format/src/types/type/index.ts | 4 ++-- schemas/type/elementary/fixed.schema.yaml | 3 +++ schemas/type/elementary/ufixed.schema.yaml | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/format/src/types/type/index.ts b/packages/format/src/types/type/index.ts index 32c8bee84e..71efeb15fe 100644 --- a/packages/format/src/types/type/index.ts +++ b/packages/format/src/types/type/index.ts @@ -158,7 +158,7 @@ export namespace Type { value.bits % 8 === 0 && "places" in value && typeof value.places === "number" && - value.places >= 1 && + value.places >= 0 && value.places <= 80; export interface Fixed { @@ -180,7 +180,7 @@ export namespace Type { value.bits % 8 === 0 && "places" in value && typeof value.places === "number" && - value.places >= 1 && + value.places >= 0 && value.places <= 80; export interface Bool { diff --git a/schemas/type/elementary/fixed.schema.yaml b/schemas/type/elementary/fixed.schema.yaml index e4b9cb775f..5792600312 100644 --- a/schemas/type/elementary/fixed.schema.yaml +++ b/schemas/type/elementary/fixed.schema.yaml @@ -30,3 +30,6 @@ examples: - kind: fixed bits: 256 places: 10 + - kind: fixed + bits: 64 + places: 0 diff --git a/schemas/type/elementary/ufixed.schema.yaml b/schemas/type/elementary/ufixed.schema.yaml index 58c63d73ab..f433214101 100644 --- a/schemas/type/elementary/ufixed.schema.yaml +++ b/schemas/type/elementary/ufixed.schema.yaml @@ -30,3 +30,6 @@ examples: - kind: ufixed bits: 256 places: 10 + - kind: ufixed + bits: 64 + places: 0 From 737fc2b7dde1b88e8e2a3b9d7e0107a27b7e6f37 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 19 Nov 2026 14:48:57 -0500 Subject: [PATCH 4/5] format: note the zero-places guard change in the package changelog --- packages/format/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/format/CHANGELOG.md b/packages/format/CHANGELOG.md index 58918d31d2..721cdf904c 100644 --- a/packages/format/CHANGELOG.md +++ b/packages/format/CHANGELOG.md @@ -12,6 +12,8 @@ tracked in the root [`CHANGELOG.md`](../../CHANGELOG.md). module load, and the package declares `"sideEffects": false`. A bundle that imports only the types and guards no longer includes the `yaml` library or the schema sources. The API is unchanged ([#373]). +- `Type.Elementary.isFixed` and `Type.Elementary.isUfixed` accept + `places: 0`. See the root [`CHANGELOG.md`](../../CHANGELOG.md) ([#420]). ## 0.1.0-draft.2 — 2026-10-07 @@ -166,3 +168,4 @@ First publication. [`e523e09`]: https://github.com/ethdebug/format/commit/e523e09 [`f87f678`]: https://github.com/ethdebug/format/commit/f87f678 [`fc976ed`]: https://github.com/ethdebug/format/commit/fc976ed +[#420]: https://github.com/ethdebug/format/pull/420 From b105f0f5f01846c89734f4d732fa77056f6beefd Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 19 Nov 2026 14:49:08 -0500 Subject: [PATCH 5/5] format: keep the #420 link with the other PR links --- packages/format/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/format/CHANGELOG.md b/packages/format/CHANGELOG.md index 721cdf904c..a9bd8d0eb1 100644 --- a/packages/format/CHANGELOG.md +++ b/packages/format/CHANGELOG.md @@ -158,6 +158,7 @@ First publication. [#323]: https://github.com/ethdebug/format/pull/323 [#325]: https://github.com/ethdebug/format/pull/325 [#373]: https://github.com/ethdebug/format/pull/373 +[#420]: https://github.com/ethdebug/format/pull/420 [`0ef2f37`]: https://github.com/ethdebug/format/commit/0ef2f37 [`10ab103`]: https://github.com/ethdebug/format/commit/10ab103 [`21e532e`]: https://github.com/ethdebug/format/commit/21e532e @@ -168,4 +169,3 @@ First publication. [`e523e09`]: https://github.com/ethdebug/format/commit/e523e09 [`f87f678`]: https://github.com/ethdebug/format/commit/f87f678 [`fc976ed`]: https://github.com/ethdebug/format/commit/fc976ed -[#420]: https://github.com/ethdebug/format/pull/420