> For the complete documentation index, see [llms.txt](https://docs.inverter.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inverter.network/contracts/technical-reference/external/erc20issuance/erc20issuance_v1.sol.md).

# ERC20Issuance\_v1.sol

[Git Source](https://github.com/InverterNetwork/inverter-contracts/blob/2a8a4c80ff4f24a59546d4e6126b81bc51228c94/src/external/token/ERC20Issuance_v1.sol)

**Inherits:** [IERC20Issuance\_v1](/contracts/technical-reference/external/erc20issuance/interfaces/ierc20issuance_v1.sol.md), [ERC20Capped](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/19a657bef8354f2a655900654955739b70dfbde9/contracts/token/ERC20/extensions/ERC20Capped.sol), [Ownable](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/19a657bef8354f2a655900654955739b70dfbde9/contracts/access/Ownable.sol)

**Author:** Inverter Network

This contract creates an[ {ERC20Capped}](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/19a657bef8354f2a655900654955739b70dfbde9/contracts/token/ERC20/extensions/ERC20Capped.sol) token with a supply cap and a whitelist-gated functionality to mint and burn tokens.

*The contract implements functionalities for:*

* *Managing a whitelist of allowed minters.*
* *Minting and burning tokens by members of said whitelist.*
* *Enforcing a supply cap on minted tokens.*

### State Variables

#### allowedMinters

*The mapping of allowed minters.*

```solidity
mapping(address => bool) public allowedMinters;
```

#### \_decimals

*The number of decimals of the token.*

```solidity
uint8 internal immutable _decimals;
```

### Functions

#### onlyMinter

*Modifier to guarantee the caller is a minter.*

```solidity
modifier onlyMinter();
```

#### constructor

```solidity
constructor(
    string memory name_,
    string memory symbol_,
    uint8 decimals_,
    uint maxSupply_,
    address initialAdmin_
) ERC20(name_, symbol_) ERC20Capped(maxSupply_) Ownable(initialAdmin_);
```

#### decimals

```solidity
function decimals() public view override returns (uint8);
```

#### setMinter

Sets the minting rights of an address.

```solidity
function setMinter(address _minter, bool _allowed) external onlyOwner;
```

**Parameters**

| Name       | Type      | Description                               |
| ---------- | --------- | ----------------------------------------- |
| `_minter`  | `address` | The address of the minter.                |
| `_allowed` | `bool`    | If the address is allowed to mint or not. |

#### mint

Mints new tokens.

```solidity
function mint(address _to, uint _amount) external onlyMinter;
```

**Parameters**

| Name      | Type      | Description                   |
| --------- | --------- | ----------------------------- |
| `_to`     | `address` | The address of the recipient. |
| `_amount` | `uint256` | The amount of tokens to mint. |

#### burn

Burns tokens.

```solidity
function burn(address _from, uint _amount) external onlyMinter;
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `_from`   | `address` | The address of the owner or approved address. |
| `_amount` | `uint256` | The amount of tokens to burn.                 |

#### \_setMinter

Sets the minting rights of an address.

```solidity
function _setMinter(address _minter, bool _allowed) internal;
```

**Parameters**

| Name       | Type      | Description                               |
| ---------- | --------- | ----------------------------------------- |
| `_minter`  | `address` | The address of the minter.                |
| `_allowed` | `bool`    | If the address is allowed to mint or not. |
