refactor(token): rename NST supply to PublicSupply - #710
Conversation
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.
WalkthroughThe 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. ChangesNative shielded token public supply
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (13)
CHANGELOG.mdcontracts/src/token/NativeShieldedToken.compactcontracts/src/token/NativeShieldedTokenFamily.compactcontracts/src/token/extensions/NativeShieldedTokenFamilyPublicSupply.compactcontracts/src/token/extensions/NativeShieldedTokenPublicSupply.compactcontracts/src/token/extensions/NativeShieldedTokenPublicSupplyCore.compactcontracts/src/token/test/extensions/NativeShieldedTokenFamilyPublicSupply.test.tscontracts/src/token/test/extensions/NativeShieldedTokenPublicSupply.property.test.tscontracts/src/token/test/extensions/NativeShieldedTokenPublicSupply.test.tscontracts/src/token/test/mocks/MockNativeShieldedTokenFamilyPublicSupply.compactcontracts/src/token/test/mocks/MockNativeShieldedTokenPublicSupply.compactcontracts/src/token/test/simulators/NativeShieldedTokenFamilyPublicSupplySimulator.tscontracts/src/token/test/simulators/NativeShieldedTokenPublicSupplySimulator.ts
| ### 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) |
There was a problem hiding this comment.
📐 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.
Types of changes
What types of changes does your code introduce to OpenZeppelin Midnight Contracts?
Closes #711
Insert
PublicbeforeSupplyin the native shielded token supplyextension names, so the name makes the on-chain (publicly visible) supply
accounting explicit and matches the existing
ConfidentialFungibleTokenPublicSupplyextension already on
main.NativeShieldedTokenSupplyNativeShieldedTokenPublicSupplyNativeShieldedTokenFamilySupplyNativeShieldedTokenFamilyPublicSupplyNativeShieldedTokenSupplyCoreNativeShieldedTokenPublicSupplyCoreScope:
tests via
git mv(rename history preserved).the consuming
NativeShieldedToken/NativeShieldedTokenFamilycontracts.paths change, which is appropriate for the current
0.3.0-alpha.PR Checklist
Further comments
Verified locally: all four affected contracts compile (
compact compile --skip-zk,artifacts generated) and
biome checkpasses on the renamed TS files (the longertype name triggered one formatter rewrap, which is included).
tsc/vitestwerenot run in this worktree (no
node_modules); CI covers them.