Skip to content

Add support for unlimited and timed fungible faucets#2459

Draft
afa7789 wants to merge 10 commits into0xMiden:nextfrom
afa7789:openzeppelin/supply_max_flexible
Draft

Add support for unlimited and timed fungible faucets#2459
afa7789 wants to merge 10 commits into0xMiden:nextfrom
afa7789:openzeppelin/supply_max_flexible

Conversation

@afa7789
Copy link
Contributor

@afa7789 afa7789 commented Feb 18, 2026

Adding a supporting concise miden + rust files that will allow us to componentize supply ( could be moved somewhere else depending on review ).

This will allow us to cap issuance to max_supply + time frame of minting, where it can extend max supply.

- Introduced `UnlimitedFungibleFaucet` for unrestricted token minting, suitable for testnets or inflationary models.
- Implemented `TimedFungibleFaucet` with time-based constraints on token distribution, allowing minting until a specified block and optional burn-only mode post-distribution.
- Updated account component interfaces to include new faucet types.
- Enhanced documentation to cover new faucet functionalities and usage examples.
… enhanced error handling and metadata management
- Replaced the flexible_supply component with supply_limits in the timed_fungible faucet contract to unify supply management.
- Removed the fixed_supply and flexible_supply components as they are no longer needed.
- Updated the timed_fungible faucet implementation to utilize the new supply_limits component for minting and burning operations.
- Adjusted error handling and supply checks to align with the new supply_limits logic.
- Updated references to the supply configuration storage slot in the timed_fungible and unlimited_fungible faucet implementations.
- Cleaned up unused error messages related to supply cap validation.
@afa7789
Copy link
Contributor Author

afa7789 commented Feb 19, 2026

Waiting for the review and merge of this #2439, for a rebase and final structure to convert this from draft to ready for review.

AS the way I'm implementing this depends on metadata extension to get clear approach.

- Simplified supply limits management in `supply_limits.masm` by removing unnecessary checks and consolidating procedures for minting and burning tokens.
- Updated `TimedFungibleFaucet` and `UnlimitedFungibleFaucet` to include owner account management, allowing for ownership checks and ownership transfer functionality.
- Removed deprecated error messages related to supply checks and burn restrictions, replacing them with more relevant error handling for timed distribution periods.
- Adjusted tests to reflect changes in ownership management and updated assertions accordingly.
@mmagician mmagician added the pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority label Feb 19, 2026
Copy link
Contributor

Choose a reason for hiding this comment

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

I've only glanced through this PR, but I wonder if the approach should be more along the lines I described in OpenZeppelin/miden-confidential-contracts#39 (reply in thread). Basically, we have a single network fungible faucet component, but we can customize mint policies using procedures stored in account storage. These policies could be under miden::standards::faucet::network_fungible::mint_policies or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants