Skip to content

refactor(token): rename NST supply to PublicSupply - #710

Merged
0xisk merged 2 commits into
mainfrom
refactor/native-shielded-token-public-supply
Jul 24, 2026
Merged

refactor(token): rename NST supply to PublicSupply#710
0xisk merged 2 commits into
mainfrom
refactor/native-shielded-token-public-supply

Conversation

@0xisk

@0xisk 0xisk commented Jul 23, 2026

Copy link
Copy Markdown
Member

Types of changes

What types of changes does your code introduce to OpenZeppelin Midnight Contracts?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Closes #711

Insert Public before Supply in the native shielded token supply
extension names, so the name makes the on-chain (publicly visible) supply
accounting explicit and matches the existing ConfidentialFungibleTokenPublicSupply
extension already on main.

Before After
NativeShieldedTokenSupply NativeShieldedTokenPublicSupply
NativeShieldedTokenFamilySupply NativeShieldedTokenFamilyPublicSupply
NativeShieldedTokenSupplyCore NativeShieldedTokenPublicSupplyCore

Scope:

  • Renames the three extension files plus their paired mocks, simulators, and
    tests via git mv (rename history preserved).
  • Updates the assertion-message prefix in the core and the doc references in
    the consuming NativeShieldedToken / NativeShieldedTokenFamily contracts.
  • Pure rename, no behavioural change. Breaking only in that the public import
    paths change, which is appropriate for the current 0.3.0-alpha.

PR Checklist

  • I have read the Contributing Guide
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation for new methods or changes to existing method behavior.
  • CI Workflows Are Passing

Further comments

Verified locally: all four affected contracts compile (compact compile --skip-zk,
artifacts generated) and biome check passes on the renamed TS files (the longer
type name triggered one formatter rewrap, which is included). tsc / vitest were
not run in this worktree (no node_modules); CI covers them.

Insert `Public` before `Supply` in the native shielded token supply
extension names, so the on-chain (publicly visible) supply accounting is
explicit and consistent with `ConfidentialFungibleTokenPublicSupply`:

* NativeShieldedTokenSupply       -> NativeShieldedTokenPublicSupply
* NativeShieldedTokenFamilySupply -> NativeShieldedTokenFamilyPublicSupply
* NativeShieldedTokenSupplyCore   -> NativeShieldedTokenPublicSupplyCore

Renames the paired mocks, simulators, and tests, and updates the
assertion-message prefix plus the doc references in the consuming
`NativeShieldedToken` / `NativeShieldedTokenFamily` contracts. Pure
rename, no behavioural change.
@0xisk
0xisk requested review from a team as code owners July 23, 2026 14:25
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The pull request renames native shielded token supply extensions and cores to PublicSupply variants, rewires test mocks and simulators, updates documentation, and changes tests to expect the new assertion prefixes.

Changes

Native shielded token public supply

Layer / File(s) Summary
Extension and core renaming
contracts/src/token/extensions/*, contracts/src/token/NativeShieldedToken*.compact, CHANGELOG.md
Supply wrappers and the accounting core use PublicSupply module names, imports, documentation, and assertion prefixes.
Test mocks and simulator wiring
contracts/src/token/test/mocks/*, contracts/src/token/test/simulators/*
Mocks and simulators target the renamed extensions, artifacts, state types, and exported classes.
Supply extension test updates
contracts/src/token/test/extensions/*
Unit and property tests use PublicSupply simulators and updated burn and invariant error messages.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: andrew-fleming

Poem

I’m a rabbit with names freshly spun,
PublicSupply modules now hop in the sun.
Mocks and tests follow the trail,
Core messages match without fail.
One neat rename, and the ledger can run!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: renaming NST supply extensions to PublicSupply.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/native-shielded-token-public-supply

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 18: Update the changelog rename entry to mark it as **Breaking:** and
replace the `#TBD` placeholder with the actual issue or pull request reference
before release.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8013d12c-7a2b-4fe6-9f4b-a8111a321836

📥 Commits

Reviewing files that changed from the base of the PR and between 574e75e and 532548e.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • contracts/src/token/NativeShieldedToken.compact
  • contracts/src/token/NativeShieldedTokenFamily.compact
  • contracts/src/token/extensions/NativeShieldedTokenFamilyPublicSupply.compact
  • contracts/src/token/extensions/NativeShieldedTokenPublicSupply.compact
  • contracts/src/token/extensions/NativeShieldedTokenPublicSupplyCore.compact
  • contracts/src/token/test/extensions/NativeShieldedTokenFamilyPublicSupply.test.ts
  • contracts/src/token/test/extensions/NativeShieldedTokenPublicSupply.property.test.ts
  • contracts/src/token/test/extensions/NativeShieldedTokenPublicSupply.test.ts
  • contracts/src/token/test/mocks/MockNativeShieldedTokenFamilyPublicSupply.compact
  • contracts/src/token/test/mocks/MockNativeShieldedTokenPublicSupply.compact
  • contracts/src/token/test/simulators/NativeShieldedTokenFamilyPublicSupplySimulator.ts
  • contracts/src/token/test/simulators/NativeShieldedTokenPublicSupplySimulator.ts

Comment thread CHANGELOG.md Outdated
### Changed

- Rename the contract-compilation scripts and Turbo tasks from `compact` / `compact:*` to `compile` / `compile:*`, and the Biome scripts from `fmt-and-lint` / `fmt-and-lint:*` to `lint` / `lint:*`. (#680)
- Rename the native shielded token supply extensions to `NativeShieldedTokenPublicSupply` / `NativeShieldedTokenFamilyPublicSupply` (and the shared `NativeShieldedTokenPublicSupplyCore`), making explicit that they track supply on-chain and matching the `ConfidentialFungibleTokenPublicSupply` naming. (#TBD)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Finalize the breaking-change metadata.

This rename changes public import paths, so mark the entry as **Breaking:** and replace #TBD with the actual issue or PR reference before release.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 18, Update the changelog rename entry to mark it as
**Breaking:** and replace the `#TBD` placeholder with the actual issue or pull
request reference before release.

@andrew-fleming andrew-fleming left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@0xisk
0xisk merged commit 21d21ea into main Jul 24, 2026
9 checks passed
@0xisk
0xisk deleted the refactor/native-shielded-token-public-supply branch July 24, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dev: rename NST supply extensions to PublicSupply

2 participants