Actions

Comment

The comment function has these effects:

  1. Asserts authentication

  2. Asserts the payment matches the configuration

  3. Borrow the Posts from the Post

  4. Creates a Post

  5. Adds Post to Posts

  6. Collect any fees

  7. Emits the "CommentCreated" event:

    1. public struct CommentCreated has copy, drop {
              id: address,
              app: String,
              created_at: u64,
              created_by: address,
              data: String,
              description: String,
              parent_post_id: address,
              title: String
      }
  8. Returns (post address, sender address, timestamp)

Create

The create function has these effects:

  1. Asserts authentication

  2. Creates a Post

  3. Adds Post to Posts

  4. Returns (post address, sender address, timestamp)

Like

The create function has these effects:

  1. Asserts authentication

  2. Asserts the payment matches the configuration

  3. Borrow the Likes from the Post

  4. Add Like to the Likes

  5. Distribute the payments via the Royalties config

  6. Emits the "PostLiked" event:

    1. public struct PostLiked has copy, drop {
              id: address,
              updated_at: u64,
              user: address
      }

Last updated