# IERC20Errors

[Git Source](https://github.com/Ion-Protocol/ion-protocol/blob/88cc595825f1dc2eb738fb93e172a3e8ab7a5c43/src/token/IERC20Errors.sol)

*Standard ERC20 Errors Interface of the <https://eips.ethereum.org/EIPS/eip-6093\\[ERC-6093>] custom errors for ERC20 tokens.*

### [Errors](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#errors" id="errors"></a>

#### [ERC20InsufficientBalance](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20insufficientbalance" id="erc20insufficientbalance"></a>

*Indicates an error related to the current `balance` of a `sender`. Used in transfers.*

```
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
```

**Parameters**

| Name      | Type      | Description                                    |
| --------- | --------- | ---------------------------------------------- |
| `sender`  | `address` | Address whose tokens are being transferred.    |
| `balance` | `uint256` | Current balance for the interacting account.   |
| `needed`  | `uint256` | Minimum amount required to perform a transfer. |

#### [ERC20InvalidSender](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20invalidsender" id="erc20invalidsender"></a>

*Indicates a failure with the token `sender`. Used in transfers.*

```
error ERC20InvalidSender(address sender);
```

**Parameters**

| Name     | Type      | Description                                 |
| -------- | --------- | ------------------------------------------- |
| `sender` | `address` | Address whose tokens are being transferred. |

#### [ERC20InvalidReceiver](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20invalidreceiver" id="erc20invalidreceiver"></a>

*Indicates a failure with the token `receiver`. Used in transfers.*

```
error ERC20InvalidReceiver(address receiver);
```

**Parameters**

| Name       | Type      | Description                                    |
| ---------- | --------- | ---------------------------------------------- |
| `receiver` | `address` | Address to which tokens are being transferred. |

#### [ERC20InsufficientAllowance](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20insufficientallowance" id="erc20insufficientallowance"></a>

*Indicates a failure with the `spender`’s `allowance`. Used in transfers.*

```
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
```

**Parameters**

| Name        | Type      | Description                                                                 |
| ----------- | --------- | --------------------------------------------------------------------------- |
| `spender`   | `address` | Address that may be allowed to operate on tokens without being their owner. |
| `allowance` | `uint256` | Amount of tokens a `spender` is allowed to operate with.                    |
| `needed`    | `uint256` | Minimum amount required to perform a transfer.                              |

#### [ERC20InvalidApprover](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20invalidapprover" id="erc20invalidapprover"></a>

*Indicates a failure with the `approver` of a token to be approved. Used in approvals.*

```
error ERC20InvalidApprover(address approver);
```

**Parameters**

| Name       | Type      | Description                               |
| ---------- | --------- | ----------------------------------------- |
| `approver` | `address` | Address initiating an approval operation. |

#### [ERC20InvalidSpender](https://docs.ionprotocol.io/devs/smart-contract-architecture/token/broken-reference) <a href="#erc20invalidspender" id="erc20invalidspender"></a>

*Indicates a failure with the `spender` to be approved. Used in approvals.*

```
error ERC20InvalidSpender(address spender);
```

**Parameters**

| Name      | Type      | Description                                                                 |
| --------- | --------- | --------------------------------------------------------------------------- |
| `spender` | `address` | Address that may be allowed to operate on tokens without being their owner. |
