# IMultiDepositorVault

Interface for vaults that can accept deposits from multiple addresses

## Functions

### setBeforeTransferHook

Set the before transfer hooks

```solidity
function setBeforeTransferHook(IBeforeTransferHook hooks) external;
```

**Parameters**

| Name    | Type                  | Description                       |
| ------- | --------------------- | --------------------------------- |
| `hooks` | `IBeforeTransferHook` | The before transfer hooks address |

### enter

Deposit tokens into the vault and mint units

```solidity
function enter(address sender, IERC20 token, uint256 tokenAmount, uint256 unitsAmount, address recipient) external;
```

**Parameters**

| Name          | Type      | Description                    |
| ------------- | --------- | ------------------------------ |
| `sender`      | `address` | The sender of the tokens       |
| `token`       | `IERC20`  | The token to deposit           |
| `tokenAmount` | `uint256` | The amount of token to deposit |
| `unitsAmount` | `uint256` | The amount of units to mint    |
| `recipient`   | `address` | The recipient of the units     |

### exit

Withdraw tokens from the vault and burn units

```solidity
function exit(address sender, IERC20 token, uint256 tokenAmount, uint256 unitsAmount, address recipient) external;
```

**Parameters**

| Name          | Type      | Description                     |
| ------------- | --------- | ------------------------------- |
| `sender`      | `address` | The sender of the units         |
| `token`       | `IERC20`  | The token to withdraw           |
| `tokenAmount` | `uint256` | The amount of token to withdraw |
| `unitsAmount` | `uint256` | The amount of units to burn     |
| `recipient`   | `address` | The recipient of the tokens     |

## Events

### BeforeTransferHookSet

Emitted when the before transfer hook is updated

```solidity
event BeforeTransferHookSet(address indexed beforeTransferHook);
```

**Parameters**

| Name                 | Type      | Description                          |
| -------------------- | --------- | ------------------------------------ |
| `beforeTransferHook` | `address` | The new before transfer hook address |

### ProvisionerSet

Emitted when the provisioner is updated

```solidity
event ProvisionerSet(address indexed provisioner);
```

**Parameters**

| Name          | Type      | Description                 |
| ------------- | --------- | --------------------------- |
| `provisioner` | `address` | The new provisioner address |

### Enter

Emitted when tokens are deposited into the vault

```solidity
event Enter(
    address indexed sender, address indexed recipient, IERC20 indexed token, uint256 tokenAmount, uint256 unitsAmount
);
```

**Parameters**

| Name          | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `sender`      | `address` | The address initiating the deposit    |
| `recipient`   | `address` | The address receiving the vault units |
| `token`       | `IERC20`  | The token being deposited             |
| `tokenAmount` | `uint256` | The amount of tokens deposited        |
| `unitsAmount` | `uint256` | The amount of vault units minted      |

### Exit

Emitted when tokens are withdrawn from the vault

```solidity
event Exit(
    address indexed sender, address indexed recipient, IERC20 indexed token, uint256 tokenAmount, uint256 unitsAmount
);
```

**Parameters**

| Name          | Type      | Description                           |
| ------------- | --------- | ------------------------------------- |
| `sender`      | `address` | The address initiating the withdrawal |
| `recipient`   | `address` | The address receiving the tokens      |
| `token`       | `IERC20`  | The token being withdrawn             |
| `tokenAmount` | `uint256` | The amount of tokens withdrawn        |
| `unitsAmount` | `uint256` | The amount of vault units burned      |

## Errors

### Aera\_\_UnitsLocked

```solidity
error Aera__UnitsLocked();
```

### Aera\_\_ZeroAddressProvisioner

```solidity
error Aera__ZeroAddressProvisioner();
```

### Aera\_\_CallerIsNotProvisioner

```solidity
error Aera__CallerIsNotProvisioner();
```
