Rule
unbounded-mint
A variable mint amount has no modeled per-call cap below the native range or public ledger bound.
Specimen 73 of 96 · Other active opt-ins / Token, coin and value transfers
- Severity
- medium
- Confidence
- varies
- Maturity
- experimental
- Selection
- Opt-in
- Policy intent
- not required
- Release
- v0.1.1
- Engine facts used
successful-predicatescanonical-mint-observationsnumeric-bounds
Selection and scope#
Not selected by default. Select it with --detectors or the detectors list in nightshade.json. Either one replaces profile selection, so list every rule you want.
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors unbounded-mint
./.nightshade/node_modules/.bin/nightshade detector show unbounded-mintThe first command runs only this rule; --detectors takes a comma-separated list. The second prints the rule's metadata from your installed version.
Severity is review priority. It does not express exploitability or impact. Confidence is detector metadata, not a probability. All built-in rules are experimental.
Compiler scope: the engine supports the pinned profiles 0.28.0, 0.29.0, 0.30.0, 0.31.1, 0.33.0-rc.2, 0.34.0, 0.35.0-rc.1 and 0.35.0, with ZKIR2 by default. Support for this rule can be narrower; the rule documentation below states any narrower scope.
Corpus checks#
Synthetic corpus checks for this rule in the 0.1.1 proof run. A check counts only with compiler acceptance and complete analysis.
| Positive detected | Corrected quiet | Lookalike quiet | Other negative quiet | Incomplete |
|---|---|---|---|---|
| 1/1 | 1/1 | 1/1 | 0/0 | 0 |
No deviations were recorded for this rule.
These are behavior checks on synthetic fixtures, not a precision or recall estimate. See evaluation.
Rule documentation#
From docs/detectors/unbounded-mint.md at v0.1.1.
Availability: opt-in review, medium severity, low confidence for monetary-policy risk.
Description, example and scenario#
mintShieldedToken(domain, disclose(amount), nonce, recipient);A variable native mint amount retains the full 64-bit upper limit on a modeled successful history, without a recognized public-ledger upper bound. A positive-only check and an unrelated authorization guard do not establish a per-call quantity cap. Review whether the application intended a tighter reward or issuance limit. This is a quantity review, not a claim that every public mint is a vulnerability.
Recommendation#
Constrain the actual minted amount to the intended per-call limit if required by monetary policy. Protect supply, issuer authorization and public cap integrity separately. A local amount cap does not establish a cross-transaction supply invariant.
Evidence and known false positives#
Exact shielded/unshielded kernel mint operands, immutable scalar snapshots, checked narrowing/type ranges and successful assertion constraints retain the actual amount. Later atomic assertions may constrain it. Constant amounts, narrower types, proved smaller upper envelopes and public-ledger upper/equality bounds (including transitive aliases, immutable Map snapshots and public numeric expressions) stay quiet. Numeric operand trees establish bound origins without claiming ledger digest/preimage provenance. A bound computed from the minted amount itself supplies no independent cap. Saved public bounds and pure later proof assertions also constrain checkpoint prefixes; later ledger-dependent checks only constrain the fallible segment. A value compared with itself supplies no extra upper bound. A guard on a different amount, private echo of the amount, new storage revision or sibling history supplies no cap for this value. Constructors and rejected histories are excluded. Observation/projection exhaustion is rule/entry-scoped incomplete and preserves baseline results.
Trusted-issuer minting, intentionally public faucets and unrestricted issuance and public pending-balance withdrawals are known intent-dependent shapes; the rule remains opt-in. A recognized public bound is not proof that its storage is protected or its value reasonable. Only per-call limits are reviewed. Protocol pricing, custom mint effects, global supply invariants and arbitrary algebraic proofs remain outside scope.
Suppress a match#
If a match is intentional, suppress it on the line before with the exact rule ID and a reason of at least eight characters:
// nightshade-disable-next-line unbounded-mint -- Reason this match is intentionalDiagnostics cannot be suppressed, and an unmatched directive for a selected rule makes analysis incomplete. See configuration for fingerprint suppressions and baselines.