ChainSafe / ChainSafe/open-creator-rails
Capping subscription count
- Dominant language
- Solidity
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**What**
Implement a configurable cap on the maximum number of active subscriptions per asset.
**Why**
Asset owners may want to limit how many users can subscribe to an asset at any given time. This supports scarcity, quality control, and capacity planning for the asset.
**How**
- Add a subscription cap (max subscriptions) to the Asset contract, configurable by owner
- Track the current number of active subscriptions
- Add a check in the subscribe flow to reject new subscriptions when the cap is reached
- Implement `setSubscriptionCap(uint256)` (or similar) with onlyOwner modifier
- Consider whether expired subscriptions count toward the cap or not
- Add tests for cap enforcement and owner configuration
**Acceptance Criteria**
- Asset owners can set a maximum subscription count per asset
- New subscriptions are rejected when the cap is reached
- Cap can be updated by the owner
- Behavior is well-defined for subscription expiry and cap
- Comprehensive test coverage
**Estimation**
**Dependencies**
Depends on #9 (Implement Asset Contract)
Contributor guide
Assessment
This issue has not been assessed yet.