Membership

Defines:

public struct Membership has store {
    membership: Table<address, u8>
}

Assert Membership

The assert_is_member function has these effects:

  1. Throws error (370 - EIsNotMember) if an address is not a member.

Create

The create function has these effects:

  1. Creates and returns a new Membership table

Get Length

The get_length function has these effects:

  1. Returns u64 length of the Membership table

Get Type

The get_type function has these effects:

  1. Returns u8 representation of the type of member (0 - WALLET, 1 - OBJECT)

Is Member

The is_member function has these effects:

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

Object Join

The object_join function has these effects:

  1. Adds the address as an object member.

  2. Returns (u8, u8) representations of (MEMBER_ADD, OBJECT)

Object Leave

The object_leave function has these effects:

  1. Removes the address as an object member.

  2. Returns (u8, u8) representations of (MEMBER_REMOVE, OBJECT)

Wallet Join

The wallet_join function has these effects:

  1. Adds the address as an wallet member.

  2. Returns (u8, u8) representations of (MEMBER_ADD, WALLET)

Wallet Leave

The wallet_leave function has these effects:

  1. Removes the address as an wallet member.

  2. Returns (u8, u8) representations of (MEMBER_REMOVE, WALLET)

Last updated