Back to Docs

NornSubscriptions

Contract

On-chain subscription management for creators. Create tiers, accept recurring payments, and manage subscribers.

Overview

The NornSubscriptions contract enables creators to set up subscription tiers and receive recurring payments from supporters. Subscriptions are 30-day periods, and subscribers can renew, change tiers, or cancel at any time.

Up to 5 Tiers

Create multiple subscription levels with different prices and benefits.

30-Day Periods

Standard monthly billing cycle with renewal and grace period support.

Stablecoin Payments

Accept payments in any supported TIP20 stablecoin token.

Creator Functions

setTier(tierId, price, name)
Create or update a subscription tier

// Create a $5/month tier

setTier(0, 5000000, "Basic")

  • tierId: Tier index (0-4)
  • price: Price in token units (6 decimals)
  • name: Display name for the tier
deactivateTier(tierId)
Disable a tier (existing subscriptions continue)

Deactivating a tier prevents new subscriptions but doesn't affect existing subscribers.

reactivateTier(tierId)
Re-enable a previously deactivated tier

Subscriber Functions

subscribe(creator, tierId, token)
Subscribe to a creator's tier

Starts a new subscription. Requires token approval first. Payment is transferred directly to the creator.

renew(creator)
Renew an existing subscription

Extends the subscription by another 30 days. Can be called before or shortly after expiration.

unsubscribe(creator)
Cancel a subscription

Immediately cancels the subscription. Access continues until the current period ends.

changeTier(creator, newTierId)
Switch to a different tier

Upgrades charge the prorated difference immediately. Downgrades take effect immediately with no refund.

View Functions

isActive(subscriber, creator)
Check if a subscription is currently active
getTiers(creator)
Get all tiers for a creator
getSubscriberCount(creator)
Get total active subscriber count
getMonthlyRevenue(creator)
Calculate estimated monthly recurring revenue

Events

  • TierCreated(creator, tierId, price, name)
  • TierUpdated(creator, tierId, price, name, active)
  • Subscribed(subscriber, creator, tierId, token, amount, periodEnd)
  • SubscriptionRenewed(subscriber, creator, tierId, amount, newPeriodEnd)
  • Unsubscribed(subscriber, creator, tierId)

Integration

Use the Norn dashboard to manage subscriptions without writing code, or integrate directly with the contract for custom implementations.