Skip to content

Add configurable max supply cap with mint enforcement, admin cap upda…#203

Open
yunus-dev-codecrafter wants to merge 1 commit into
BCPathway:mainfrom
yunus-dev-codecrafter:feature/mint-cap-configurable-supply-ceiling
Open

Add configurable max supply cap with mint enforcement, admin cap upda…#203
yunus-dev-codecrafter wants to merge 1 commit into
BCPathway:mainfrom
yunus-dev-codecrafter:feature/mint-cap-configurable-supply-ceiling

Conversation

@yunus-dev-codecrafter
Copy link
Copy Markdown

…tes, cap queries, and SDK support.
closes #166

Summary

Adds a configurable max supply cap to the token contract, enforces it during minting, exposes admin cap updates and read-only cap queries, and adds SDK support for max supply operations.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Smart contract improvement
  • 🧪 Test coverage improvement
  • 🏗️ CI/Build improvement

Related Issue

Closes #166

Changes Made

  • Added MaxSupply to DataKey and max supply storage helpers
  • Updated initialize() to accept an optional max_supply
  • Enforced max_supply in internal_mint() and added relevant errors
  • Added set_max_supply(), get_max_supply(), and remaining_mintable() contract methods
  • Emitted max_supply_set events on cap changes
  • Added getMaxSupply(), getRemainingMintable(), and setMaxSupply() to SDK client
  • Updated CLI initialize flow to accept --max-supply

Testing

How has this been tested?

  • Rust unit tests pass (cargo test)
  • SDK compiles (npm run build in sdk)
  • Manual testing against Soroban testnet
  • New tests added for changes

Test commands run:

# Contract tests
cargo test

# SDK build
cd sdk && npm run build

Checklist

  • My code follows the project's style guidelines
  • I have added NatSpec-style comments to new Rust functions
  • I have added JSDoc comments to new TypeScript functions
  • I have updated the README if needed
  • My branch follows the naming convention: feature/<issue-number>-<description>
  • I have not modified files outside the scope of this issue

Drips.network Contributor Info

  • Drips Profile:
  • Issue Claimed: #

Screenshots (if applicable)

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@yunus-dev-codecrafter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Implement mint cap and configurable supply ceiling with dynamic adjustment

1 participant