Skip to content

Remove dead mint accounting state#72

Merged
punk6529 merged 2 commits into
mainfrom
codex/remove-dead-mint-accounting
Jun 10, 2026
Merged

Remove dead mint accounting state#72
punk6529 merged 2 commits into
mainfrom
codex/remove-dead-mint-accounting

Conversation

@punk6529

@punk6529 punk6529 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the never-written public-sale and allowlist mint-count mappings from StreamCore and drops the corresponding retrieval functions from StreamCore / IStreamCore.
  • Adds focused mint-accounting tests for the retained airdrop counter: zero initial state, authorized minter increments, and unauthorized mint rollback/no increment.
  • Updates the roadmap, Slither baseline, status docs, known blockers, test docs, and autonomous run state to mark P0-CORE-001 fixed.

Intentional API change

This removes two pre-beta external views that always returned zero because their backing mappings were never written and the current drop path has no accepted public-sale or allowlist quota semantics. Keeping them would make the ABI look more complete than the protocol actually is. Future quota/accounting work should add a fresh, documented API with tests instead of relying on these misleading counters.

Validation

  • forge fmt --check smart-contracts\StreamCore.sol smart-contracts\IStreamCore.sol test\StreamMintAccounting.t.sol
  • forge test --match-contract StreamMintAccountingTest -vvv passed: 2 tests, 0 failed
  • make check passed: 176 tests, 0 failed
  • powershell -ExecutionPolicy Bypass -File scripts\check.ps1 passed: 176 tests, 0 failed
  • git diff --check
  • Markdown heading scan for touched docs
  • Traceability grep for P0-CORE-001, StreamMintAccounting, uninitialized-state, uninitialized_state, Slither count 680, branch codex/remove-dead-mint-accounting, and PR Fix dependency script encoding hashes #71 merge commit 20bd9d9d1fa36b7142f3a81b9ab0c86060c9f943
  • Slither confirmation: slither_exit=-1, total=680, high=6, medium=28, low=63, informational=577, optimization=6, uninitialized_state=0, uninitialized_local=10, weak_prng=2, encode_packed_collision=0

Closes #13

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Removed unused public/allowlist mint-count retrieval APIs from StreamCore interface and implementation, eliminating deprecated code paths.
  • Tests

    • Added regression tests for airdrop counter behavior, verifying zero initialization, increment on authorized mints, and rollback on failed mints.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 91294967-4089-43cd-aa1d-739ab6e359ad

📥 Commits

Reviewing files that changed from the base of the PR and between 20bd9d9 and a0c6830.

📒 Files selected for processing (9)
  • docs/known-blockers.md
  • docs/status.md
  • ops/AUTONOMOUS_RUN.md
  • ops/ROADMAP.md
  • ops/SLITHER_BASELINE.md
  • smart-contracts/IStreamCore.sol
  • smart-contracts/StreamCore.sol
  • test/README.md
  • test/StreamMintAccounting.t.sol
💤 Files with no reviewable changes (2)
  • smart-contracts/IStreamCore.sol
  • smart-contracts/StreamCore.sol

📝 Walkthrough

Walkthrough

This PR removes two unused mint-accounting state mappings and their accessor functions from StreamCore, adds regression tests for the retained airdrop counter, and updates project documentation and verification records to mark the uninitialized-state findings as resolved.

Changes

Dead Mint-Accounting State Removal

Layer / File(s) Summary
Remove dead mint-accounting state from StreamCore
smart-contracts/IStreamCore.sol, smart-contracts/StreamCore.sol
Two private state mappings (tokensMintedPerAddress and tokensMintedAllowlistAddress) are deleted along with their corresponding external view getter functions. Interface declarations are removed from IStreamCore.
Add regression tests for retained airdrop counter
test/StreamMintAccounting.t.sol, test/README.md
New test contract StreamMintAccountingTest verifies the retained airdrop counter initializes at zero and increments on authorized mints, while rejecting unauthorized mint attempts. Test coverage is documented in the test README.
Update documentation and verification tracking
docs/known-blockers.md, docs/status.md, ops/ROADMAP.md, ops/SLITHER_BASELINE.md, ops/AUTONOMOUS_RUN.md
Project documentation, Slither baseline records, and autonomous execution logs are updated to mark uninitialized-state findings as Fixed, document the removal of dead state and retention of airdrop counter validation, and track PR #71 completion and PR #72 opening.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The mappings fade, the counters stay,
Dead mint-state swept clean away!
Airdrop's held and tested true,
Fixed findings—verification through and through! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove dead mint accounting state' directly and accurately describes the primary change: removing two never-written mint-count mappings and their retrieval functions from StreamCore.
Linked Issues check ✅ Passed All coding objectives from issue #13 are met: dead mint-accounting mappings removed, retrieval functions removed, airdrop counter retained with regression tests covering zero initial state/authorized increments/unauthorized rollback, and Slither baseline updated confirming uninitialized-state findings fixed.
Out of Scope Changes check ✅ Passed All changes are directly scoped to resolving issue #13: contract changes remove dead state, test additions verify retained airdrop counter behavior, and documentation updates track the fix across roadmap/Slither baseline/status files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-dead-mint-accounting

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

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@punk6529 punk6529 merged commit ba2f0cd into main Jun 10, 2026
2 checks passed
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.

[P0-CORE-001] Resolve uninitialized mint-accounting state variables

1 participant