# 资产保险库

## 资产保险库创建

资产保险库（品牌：Arcade Vault）是一种持有合约，可作为多种资产的安全存储机制。 Asset Vault 合约可以持有任一或所有 ETH、ERC20、ERC721、ERC1155 和/或 CryptoPunks。

{% hint style="info" %}
所有资产保险库都对贷款报价开放。创建 资产保险库 后，始终可以通过将给定资产发送到资产保险库的合约地址来进行额外存款。
{% endhint %}

<figure><img src="https://files.readme.io/14bcb2e-Asset_Vault_-_Create__Deposit.png" alt=""><figcaption></figcaption></figure>

1. 用户通过与 VaultFactory 智能合约进行交易来初始化 Vault 创建。交易完成后，用户的钱包会获得一个 VaultFactory 代币（ERC721），代表 资产保险库 的所有权。

```sol
initializeBundle(), createVault(), mint()
```

2\. 用户将资产转移到他们创建的特定资产库。

```sol
transfer()
```

## 资产保险库提款

{% hint style="info" %}
出于安全目的，资产保险库在原生创建时是禁用提款的。只有在取款被禁用时才能启动贷款。只有用户才能从禁用提款切换到启用提款。如果用户启用提款，则保险库无法签订借贷协议，也无法转让给其他用户。
{% endhint %}

<figure><img src="https://files.readme.io/490feaa-Arcade_Vault_-_Withdrawals_.png" alt=""><figcaption></figcaption></figure>

在默认状态下，存入的资产不能被提款。只有在保险库所有者调用“enableWithdraw()”后，状态才会被设置为withdrawEnabled状态。提款一旦启用就不能被禁用。

1. 用户从资产保险库启用提款。

```sol
enableWithdraw()
```

2\. 资产保险库将指定代币（ETH、ERC20s、ERC721、ERC1155 和/或 CryptoPunks）的全部余额转移到用户的钱包中。

```sol
withdrawERC20(), withdrawERC721(), withdrawERC1155(), withdrawETH(), withdrawPunk()
```


---

# 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://leon2.gitbook.io/arcade.xyz-cn/smart-contracts/zi-chan-bao-xian-ku.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.
