# VaultFundraise

**Inherits:** IVaultFundraiseUser, ReentrancyGuardUpgradeable, PausableInternal

Handles the user-facing deposit and refund logic for the fundraise.

Users can only claim their refund if the admin allows it. Centralization is made on purpose. As a user you accept to expose your self at vault's terms or conditions changes.

Require the admin to register the IP and fractionalize it when the fundraise is closed. If you do not trust the admin will do it, DO NOT deposit funds into the fundraise.

## Functions

### claimRefund

Claims refund, only when the vault is Canceled

```solidity
function claimRefund(address usdc) external virtual override nonReentrant whenNotPaused returns (uint128 amount);
```

**Parameters**

| Name   | Type      | Description                                                                   |
| ------ | --------- | ----------------------------------------------------------------------------- |
| `usdc` | `address` | The USDC address to claim refund for, used as payment token for the fundraise |

**Returns**

| Name     | Type      | Description                          |
| -------- | --------- | ------------------------------------ |
| `amount` | `uint128` | The amount of the USDC token claimed |

### deposit

Deposits USDC to the vault, only when the vault is Open

```solidity
function deposit(address usdc, uint128 amount) external virtual override nonReentrant whenNotPaused;
```

**Parameters**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `usdc`   | `address` | The USDC address to deposit for the fundraise |
| `amount` | `uint128` | The amount of the USDC token to deposit       |

### \_checkFundraise

```solidity
function _checkFundraise(VaultFundraiseStorage.FundraiseLayout storage $, address claimer, address usdc) internal;
```

### \_fundraiseCalculateClaim

```solidity
function _fundraiseCalculateClaim(
    VaultFundraiseStorage.FundraiseLayout storage $,
    address claimer,
    address usdc,
    uint256 totalSupplyOfFractionalToken
) internal view returns (uint256);
```


---

# 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.ariaprotocol.xyz/technical-docs/contract-docs/iprwa/vault/fundraise/vaultfundraise.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.
