> For the complete documentation index, see [llms.txt](https://docs.swarmnetwork.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swarmnetwork.org/swarm-protocol/spf/affiliate-manager-contract.md).

# Affiliate Manager Contract

* **Smart Contract:** specific to a Swarm Powered Fundraise for a specific SRC20
* **Created:** review the [SPF Deployment Sequence](https://www.swarmnetwork.org/swarm-protocol/spf#deployment-sequence); then referenced in the Swarm Powered Fundraise contract
* **Purpose:** Registers all currencies that will be accepted in a specific Swarm Powered Fundraise
* **Example:**  TBD

## Feature Description

### Read Functions

| Function                                            | Description                                                                                                                                 |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `affiliateLinks(address)` returns `(string)`        | Returns the affiliate link of an affiliate address                                                                                          |
| `affiliates(address)` returns `(struct)`            | Returns the Affiliate object from the affiliate address: `struct Affiliate {string affiliateLink;string affiliateLink;uint256 percentage;}` |
| `getAffiliate(string)` returns `(address, uint256)` | Returns the address and percentage amount of an affiliate. It takes the affiliate link as a parameter                                       |
| `isOwner()` returns `(bool)`                        | Returns true if the calling address is the contract owner                                                                                   |
| `owner()` returns `(address)`                       | Returns the address of the owner of the contract                                                                                            |

### Write Functions

| Function                                                    | Description                                                                                                                                                                                                                                                                     |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `removeAffiliate(address)` returns `(bool)`                 | Removes an affiliate from the list of affiliates accepted in a Swarm Powered Fundraise; the parameter is the address of the affiliate wallet                                                                                                                                    |
| `setupAffiliate(address, string, uint256)` returns `(bool)` | Setup a new affiliate; the first parameter is the address of the affiliate’s wallet, the second is the affiliate link and the third is the participation percentage amount that determines participation of the affiliate whenever a contribution references the affiliate link |
| `renounceOwnership()`                                       | Contract owner can renounce ownership of the contract                                                                                                                                                                                                                           |
| `transferOwnership()`                                       | Transfers ownership of this Affiliate Manager contract to a new contract owner                                                                                                                                                                                                  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.swarmnetwork.org/swarm-protocol/spf/affiliate-manager-contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
