# zero-amount-set-consumption-review

> Review exact surviving Set absence consumption before a zero-inclusive canonical unshielded payout.

Canonical: https://nightshade.dicksonwu.xyz/rules/zero-amount-set-consumption-review.html
Release: Nightshade 0.1.1 (v0.1.1)

| Field | Value |
| --- | --- |
| Rule ID | `zero-amount-set-consumption-review` |
| Severity | info |
| Confidence | varies |
| Maturity | experimental |
| Selection | Audit default |
| Policy intent | not required |
| Default enabled | yes |
| Category | Audit-default ordinary rules |
| Engine facts used | canonical-invocation-snapshots, collection-observations, all-predicates, exact-numeric-operands, completed-entries |
| Release | v0.1.1 |

## Selection and scope

Selected by the default audit profile, so an ordinary scan runs it.

```sh
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors zero-amount-set-consumption-review
./.nightshade/node_modules/.bin/nightshade detector show zero-amount-set-consumption-review
```

The 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 |
| ---: | ---: | ---: | ---: | ---: |
| 2/2 | 2/2 | 4/5 | 8/8 | 0 |

Deviations recorded for this rule:

| Case | Kind | Expected to observed lines | Issue |
| --- | --- | --- | --- |
| manifest.json / zeroAmountSetConsumptionReview40/drafts/consumption40/intentional-zero-consumption.compact | lookalike | [15] to [15] | control hit |

These are behavior checks on synthetic fixtures, not a precision or recall estimate. See [evaluation](https://nightshade.dicksonwu.xyz/evaluation.md#synthetic-corpus).

## Rule documentation

From https://github.com/DicksonWu654/nightshade/blob/v0.1.1/docs/detectors/zero-amount-set-consumption-review.md at v0.1.1.

Availability: default-on informational review. Requires complete ordinary histories
with exact collection, invocation and numeric evidence; gaps remain explicit.

This default informational rule reports a canonical unshielded send whose exact
modeled amount retains zero, on the same ordinary successful history as an earlier
required Set absence and exact-key insertion. The absence is enforced before
insertion, its collection revision remains current until insertion, and that
insertion survives through completion. Later removal or replacement followed by
reinsertion cannot restore the earlier certificate.

Resolved canonical calls and types select applicability. Immutable key and
collection-address evidence establishes equality; names, shared wildcard storage
paths and exclusive-branch effect unions do not. The rule reuses shared collection
consumption and numeric transfers. Matching work is bounded; unavailable histories,
operands and exhausted budgets diagnose incomplete analysis.

Zero-value sends and Set consumption can be intentional protocol no-ops. The rule
does not infer economic value or replay policy; review the purpose of the send
and key before treating the observation as a defect.

## 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:

```compact
// nightshade-disable-next-line zero-amount-set-consumption-review -- Reason this match is intentional
```

Diagnostics cannot be suppressed, and an unmatched directive for a selected rule makes analysis incomplete. See [configuration](https://nightshade.dicksonwu.xyz/configuration.md#suppress-an-intentional-match) for fingerprint suppressions and baselines.

## References

- [Rule source document at v0.1.1](https://github.com/DicksonWu654/nightshade/blob/v0.1.1/docs/detectors/zero-amount-set-consumption-review.md)
- [Catalog entry in rules.json](https://nightshade.dicksonwu.xyz/rules.json)
- [All rules](https://nightshade.dicksonwu.xyz/rules.md#audit-default-ordinary-rules)
- [Limitations](https://nightshade.dicksonwu.xyz/limitations.md)
