# ERC20 Vault Deployment

To deploy an ERC20 Vault for your project or use case, follow these steps:

1. **Determine the Tokens or Assets**: Decide which tokens or assets will be deposited into your vault.
2. **Find the Corresponding mToken Address**: Visit the [Contracts](https://docs.moonwell.fi/moonwell/protocol-information/contracts) page and find the corresponding mToken address for the tokens or assets you want to use. Please note that these vaults are only available on the [Base](https://base.org) network.
3. **Navigate to the Factory4626 Contract**: If depositing ERC20 tokens, navigate to the [Factory4626 contract](https://basescan.org/address/0xe770bd40b6976efbbb095174395dd2cb794c938a#writeContract#F1) on the Basescan page.
4. **Connect to Web3**: Connect to Web3 using MetaMask or another wallet provider on the Basescan page.
5. **Find the Underlying Token Address**: Call the `underlying` method on the mToken through the **Read as Proxy** page. This will reveal the ERC20 token that needs to be deposited to mint the mToken.

<figure><img src="https://38185780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4535Mbmb8O8Y5q8Xz3cK%2Fuploads%2Fs8DHohZhnUgeK7jqLBem%2FScreenshot%202024-06-13%20at%202.09.26%E2%80%AFPM.png?alt=media&#x26;token=cf64e349-7a91-460e-950f-b25ae7b193b8" alt=""><figcaption></figcaption></figure>

6. **Ensure Sufficient Token Balance**: Make sure the deploying wallet has a balance of at least `10 ** ((underlying token decimals * 2) / 3)` of the underlying token.
7. **Approve Token Spending**: Approve the underlying token to be spent by the 4626 factory address. The approved amount should be at least `10 ** ((underlying token decimals * 2) / 3)`.
8. **Enter the mToken Address**: In the Factory4626 contract, enter the mToken address corresponding to the underlying token you want to use for the vault.

<figure><img src="https://38185780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4535Mbmb8O8Y5q8Xz3cK%2Fuploads%2FWCkI1BGtHs7OgBmGBDZA%2FScreenshot%202024-06-13%20at%201.30.14%E2%80%AFPM.png?alt=media&#x26;token=5ea7c416-b8bf-4e40-baaf-859270c4f19e" alt=""><figcaption></figcaption></figure>

9. **Specify the Reward Recipient Address**: Enter the reward recipient address that will receive the rewards on behalf of the 4626 depositors.

<figure><img src="https://38185780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4535Mbmb8O8Y5q8Xz3cK%2Fuploads%2FdqznlwH6IsUGVDQDPAW9%2FScreenshot%202024-06-13%20at%201.31.21%E2%80%AFPM.png?alt=media&#x26;token=9a8f1872-2cad-4c0d-a4c1-ba52762d1b9f" alt=""><figcaption></figcaption></figure>

10. **Deploy the Vault**: Click **Write** and approve the transaction that pops up in your wallet. This will deduct `10 ** ((underlying token decimals * 2) / 3)` from your token balance to create an initial mint amount in the vault that is burned. This burn amount helps mitigate share price inflation attacks where an attacker front-runs an initial depositor and increases the share price.

Once the transaction confirms, your new ERC20 4626 Vault will have been created and will be ready for use.
