# Admin

{% hint style="info" %}
Each data union has **one admin who is the owner** of the data union. The admin is **responsible for maintaining** the Data Union, including **ensuring good data quality** and **removing members** who are **not contributing data**.

An admin **is not automatically a member** of the Data Union.

Any **function of the SDK that changes the state of the contract** has to get called by the **admin address**.
{% endhint %}

### Admin Fee

The admin gets **incentivized to maintain** the data union **by the admin fee parameter**, a fraction of the incoming data union revenue. Admins have **control over this fee** parameter. **Members agree to it by joining** the data union. Previous earnings are not affected by changing the admin fee.

```typescript
const tx = await dataUnion.setAdminFee(VALUE_BETWEEN_0_AND_1);

const adminFee = await dataUnion.getAdminFee();
```

### Transfer Ownership

The data union smart contract **inherits an** [**Ownable.sol contract**](https://github.com/dataunions/data-unions/blob/master/packages/contracts/contracts/Ownable.sol) that handles the ownership of the data union. The account that **deploys the contract is the initial owner/admin of the contract**.

The **role can be reassigned to someone else** or even performed by the members themselves via a DAO governed wallet.

{% hint style="info" %}
Transfer the ownership with a **direct contract transaction**.
{% endhint %}

> 1️⃣ Call <mark style="color:red;">`transferOwnership($newAddress)`</mark>
>
> 2️⃣ Call <mark style="color:red;">`claimOwnership()`</mark> while your wallet is connected with the <mark style="color:red;">`$newAddress`</mark>

#### How to call contract functions:

{% content-ref url="../contract-functions" %}
[contract-functions](https://docs.dataunions.org/main-concepts/contract-functions)
{% endcontent-ref %}

### Data Union Metadata

**Store information** about your data union in a **JSON** **file on-chain** inside the contract. For example you can store a DAO manifesto, a name or anything else you can think of.

```typescript
const tx = await dataUnion.setMetadata(
    {"name": "awesome DU", "maintainer": ["josh#4223", "marc#2324"]}
);

const metadata = await dataUnion.getMetadata();
```

### Member Stipend

**Automate sending tokens to new members**. The parameter `stipendWei` determines how many tokens should get send to every new data union member.

The stipend will be paid by the contract balance in the native token (e.g. MATIC, xDAI or ETH).

{% hint style="danger" %} <mark style="background-color:red;">Be careful with this</mark>. We highly recommend to **carefully** **monitor who is joining the data union**. An attacker could join with multiple wallets until the contract wallet is empty.
{% endhint %}

```typescript
const tx = await dataUnion.setNewMemberStipend($amount_as_wei);

const memberStipend = await dataUnion.getNewMemberStipend();
```

### Adding Modules

// coming soon
