> ## Documentation Index
> Fetch the complete documentation index at: https://docs.initia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# ERC20Factory

GitHub:
[ERC20Factory](https://github.com/initia-labs/initia-evm-contracts/blob/main/src/ERC20Factory.sol)

## Overview

The `ERC20Factory` contract creates new InitiaERC20 tokens and registers them
with the MiniEVM's ERC20Registry.

## Imports

* [InitiaERC20.sol](/resources/developer/contract-references/evm/initia-erc20):
  Contains the implementation of the ERC20 token.
* [ERC20Registry.sol](/resources/developer/contract-references/evm/erc20-registry):
  Contains the implementation of the ERC20 registry.

## Events

### `ERC20Created`

Emitted when a new ERC20 token is created.

| Parameter | Type              | Description                                                |
| --------- | ----------------- | ---------------------------------------------------------- |
| `erc20`   | `address indexed` | The address of the newly created ERC20 token.              |
| `owner`   | `address indexed` | The address of the owner of the newly created ERC20 token. |

## Functions

### `createERC20`

Creates a new ERC20 token and registers it with the ERC20 registry.

```solidity theme={null}
function createERC20(string memory name, string memory symbol, uint8 decimals) external returns (address)
```

#### Parameters

| Name       | Type            | Description                                   |
| ---------- | --------------- | --------------------------------------------- |
| `name`     | `string memory` | The name of the new ERC20 token.              |
| `symbol`   | `string memory` | The symbol of the new ERC20 token.            |
| `decimals` | `uint8`         | The decimal precision of the new ERC20 token. |

#### Returns

| Type      | Description                                   |
| --------- | --------------------------------------------- |
| `address` | The address of the newly created ERC20 token. |

#### Emits

* [ERC20Created](#erc20created)
