# Affiliate Member

## Purpose

`AffiliateMember` is an abstract smart contract that serves as a foundation for managing an affiliate membership system. It leverages OpenZeppelin's `AccessControl` for role-based access control, enabling specific functionalities to be restricted to users with certain roles.

### Key Features

* **One per Address:** Each wallet can hold exactly zero or one Pass.
* **Referral Tracking:** Every Pass stores its permanent inviter at the time of minting.
* **Bonus Accumulators:** Tracks direct betting and staking rewards generated by invitees.

| Function                                                                                  | Description                                        |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `getInviter`                                                                              | Returns the inviter of a specific member.          |
| `getInviteesCount`                                                                        | Returns the number of invitees a member has.       |
| `getMembersCount`                                                                         | Returns the total count of members.                |
| `getInvitee`                                                                              | Returns a specific invitee of a member.            |
| `getInvitees`                                                                             | Returns all invitees of a member.                  |
| `claimDirectBettingBonus`, `claimDirectStakingBonus`, `claimMatchingBonus`                | Allows claiming of various bonuses for members.    |
| `getClaimedDirectStakingBonus`, `getClaimedDirectBettingBonus`, `getClaimedMatchingBonus` | Returns the amount of bonuses claimed by a member. |

## Events

* `NewMember(address indexed member, address indexed inviter, address indexed parent)`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.celestium.digital/smartcontracts-description/pass-contract/affiliate-member.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
