# ArcticArchitectureLens

[Git Source](https://github.com/Ion-Protocol/nucleus-boring-vault/blob/cc0b494b83e17b9b169a73b96050d2810b690477/src/helper/ArcticArchitectureLens.sol)

## Functions

### totalAssets

*Calculates the total assets held in the BoringVault for a given vault and accountant.*

```solidity
function totalAssets(
    BoringVault boringVault,
    AccountantWithRateProviders accountant
)
    external
    view
    returns (ERC20 asset, uint256 assets);
```

**Parameters**

| Name          | Type                          | Description                               |
| ------------- | ----------------------------- | ----------------------------------------- |
| `boringVault` | `BoringVault`                 | The BoringVault contract.                 |
| `accountant`  | `AccountantWithRateProviders` | The AccountantWithRateProviders contract. |

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `asset`  | `ERC20`   | The ERC20 asset, `assets` is given in terms of. |
| `assets` | `uint256` | The total assets held in the vault.             |

### previewDeposit

*Calculates the number of shares that will be received for a given deposit amount in the BoringVault.*

```solidity
function previewDeposit(
    ERC20 depositAsset,
    uint256 depositAmount,
    BoringVault boringVault,
    AccountantWithRateProviders accountant
)
    external
    view
    returns (uint256 shares);
```

**Parameters**

| Name            | Type                          | Description                               |
| --------------- | ----------------------------- | ----------------------------------------- |
| `depositAsset`  | `ERC20`                       | The ERC20 asset being deposited.          |
| `depositAmount` | `uint256`                     | The amount of the asset being deposited.  |
| `boringVault`   | `BoringVault`                 | The BoringVault contract.                 |
| `accountant`    | `AccountantWithRateProviders` | The AccountantWithRateProviders contract. |

**Returns**

| Name     | Type      | Description                                 |
| -------- | --------- | ------------------------------------------- |
| `shares` | `uint256` | The number of shares that will be received. |

### balanceOf

*Retrieves the balance of shares for a given account in the BoringVault.*

```solidity
function balanceOf(address account, BoringVault boringVault) external view returns (uint256 shares);
```

**Parameters**

| Name          | Type          | Description                 |
| ------------- | ------------- | --------------------------- |
| `account`     | `address`     | The address of the account. |
| `boringVault` | `BoringVault` | The BoringVault contract.   |

**Returns**

| Name     | Type      | Description                            |
| -------- | --------- | -------------------------------------- |
| `shares` | `uint256` | The balance of shares for the account. |

### balanceOfInAssets

*Calculates the balance of a user in terms of asset for a given account in the BoringVault.*

```solidity
function balanceOfInAssets(
    address account,
    BoringVault boringVault,
    AccountantWithRateProviders accountant
)
    external
    view
    returns (uint256 assets);
```

**Parameters**

| Name          | Type                          | Description                               |
| ------------- | ----------------------------- | ----------------------------------------- |
| `account`     | `address`                     | The address of the account.               |
| `boringVault` | `BoringVault`                 | The BoringVault contract.                 |
| `accountant`  | `AccountantWithRateProviders` | The AccountantWithRateProviders contract. |

**Returns**

| Name     | Type      | Description                            |
| -------- | --------- | -------------------------------------- |
| `assets` | `uint256` | The balance of assets for the account. |

### exchangeRate

*Retrieves the current exchange rate from the AccountantWithRateProviders contract.*

```solidity
function exchangeRate(AccountantWithRateProviders accountant) external view returns (uint256 rate);
```

**Parameters**

| Name         | Type                          | Description                               |
| ------------ | ----------------------------- | ----------------------------------------- |
| `accountant` | `AccountantWithRateProviders` | The AccountantWithRateProviders contract. |

**Returns**

| Name   | Type      | Description                |
| ------ | --------- | -------------------------- |
| `rate` | `uint256` | The current exchange rate. |

### checkUserDeposit

*Checks if a user's deposit meets certain conditions.*

```solidity
function checkUserDeposit(
    address account,
    ERC20 depositAsset,
    uint256 depositAmount,
    BoringVault boringVault,
    TellerWithMultiAssetSupport teller
)
    external
    view
    returns (bool);
```

**Parameters**

| Name            | Type                          | Description                               |
| --------------- | ----------------------------- | ----------------------------------------- |
| `account`       | `address`                     | The address of the user.                  |
| `depositAsset`  | `ERC20`                       | The ERC20 asset being deposited.          |
| `depositAmount` | `uint256`                     | The amount of the asset being deposited.  |
| `boringVault`   | `BoringVault`                 | The BoringVault contract.                 |
| `teller`        | `TellerWithMultiAssetSupport` | The TellerWithMultiAssetSupport contract. |

**Returns**

| Name     | Type   | Description                                                      |
| -------- | ------ | ---------------------------------------------------------------- |
| `<none>` | `bool` | A boolean indicating if the user's deposit meets the conditions. |

### checkUserDepositWithPermit

*Checks if a user's deposit (with permit) meets certain conditions.*

```solidity
function checkUserDepositWithPermit(
    address account,
    ERC20 depositAsset,
    uint256 depositAmount,
    TellerWithMultiAssetSupport teller
)
    external
    view
    returns (bool);
```

**Parameters**

| Name            | Type                          | Description                               |
| --------------- | ----------------------------- | ----------------------------------------- |
| `account`       | `address`                     | The address of the user.                  |
| `depositAsset`  | `ERC20`                       | The ERC20 asset being deposited.          |
| `depositAmount` | `uint256`                     | The amount of the asset being deposited.  |
| `teller`        | `TellerWithMultiAssetSupport` | The TellerWithMultiAssetSupport contract. |

**Returns**

| Name     | Type   | Description                                                      |
| -------- | ------ | ---------------------------------------------------------------- |
| `<none>` | `bool` | A boolean indicating if the user's deposit meets the conditions. |

### userUnlockTime

*Retrieves the unlock time for a user's shares in the TellerWithMultiAssetSupport contract.*

```solidity
function userUnlockTime(address account, TellerWithMultiAssetSupport teller) external view returns (uint256 time);
```

**Parameters**

| Name      | Type                          | Description                               |
| --------- | ----------------------------- | ----------------------------------------- |
| `account` | `address`                     | The address of the user.                  |
| `teller`  | `TellerWithMultiAssetSupport` | The TellerWithMultiAssetSupport contract. |

**Returns**

| Name   | Type      | Description                            |
| ------ | --------- | -------------------------------------- |
| `time` | `uint256` | The unlock time for the user's shares. |

### isTellerPaused

Checks if the TellerWithMultiAssetDepositSupport contract is paused.

```solidity
function isTellerPaused(TellerWithMultiAssetSupport teller) external view returns (bool);
```


---

# 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.nucleusearn.io/nucleus-architecture/smart-contracts/contracts/helper/arcticarchitecturelens.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.
