Moderation

Defines:

public struct Moderation has store {
    moderation: Table<address, u8>
}

Assert Moderator

The assert_is_moderator function has these effects:

  1. Throws error (371 - EIsNotModerator) if an address is not a moderator.

Assert Ownership

The assert_is_owner function has these effects:

  1. Throws error (372 - EIsNotOwner) if an address is not the owner.

Create

The create function has these effects:

  1. Creates a new Moderation table.

  2. Makes sender the owner of the Moderation table.

  3. Returns (ModerationTable, u8, u8) representations of (ModerationTable, MODERATOR_ADD, OWNER)

Get Length

The get_length function has these effects:

  1. Returns u64 length of the Moderation table

Is Moderator

The is_moderator function has these effects:

  1. Returns boolean if the address exists in the Moderation table

Is Owner

The is_owner function has these effects:

  1. Returns boolean if the address is labeled as the owner in the Moderation table

Add Moderator

The make_moderator function has these effects:

  1. Adds the address as a moderator in the Moderation table.

  2. Returns (u8, u8) representations of (MODERATOR_ADD, MODERATOR)

Add Owner

The make_owner function has these effects:

  1. Adds the address as an owner in the Moderation table.

  2. Returns (u8, u8) representations of (MODERATOR_ADD, OWNER)

Remove Moderator

The remove_moderator function has these effects:

  1. Removes the address as a moderator.

  2. Returns (u8, u8) representations of (MODERATOR_REMOVE, MODERATOR)

Last updated