This project implements the Open Content Protocol (OCP) using Solidity smart contracts. It provides a framework for managing creators, subscribers, members, posts, and paid content on the Ethereum blockchain.
The Open Content Protocol Solidity project aims to create a decentralized, censorship-resistant content value network for content providers and individual creators using Ethereum smart contracts.
The project consists of the following main contracts:
- Creator: Manages creator information and associated platform addresses.
- Subscriber: Handles subscriber management using ERC721 tokens.
- Member: Manages member subscriptions using ERC1155 tokens.
- Post: Manages posts using ERC721 tokens.
- PostKey: Handles post keys using ERC1155 tokens.
- Paid: Manages paid content using ERC721 tokens.
- Creator registration and management
- Subscriber creation and tracking
- Membership system with expiration and renewal
- Post creation and management
- Post key system for content access control
- Paid content management
-
Clone the repository:
git clone https://github.com/memenow/open-content-protocol-solidity.git -
Compile the contracts:
npx hardhat compile
Here's a brief overview of how to use the main contracts:
// Create a new creator
function createCreator(address creatorAddress, address platformAddress) public
// Get creator information
function getCreator(address creatorAddress) public view returns (address, address)// Create a new subscriber
function createSubscriber(address subscriber, address creator, string memory uri) public onlyOwner returns (uint)// Create a new member
function createMember(address member, address creatorAddress, uint feeIndex) public payable onlyOwner returns (uint)
// Renew membership
function renewMember(uint memberId, address creatorAddress, uint feeIndex) public payable// Create a new post
function createPost(address creator, uint postKeyId, string memory uri) public onlyOwner returns (uint)
// Get post data
function getPostData(uint postId) public view returns (PostData memory)// Mint a new post key
function mintPostKey(address creator) public onlyOwner// Create new paid content
function createPaid(address memberAddress, address creatorAddress, string memory url, string memory description) public onlyOwner
// Get paid content information
function getPaid(uint256 paidId) public view returns (uint256, address, address, string memory, string memory)This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.