A robust Clarity smart contract that enables content creators to monetize their digital content through flexible pricing models, subscription services, and secure access control on the Stacks blockchain.
- Content Registration: Creators can register content with titles, descriptions, pricing, and content hashes
- Purchase System: Users can buy individual content pieces with automatic payment processing
- Subscription Model: Monthly subscriptions for accessing all creator content
- Access Control: Secure verification of content access rights
- Revenue Sharing: Automatic 5% platform fee with remainder going to creators
- Content Management: Toggle active status and update pricing
- Subscription Management: Renewal and cancellation capabilities
- Creator Analytics: Track total content, revenue, and sales statistics
- Platform Administration: Treasury management for platform fees
PLATFORM_FEE_PERCENT: 5% platform fee on all transactions- Error codes ranging from u100-u106 for comprehensive error handling
- content-registry: Stores all content metadata and statistics
- content-access: Tracks user access permissions
- creator-stats: Aggregated creator performance metrics
- subscriptions: Manages subscription relationships and status
Returns complete content information including creator, title, description, price, and statistics.
Checks if a user has access to specific content through purchase or subscription.
Returns aggregated statistics for a creator including total content, revenue, and sales.
Verifies if a subscription is currently active and not expired.
Calculates the 5% platform fee for any given amount.
create-content
(create-content
(title (string-ascii 100))
(description (string-ascii 500))
(price uint)
(content-hash (string-ascii 64))
)