Actions
Create User
The create function has these effects:
Asserts the payment matches the configuration
Asserts invite is not required or is included
If required, verifies invite exists and is valid
If included:
Asserts invite exists
Asserts invite is valid
Determine referer's wallet address
Deletes invite reference
Creates Membership and Posts tables
Creates a Soul
Creates a User
Adds the User name to the User Registry
Collects any payment
Emits the "UserCreated" event:
public struct UserCreated has copy, drop { id: address, avatar_hash: String, banner_hash: String, created_at: u64, description: String, invited_by: Option<address>, owner: address, soul: address, user_key: String, user_name: String }
Create Invite
Asserts authentication
Asserts invites are not required
Asserts the payment matches the configuration
Creates an Invite
Collects any payment
Emits the "InviteCreated" event:
Create Invite (Admin)
Creates an Invite
Emits the "InviteCreated" event:
Join
The join function has these effects:
Asserts authentication
Asserts the payment matches the configuration
Asserts User is not following themself
Borrow Membership table from User
Add User to the Membership table
Emits the "UserMembershipUpdate" event:
Collect any payment
Leave
The leave function has these effects:
Asserts the payment matches the configuration
Borrow Membership table from User
Remove User from the Membership table
Emits the "UserMembershipUpdate" event:
Collect any payment
Post
The post function has these effects:
Asserts the payment matches the configuration
Borrow Posts table from User
Create Post
Add Post to Posts table
Collect any payment
Emits the "UserPostCreated" event:
Return (post address, timestamp)
Update
The update function has these effects:
Asserts the payment matches the configuration
Asserts new name matches old name, and that the User belongs to the wallet address
Update User data
Collect any payment
Emits the "UserUpdated" event:
Last updated