OpenZeppelin / OpenZeppelin/compact-contracts

N-03: Incomplete Documentation For Native Token Supply Wrappers

Open Beginner friendly
#808 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2-low audit
Dominant language
TypeScript
Stars
55
Forks
29
Avg merge
5d 7h
Merged PRs (30d)
25

Description

N-05 Incomplete Documentation For Native Token Supply Wrappers

Severity: Note

Source: Midnight Foundation #02 — OpenZeppelin Compact Contracts Audit, Release 0.3.0-alpha.1 (2026-08-18)


Both supply wrappers, NativeShieldedTokenFamilyPublicSupply and NativeShieldedTokenPublicSupply, import and re-export the same two core maps. Ledger state is allocated once per module, so a contract composing both would receive a single pair. The single-token flavour keys its bucket to the unreserved all-zero Bytes<32>, while the per-domain flavour forwards an arbitrary caller domain. As a result, both wrappers would address the same entry, and the burn guard would stop binding per token type. That composition is already prohibited where it originates. Both token flavours state that a contract must not import both for the same reason, and a supply wrapper is useful only alongside its token flavour. Every exported circuit of the two wrappers also shares a name with its counterpart at a different arity, so a dual import cannot be written unprefixed. The residual gap is documentary.

Consider recording in both supply wrappers that they share one set of core ledgers and that only one may be composed, matching the notice the token flavours carry. Deriving the single-token bucket from a fixed tag would not remove the condition, since the per-domain wrapper accepts any caller-supplied domain and no value can be reserved against it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two supply-wrapper definitions and compare their guidance with NativeShieldedTokenPublicSupplyCore.compact and NativeShieldedToken.compact. Update both wrappers to document their shared core ledgers and the rule that only one may be composed; the documentation is done when it matches the token-flavour notice.

Written by the indexing model from the issue text.

Assessment

Domain
blockchain, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.