# IFeeVault

Interface for vaults that support fees but don't have multiple depositors

## Functions

### setFeeRecipient

Set the fee recipient

```solidity
function setFeeRecipient(address newFeeRecipient) external;
```

**Parameters**

| Name              | Type      | Description                   |
| ----------------- | --------- | ----------------------------- |
| `newFeeRecipient` | `address` | The new fee recipient address |

### claimFees

Claim accrued fees for msg.sender

*Automatically claims any earned protocol fees for the protocol*

```solidity
function claimFees() external returns (uint256 feeRecipientFees, uint256 protocolFees);
```

**Returns**

| Name               | Type      | Description                                               |
| ------------------ | --------- | --------------------------------------------------------- |
| `feeRecipientFees` | `uint256` | The amount of fees to be claimed by the fee recipient     |
| `protocolFees`     | `uint256` | The amount of protocol fees to be claimed by the protocol |

### claimProtocolFees

Claim accrued protocol fees

```solidity
function claimProtocolFees() external returns (uint256 protocolFees);
```

**Returns**

| Name           | Type      | Description                                               |
| -------------- | --------- | --------------------------------------------------------- |
| `protocolFees` | `uint256` | The amount of protocol fees to be claimed by the protocol |

### setFeeCalculator

Set the fee calculator

*newFeeCalculator can be zero, which has the effect as disabling the fee calculator*

```solidity
function setFeeCalculator(IFeeCalculator newFeeCalculator) external;
```

**Parameters**

| Name               | Type             | Description            |
| ------------------ | ---------------- | ---------------------- |
| `newFeeCalculator` | `IFeeCalculator` | The new fee calculator |

### feeCalculator

Get the fee calculator

```solidity
function feeCalculator() external view returns (IFeeCalculator);
```

**Returns**

| Name     | Type             | Description                         |
| -------- | ---------------- | ----------------------------------- |
| `<none>` | `IFeeCalculator` | The current fee calculator contract |

### FEE\_TOKEN

Get the fee token

```solidity
function FEE_TOKEN() external view returns (IERC20);
```

**Returns**

| Name     | Type     | Description                     |
| -------- | -------- | ------------------------------- |
| `<none>` | `IERC20` | The token used for fee payments |

## Events

### FeesClaimed

Emitted when fees are claimed by the fee recipient

```solidity
event FeesClaimed(address indexed feeRecipient, uint256 fees);
```

**Parameters**

| Name           | Type      | Description                   |
| -------------- | --------- | ----------------------------- |
| `feeRecipient` | `address` | The address claiming the fees |
| `fees`         | `uint256` | The amount of fees claimed    |

### ProtocolFeesClaimed

Emitted when protocol fees are claimed

```solidity
event ProtocolFeesClaimed(address indexed protocolFeeRecipient, uint256 protocolEarnedFees);
```

**Parameters**

| Name                   | Type      | Description                            |
| ---------------------- | --------- | -------------------------------------- |
| `protocolFeeRecipient` | `address` | The address claiming the protocol fees |
| `protocolEarnedFees`   | `uint256` | The amount of protocol fees claimed    |

### FeeRecipientUpdated

Emitted when the fee recipient is updated

```solidity
event FeeRecipientUpdated(address indexed newFeeRecipient);
```

**Parameters**

| Name              | Type      | Description                   |
| ----------------- | --------- | ----------------------------- |
| `newFeeRecipient` | `address` | The new fee recipient address |

### FeeCalculatorUpdated

Emitted when the fee calculator is updated

```solidity
event FeeCalculatorUpdated(address indexed newFeeCalculator);
```

**Parameters**

| Name               | Type      | Description                    |
| ------------------ | --------- | ------------------------------ |
| `newFeeCalculator` | `address` | The new fee calculator address |

## Errors

### Aera\_\_ZeroAddressFeeCalculator

```solidity
error Aera__ZeroAddressFeeCalculator();
```

### Aera\_\_ZeroAddressFeeToken

```solidity
error Aera__ZeroAddressFeeToken();
```

### Aera\_\_ZeroAddressFeeRecipient

```solidity
error Aera__ZeroAddressFeeRecipient();
```

### Aera\_\_NoFeesToClaim

```solidity
error Aera__NoFeesToClaim();
```

### Aera\_\_CallerIsNotFeeRecipient

```solidity
error Aera__CallerIsNotFeeRecipient();
```

### Aera\_\_CallerIsNotProtocolFeeRecipient

```solidity
error Aera__CallerIsNotProtocolFeeRecipient();
```
