This project is currently participating in Colledge's "Construyendo en Rootstock" Latino incubator.
Monetizado is an on-chain pay-per-view platform that allows you to monetize any web page and static content (if you don't have access to the backend to make changes) through Web3.
With Monetizado, you can implement it on news sites, social networks, exclusive content portals, and more. You could also use it to incentivize users to pay not to see advertising on your sites.
Demos: https://github.com/Monetizado/demosmonetizado/blob/main/README.md
Javascript SDK: https://github.com/Monetizado/monetizadojs
Monetizado Proxy SDK (to allow monetize full pages using an intermediate page to pay and verify): https://github.com/Monetizado/proxyjs
Monetizado Manage (to manage your content, to collect the money, and more): https://monetizado.github.io/manager/
Monetizado allows you to:
You can use monetized to protect pages so that only subscribers can see it, as in:
You can protect each page individually (each with its own ID, which you will see later in this document) and the user must pay to view each page, or all are classified under the same ID, so the user only pays once to view different pages. It's your decision as a content creator.
Monetizado is implemented in different Blockchain networks, below is the Id of each contract that you can use:
Testnet
Rootstock: 0xd0876600e82CCAa4aA0ab0Cd8bEa9c74F5b46De3
https://explorer.testnet.rootstock.io/address/0xd0876600e82ccaa4aa0ab0cd8bea9c74f5b46de3
Use Monetizado
Now we explain how to use Monetizado, both the smart contract (backend) and the Javascript library that you can implement on any Web platform in the frontend:
Now we explain about version 1 of Monetizado, explaining how to implement it in the backend of your platform through smart contracts, or in the frontend directly if you have a static site/content.
Smart contracts
Add protected Content
Indicates the content to be protected, giving a name and an amount (in the network's native currency, always in wei format), and returns a content Id (a sequential number associated with the creator's address).
function addProtectedContent(string memory name, uint256 accessCost) public returns (uint256)
Having the generated Id, plus the address of the content creator (msg.sender), it can be used in the following methods to view or pay for content.
Get Protected Contents For Current User
List all content protected by the content creator calling this method (msg.sender)
struct ProtectedContentInfo { string name; uint256 accessCost; bool isProtected; uint256 sequenceId; address creator; uint256 amountAvailable; uint256 amountCollected; }function getProtectedContentsForCurrentUser() public view returns (ProtectedContentInfo[] memory)
In ProtectedContentInfo, accessCost represents the cost (in wei) for the content that must be paid by users, isProtected if the content is protected, sequenceId is the sequential Id that you must use to distinguish the different contents of a creator, amountAvailable is the amount that the creator has available to withdraw, and amountCollected is the total amount that the creator has obtained for this content.
Get Protected Contents For Address and Id
Returns content protected by a specified content creator and Id
function getProtectedContentByAddressAndId(address creator, uint256 sequenceId) public view returns (ProtectedContentInfo memory)
Pay for content
A user (msg.sender) pays for the content they want to access, specifying the creator Id (address) and the sequential Id of the content.
function payAccess(address creator, uint256 sequenceId) external payable
In the value (msg.value) the exact value of the content must be specified (in new versions the amount may be dynamic), and the content must be protected (if it is not, it is not paid).
Current User Has Access
Checks if the current user (msg.sender) has access to a creator's specific content.
function currentUserHasAccess(address creator, uint256 sequenceId) public view returns(bool)
Change Access Cost
You can change the cost of access to specific content. You must be the creator to be able to change the cost.
function changeAccessCost(uint256 sequenceId, uint256 newCost) external
Unprotect Content
Unprotect content if you want content to be released to everyone.
function unprotectContent(uint256 sequenceId) external
Protect Content
Protect content if you want content to collect money from that.
function protectContent(uint256 sequenceId) external
Change Platform Fee
Specify the amount that the platform manager (in this case, Monetizado) receives as a fee for managing the contract and infrastructure, between 0.01 to 1%, but in numbers you must specify 1 (for 0.01) to 100 (1%).
function changePlatformFee(uint256 feePlatform) external onlyOwner
Withdraw Money From Content
The content creator can withdraw money from their content, specifying the ID and the amount they wish to withdraw (a discount is made for the platform fee from this amount).
function withdrawMoneyFromContent(uint256 sequenceId,uint256 amount) external
Get Platform Fee
You can see the platform fee percentage, 1 (for 0.01) to 100 (1%).
function getPlatformFee() public view returns(uint256)
Get Platform Balance
You can see the platform balance (collected from withdraws of creators).
function getPlatformBalance() public view returns(uint256)
Withdraw Money Platform
The owner of the contract can withdraw the money available as fees collected from the creation of content.
function withdrawMoneyPlatform(uint256 amount) external onlyOwner
Frontend
To use Monetized from the frontend (if you don't have access to the backend or have static content), you can use the available Javascript library: https://github.com/Monetizado/monetizadojs
ABI
If you need the ABI, that is available in the ABI folder in this repo.