SubscriptionManager

The SubscriptionManager contract manages the lifecycle of all SubscriptionNFTs, handling creation, enforcement, renewal, pricing updates, burn rules, and platform-wide subscription governance. It enforces a per-day subscription model with real-time credit accounting, directly integrated with the TRNUsageOracle.


🔧 Core Responsibilities

Feature
Description

🎟️ NFT Minting

Handles one-time minting of SubscriptionNFT per user-per-creator

🔄 Daily Renewal Queue

Enforces renewal of active subscriptions post-drop via TRNUsageOracle

⛔ Price Change Handling

Pauses existing subscriptions when a creator updates price

🔥 NFT Burn Triggers

Enforces one-time burn and permanent lockout logic

⚖️ TRN Usage Oracle Integration

Real-time debit/credit tracking on daily renewals and subscriptions

All functions are enforced centrally to maintain state integrity between the ledger, the NFT contract, and vault payouts.


🧾 Subscription Model

Rule
Behavior

⏳ Subscriptions last 1 day

Access is granted for 24 hours after successful renewal

⚡ Immediate activation

Subscriptions can be started during the day via on-credit TRN from ledger

💰 TRN-paid per day

Creators define a flat per-day TRN price (e.g., 5 TRN/day)

🧭 Auto-renews post-drop

Renewals pull from the user’s actual available balance post-Merkle drop

❌ No free trials

All subscriptions are paid at the time of activation or renewal

If a user is too far in debt, the subscription action will be blocked immediately.


🧠 Renewal Flow

  1. Every day after the Merkle drop finalizes, all active subscriptions are scanned.

  2. For each subscription:

    • Check if user has sufficient balance in TRNUsageOracle

    • Deduct the per-day amount from the ledger balance

    • If successful: mark renewal complete

    • If insufficient funds: pause the subscription

  3. Paused users can opt-in again at the new rate (if allowed).

Subscription actions never cause debt due to real-time checks by the TRNUsageOracle.


⚙️ Minting Rules

Minting can only happen if:

  • The user does not currently hold a valid SubscriptionNFT for the creator.

  • The user has not previously burned this specific NFT (burn = permanent block).

  • The creator’s subscription price is active.

  • The country-level GeoOracle does not block the content regionally.

Minting is performed only via the manager, and initiates the first day’s subscription using credit-based spending (added to ledger and settled post-drop).


🔥 Burn Logic

The manager enforces automatic or admin-triggered burns under the following cases:

Condition
Outcome

User cancels

Burned permanently, cannot resubscribe

Creator bans user

Burned and locked

Creator increases price

Subscription paused, must opt-in again

Creator NFT triggers geo-block

Subscription paused or disabled regionally

Platform moderation ban

Burned automatically

Burns are recorded in the BurnRegistry.


💼 Pricing & Update Handling

When a creator increases their subscription price:

  1. All current subscribers are immediately paused

  2. They are shown the new price

  3. They must manually re-opt-in if they wish to continue

  4. No subscription resumes without re-approval

This enforces pricing transparency and discourages creators from pausing/reactivating repeatedly.


🚫 Cancellation Policy

  • Users cannot "cancel" in the traditional sense.

  • If they choose to leave, the NFT is burned permanently.

  • This discourages casual toggling of subscriptions and encourages long-term commitment.


🔗 Integrated Modules

Module
Role

SubscriptionNFT

Stores and enforces access tokens per user/creator

TRNUsageOracle

Handles all real-time spending and renewal deductions

PostVaultSplitter

Routes creator earnings from active subscriptions

DailyVaultSplitter

Routes DAO cut (10%) of all subscription earnings

GeoOracle

Prevents minting or renewal in blocked regions

BurnRegistry

Records all burned NFTs (used for enforcement and auditing)


🧾 Example Scenario

A user subscribes to Creator X for 4 TRN/day:

  1. SubscriptionManager.mint() checks permissions and ledger credit.

  2. 4 TRN is logged as a credit-based debit via TRNUsageOracle.

  3. User gains access to all SubscriptionNFT-gated content from Creator X.

  4. Post-drop, renewal triggers for the next 24-hour cycle.

  5. If the user earned less than 4 TRN, the subscription pauses.

  6. Creator raises price to 7 TRN/day → user must opt-in again.

  7. If user burns the NFT: locked out permanently.


✅ Enforcement Guarantees

  • Subscriptions never cause debt

  • Burned NFTs are never mintable again

  • All payments are TRN-based only; no fiat or proxy tokens allowed

  • The system runs independently of external oracles

Last updated