> For the complete documentation index, see [llms.txt](https://docs.kuthulu.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuthulu.xyz/contracts/groups.md).

# Groups

### Table of Contents

1. [Events](#events)
2. [Public Functions](#public-functions)

***

## <mark style="color:purple;">Events</mark>

### logLeaveGroup

This event is emitted when a member leaves a group.

### logJoinGroup

This event is emitted when a new member joins a group.

### logUpdateGroupNameFormat

This event is emitted when the group name's format is updated.

***

## <mark style="color:purple;">Public Functions</mark>

### getOwnerOfGroupByID

Retrieves the owner address of the specified group.

**Inputs**

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| groupID | uint256 | Unique ID of the group |

**Returns**

| Name | Type    | Description                   |
| ---- | ------- | ----------------------------- |
|      | address | Address of the owner of group |

```javascript
// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const owner = await contract.getOwnerOfGroupByID(groupID);
```

***

### getMembersOfGroupByID

Retrieves the member addresses of the specified group.

**Inputs**

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| groupID | uint256 | Unique ID of the group |

**Returns**

| Name | Type       | Description                           |
| ---- | ---------- | ------------------------------------- |
|      | address\[] | Addresses of the members of the group |

```javascript
// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const members = await contract.getMembersOfGroupByID(groupID);
```

***

### isMemberOfGroupByID

Checks if a user or group is a member of the specified group.

**Inputs**

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| groupID | uint256 | Unique ID of the group |
| member  | address | Address of the member  |

**Returns**

| Name | Type | Description                                |
| ---- | ---- | ------------------------------------------ |
|      | bool | True if they are a member, false otherwise |

```javascript
// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const memberAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your member address
const isMember = await contract.isMemberOfGroupByID(groupID, memberAddress);
```

***

### getGroupID

Gets the Group ID of a group from the group name.

**Inputs**

| Name      | Type   | Description       |
| --------- | ------ | ----------------- |
| groupName | string | Name of the group |

**Returns**

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
|      | uint256 | Unique ID of the group |

```javascript
// Example usage with ethers.js
const groupName = 'GroupName'; // Replace with your group name
const groupID = await contract.getGroupID(groupName);
```

***

### getGroupAddressFromID

Gets the Group address of a group from the group ID.

**Inputs**

| Name    | Type    | Description            |
| ------- | ------- | ---------------------- |
| groupID | uint256 | Unique ID of the group |

**Returns**

| Name | Type    | Description          |
| ---- | ------- | -------------------- |
|      | address | Address of the group |

```javascript
// Example usage with ethers.js
const groupID = 1234; // Replace with your groupID
const groupAddress = await contract.getGroupAddressFromID(groupID);
```

***

### getGroupIDFromAddress

Gets the Group ID of a group from the group address.

**Inputs**

| Name         | Type    | Description          |
| ------------ | ------- | -------------------- |
| groupAddress | address | Address of the group |

**Returns**

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
|      | uint256 | Unique ID of the group |

```javascript
// Example usage with ethers.js
const groupAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your group address
const groupID = await contract.getGroupIDFromAddress(groupAddress);
```

***

### getOwnerOfGroupByAddress

Gets the owner address of a group from the group address.

**Inputs**

| Name         | Type    | Description          |
| ------------ | ------- | -------------------- |
| groupAddress | address | Address of the group |

**Returns**

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
|      | address | Address of the group owner |

```javascript
// Example usage with ethers.js
const groupAddress = '0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520'; // Replace with your group address
const ownerAddress = await contract
```
