createPost(bool _wantToMonetizeThisPost) |
Allows users to create a new post. Users can choose to monetize the post by setting the _wantToMonetizeThisPost parameter. Ensures users meet minimum requirements like paying creation fees before creating the post. |
_wantToMonetizeThisPost: bool - Whether the post should be monetized. |
Public |
depositFunds(uint256 _amount, uint256 _postId) |
Enables users to deposit funds into a specific post's monetization pool. The function updates the post's total amount and records deposit information such as locking duration. |
_amount: uint256 - Amount to deposit. _postId: uint256 - ID of the post to deposit into. |
Public |
sellFunds(uint256 _postId, uint256 _depositID, uint256 _amount, uint256 _likes, uint256 _views, uint256 _shares, uint256 _followers) |
Allows users to sell their investment in a post and retrieve funds. The function calculates rewards based on engagement metrics and transfers corresponding funds to the user's wallet. |
_postId: uint256 - ID of the post. _depositID: uint256 - ID of the deposit. _amount: uint256 - Amount to sell. _likes: uint256 - Number of likes. _views: uint256 - Number of views. _shares: uint256 - Number of shares. _followers: uint256 - Number of followers. |
Public |
_calculateEngagementRate(uint256 likes, uint256 shares, uint256 views, uint256 followers) |
Calculates the engagement rate of a post based on various metrics, crucial for revenue calculation and user rewards. |
likes: uint256 - Number of likes. shares: uint256 - Number of shares. views: uint256 - Number of views. followers: uint256 - Number of followers. |
Internal |
_updateEngagement(uint256 fixedExpenses, uint256 newLikes, uint256 newShares, uint256 newViews, uint256 newFollowers) |
Updates engagement metrics and revenue generated by a post, considering fixed expenses and new engagement data. |
fixedExpenses: uint256 - Fixed expenses like creation fees. newLikes: uint256 - New likes. newShares: uint256 - New shares. newViews: uint256 - New views. newFollowers: uint256 - New followers. |
Internal |
_calculateRevenue(uint256 likes, uint256 shares, uint256 views, uint256 followers) |
Calculates the revenue generated by a post based on engagement metrics, influencing user rewards and monetization distribution. |
likes: uint256 - Number of likes. shares: uint256 - Number of shares. views: uint256 - Number of views. followers: uint256 - Number of followers. |
Internal |
getUserDeposits(address _user) |
Retrieves information about a user's deposits, returning an array of Deposit structs with details such as deposited amount, locking duration, and post ID. |
_user: address - Address of the user whose deposits are being queried. |
Public |