NornSubscriptions
ContractOn-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
// 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
Deactivating a tier prevents new subscriptions but doesn't affect existing subscribers.
Subscriber Functions
Starts a new subscription. Requires token approval first. Payment is transferred directly to the creator.
Extends the subscription by another 30 days. Can be called before or shortly after expiration.
Immediately cancels the subscription. Access continues until the current period ends.
Upgrades charge the prorated difference immediately. Downgrades take effect immediately with no refund.
View Functions
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.