TokenController
TokenController
Section titled “TokenController”TokenController at token-bridge v2.7.0 is inherited by the destination-chain XVS token; it is not deployed separately. Its mint accounting is per authorized minter. minterToMintedAmount increases when that minter mints and decreases when it burns.
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
Section titled “Solidity API”accessControlManager
Section titled “accessControlManager”Access control manager contract address.
address accessControlManagerminterToCap
Section titled “minterToCap”A mapping is used to keep track of the maximum amount a minter is permitted to mint.
mapping(address => uint256) minterToCapminterToMintedAmount
Section titled “minterToMintedAmount”A Mapping used to keep track of the amount i.e already minted by minter.
mapping(address => uint256) minterToMintedAmountPauses Token
function pause() external⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager.
unpause
Section titled “unpause”Resumes Token
function unpause() external⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager.
updateBlacklist
Section titled “updateBlacklist”Function to update blacklist.
function updateBlacklist(address user_, bool value_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| user_ | address | User address to be affected. |
| value_ | bool | Boolean to toggle value. |
📅 Events
Section titled “📅 Events”- Emits BlacklistUpdated event.
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager.
setMintCap
Section titled “setMintCap”Sets the minting cap for minter.
function setMintCap(address minter_, uint256 amount_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| minter_ | address | Minter address. |
| amount_ | uint256 | Cap for the minter. |
📅 Events
Section titled “📅 Events”- Emits MintCapChanged.
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager.
setAccessControlManager
Section titled “setAccessControlManager”Sets the address of the access control manager of this contract.
function setAccessControlManager(address newAccessControlAddress_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| newAccessControlAddress_ | address | New address for the access control. |
📅 Events
Section titled “📅 Events”- Emits NewAccessControlManager.
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only owner.
❌ Errors
Section titled “❌ Errors”- ZeroAddressNotAllowed is thrown when newAccessControlAddress_ contract address is zero.
migrateMinterTokens
Section titled “migrateMinterTokens”Moves the full recorded minted amount from one minter’s accounting bucket to another. The destination minter must already have enough cap, the addresses must differ, and the operation does not move ERC-20 balances.
function migrateMinterTokens(address source_, address destination_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source_ | address | Minter whose recorded minted amount is cleared |
| destination_ | address | Minter that receives the recorded minted amount |
Access requirements
Section titled “Access requirements”- Controlled by AccessControlManager using
migrateMinterTokens(address,address).
isBlackListed
Section titled “isBlackListed”Returns the blacklist status of the address.
function isBlackListed(address user_) external view returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| user_ | address | Address of user to check blacklist status. |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | bool | bool status of blacklist. |