# VaultFundraiseAdmin

**Inherits:** IVaultFundraiseAdmin, AccessControlInternal

Contains the admin and view functions for the VaultFundraise submodule.

The admin could make a flashloan attack when fundraise is enabled (see Pashov's audit report). If you do not trust the admin, do not interact with this contract.

## Functions

### cancelRaise

Cancels the fundraise vault, only when the vault is Open

*Only the admin can cancel the vault*

```solidity
function cancelRaise() external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### closeRaise

Closes the fundraise vault, only when the vault is Open

*Only the admin can close the vault*

```solidity
function closeRaise() external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### updateUsdcContractAddress

Admin updates the USDC contract address

*Only USDC is supported for the fundraise, admin MUST BE VERY CAREFUL on USDC address update.*

```solidity
function updateUsdcContractAddress(address newUSDC)
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name      | Type      | Description |
| --------- | --------- | ----------- |
| `newUSDC` | `address` |             |

### withdraw

Transfers all funds to the fund receiver, only when the vault is Closed

*Only the admin can withdraw funds*

```solidity
function withdraw()
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE)
    returns (address[] memory tokens, uint256[] memory withdrawnAmounts);
```

**Returns**

| Name               | Type        | Description                           |
| ------------------ | ----------- | ------------------------------------- |
| `tokens`           | `address[]` | The addresses of the tokens withdrawn |
| `withdrawnAmounts` | `uint256[]` | The amounts of the tokens withdrawn   |

### withdraw

```solidity
function withdraw(address token) external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### \_initializeFundraise

Initializes the fundraise-specific parts of the vault. Called by the main vault's initialize function.

```solidity
function _initializeFundraise(VaultFundraiseStorage.Setup memory setup) internal;
```


---

# 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/admin/children/vaultfundraiseadmin.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.
