# TokenController

## TokenController

TokenController contract acts as a governance and access control mechanism, allowing the owner to manage minting restrictions and blacklist certain addresses to maintain control and security within the token ecosystem. It provides a flexible framework for token-related operations.

## Solidity API

#### accessControlManager

Access control manager contract address.

```solidity
address accessControlManager
```

***

#### minterToCap

A mapping is used to keep track of the maximum amount a minter is permitted to mint.

```solidity
mapping(address => uint256) minterToCap
```

***

#### minterToMintedAmount

A Mapping used to keep track of the amount i.e already minted by minter.

```solidity
mapping(address => uint256) minterToMintedAmount
```

***

#### pause

Pauses Token

```solidity
function pause() external
```

**⛔️ Access Requirements**

* Controlled by AccessControlManager.

***

#### unpause

Resumes Token

```solidity
function unpause() external
```

**⛔️ Access Requirements**

* Controlled by AccessControlManager.

***

#### updateBlacklist

Function to update blacklist.

```solidity
function updateBlacklist(address user_, bool value_) external
```

**Parameters**

| Name    | Type    | Description                  |
| ------- | ------- | ---------------------------- |
| user\_  | address | User address to be affected. |
| value\_ | bool    | Boolean to toggle value.     |

**📅 Events**

* Emits BlacklistUpdated event.

**⛔️ Access Requirements**

* Controlled by AccessControlManager.

***

#### setMintCap

Sets the minting cap for minter.

```solidity
function setMintCap(address minter_, uint256 amount_) external
```

**Parameters**

| Name     | Type    | Description         |
| -------- | ------- | ------------------- |
| minter\_ | address | Minter address.     |
| amount\_ | uint256 | Cap for the minter. |

**📅 Events**

* Emits MintCapChanged.

**⛔️ Access Requirements**

* Controlled by AccessControlManager.

***

#### setAccessControlManager

Sets the address of the access control manager of this contract.

```solidity
function setAccessControlManager(address newAccessControlAddress_) external
```

**Parameters**

| Name                      | Type    | Description                         |
| ------------------------- | ------- | ----------------------------------- |
| newAccessControlAddress\_ | address | New address for the access control. |

**📅 Events**

* Emits NewAccessControlManager.

**⛔️ Access Requirements**

* Only owner.

**❌ Errors**

* ZeroAddressNotAllowed is thrown when newAccessControlAddress\_ contract address is zero.

***

#### isBlackListed

Returns the blacklist status of the address.

```solidity
function isBlackListed(address user_) external view returns (bool)
```

**Parameters**

| Name   | Type    | Description                                |
| ------ | ------- | ------------------------------------------ |
| user\_ | address | Address of user to check blacklist status. |

**Return Values**

| Name | Type | Description               |
| ---- | ---- | ------------------------- |
| \[0] | bool | bool status of blacklist. |

***


---

# 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://docs-v4.venus.io/technical-reference/reference-xvs-bridge/tokencontroller.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.
