# CommissionShare

## Contents

## Globals

| Var       | Type    |
| --------- | ------- |
| validator | address |

## Functions

### constructor

No description

**Declaration:**

```solidity
  function constructor(
  ) public ERC20 Only
```

**Modifiers:**

| Modifier |
| -------- |
| ERC20    |
| Only     |

### estimateSharesToAmount

Estimate how much REI should be stake, if user wants to get the number of shares, or estimate how much REI can be obtained, if user unstake the amount of REI.

**Declaration:**

```solidity
  function estimateSharesToAmount(
    uint256 shares
  ) external returns (uint256 amount)
```

**Modifiers:** No modifiers

**Args:**

| Arg      | Type    | Description      |
| -------- | ------- | ---------------- |
| `shares` | uint256 | Number of shares |

### estimateAmountToShares

Estimate how much shares should be unstake, if user wants to get the amount of REI, or estimate how much shares can be obtained, if user stake the amount of REI.

**Declaration:**

```solidity
  function estimateAmountToShares(
    uint256 amount
  ) external returns (uint256 shares)
```

**Modifiers:** No modifiers

**Args:**

| Arg      | Type    | Description   |
| -------- | ------- | ------------- |
| `amount` | uint256 | Number of REI |

### mint

Mint share token to `to` address. Can only be called by stake manager.

**Declaration:**

```solidity
  function mint(
    address to
  ) external nonReentrant onlyStakeManager returns (uint256 shares)
```

**Modifiers:**

| Modifier         |
| ---------------- |
| nonReentrant     |
| onlyStakeManager |

**Args:**

| Arg  | Type    | Description      |
| ---- | ------- | ---------------- |
| `to` | address | Receiver address |

### burn

Burn shares and return REI to `to` address. Can only be called by stake manager.

**Declaration:**

```solidity
  function burn(
    uint256 shares
  ) external nonReentrant onlyStakeManager returns (uint256 amount)
```

**Modifiers:**

| Modifier         |
| ---------------- |
| nonReentrant     |
| onlyStakeManager |

**Args:**

| Arg      | Type    | Description                   |
| -------- | ------- | ----------------------------- |
| `shares` | uint256 | Number of shares to be burned |

### reward

Reward validator.

**Declaration:**

```solidity
  function reward(
  ) external nonReentrant onlyStakeManager
```

**Modifiers:**

| Modifier         |
| ---------------- |
| nonReentrant     |
| onlyStakeManager |

### slash

Slash validator and transfer the slashed amount to `address(0)`.

**Declaration:**

```solidity
  function slash(
    uint8 factor
  ) external nonReentrant onlyStakeManager returns (uint256 amount)
```

**Modifiers:**

| Modifier         |
| ---------------- |
| nonReentrant     |
| onlyStakeManager |

**Args:**

| Arg      | Type  | Description   |
| -------- | ----- | ------------- |
| `factor` | uint8 | Slash factor. |


---

# 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.rei.network/developer/system-contracts/commissionshare.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.
