> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redpotion.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Fund Share

> FundShare is the ERC-20 share token of a fund. One FundShare is deployed per fund, with 18 decimals. Holding shares represents a pro-rata claim on the fund's assets at the oracle-r

> Source: [`src/FundShare.sol`](https://github.com/zentryHQ/red-potion-contract/blob/main/src/FundShare.sol)

## Responsibility

`FundShare` is the **ERC-20 share token** of a fund. One FundShare is deployed per fund, with 18 decimals. Holding shares represents a pro-rata claim on the fund's assets at the oracle-reported price.

It is deliberately minimal: a standard `ERC20Upgradeable` where **only the Fund can mint and burn**. All supply changes happen inside the [Fund](/developers/contract-reference/fund)'s settlement flow:

* **Minted** to the [DepositQueue](/developers/contract-reference/deposit-queue) (user shares) and to fee recipients (entry/exit/management/performance/protocol fee shares) during `Fund.acceptReport`.
* **Burned** from the Fund's own balance when redeem batches settle (the RedeemQueue transfers the batch's shares to the Fund first).

Shares are freely transferable ERC-20s; users receive them by calling `DepositQueue.claimDeposit` after their batch settles.

## Flow

```
deposit settle:   Fund → mint(DepositQueue, userShares), mint(feeRecipient, feeShares)
user claim:       DepositQueue → transfer(user, proRataShares)
redeem request:   user → transferFrom(user, RedeemQueue, shares)
redeem settle:    RedeemQueue → transfer(Fund, batchShares); Fund → burn(Fund, batchShares)
```

## Function reference

| Function                                                                            | Access                                     | Description                                                     |
| ----------------------------------------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------- |
| `initialize(name, symbol, fund)`                                                    | initializer (via `FundManager.createFund`) | Sets ERC-20 metadata and binds the Fund. `fund` cannot be zero. |
| `mint(to, amount)`                                                                  | `onlyFund`                                 | Mints shares. Used exclusively by settlement/fee accrual.       |
| `burn(from, amount)`                                                                | `onlyFund`                                 | Burns shares. Used when redeem batches settle.                  |
| `fund()`                                                                            | view                                       | The bound Fund address.                                         |
| `totalSupply` / `balanceOf` / `transfer` / `approve` / `allowance` / `transferFrom` | standard ERC-20                            | Standard OZ ERC-20 behavior.                                    |

## Errors

| Error         | When                                                |
| ------------- | --------------------------------------------------- |
| `OnlyFund`    | `mint`/`burn` called by anyone other than the Fund. |
| `ZeroAddress` | `initialize` with zero fund address.                |

## Related

[Fund](/developers/contract-reference/fund) · [DepositQueue](/developers/contract-reference/deposit-queue) · [RedeemQueue](/developers/contract-reference/redeem-queue)
