Skip to content

d-olayanju/Content-Monetization-Smart-Contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Content Monetization Smart Contract

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.

Features

Core Functionality

  • 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

Management Tools

  • 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

Contract Structure

Constants

  • PLATFORM_FEE_PERCENT: 5% platform fee on all transactions
  • Error codes ranging from u100-u106 for comprehensive error handling

Data Storage

  • 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

Function Reference

Read-Only Functions

get-content-info (content-id uint)

Returns complete content information including creator, title, description, price, and statistics.

has-access (content-id uint) (user principal)

Checks if a user has access to specific content through purchase or subscription.

get-creator-stats (creator principal)

Returns aggregated statistics for a creator including total content, revenue, and sales.

is-subscription-active (creator principal) (subscriber principal)

Verifies if a subscription is currently active and not expired.

calculate-platform-fee (amount uint)

Calculates the 5% platform fee for any given amount.

Public Functions

Content Management

create-content

(create-content 
  (title (string-ascii 100))
  (description (string-ascii 500))
  (price uint)
  (content-hash (string-ascii 64))
)

About

This is a comprehensive blockchain-based platform built on Stacks that enables content creators to monetize their digital content through flexible pricing models and secure access control. It provides a decentralized marketplace where creators can register content, set prices, and earn revenue while users can purchase individual content pieces.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors