Skip to content

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.

Access control manager contract address.

address accessControlManager

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

mapping(address => uint256) minterToCap

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

mapping(address => uint256) minterToMintedAmount

Pauses Token

function pause() external
  • Controlled by AccessControlManager.

Resumes Token

function unpause() external
  • Controlled by AccessControlManager.

Function to update blacklist.

function updateBlacklist(address user_, bool value_) external
NameTypeDescription
user_addressUser address to be affected.
value_boolBoolean to toggle value.
  • Emits BlacklistUpdated event.
  • Controlled by AccessControlManager.

Sets the minting cap for minter.

function setMintCap(address minter_, uint256 amount_) external
NameTypeDescription
minter_addressMinter address.
amount_uint256Cap for the minter.
  • Emits MintCapChanged.
  • Controlled by AccessControlManager.

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

function setAccessControlManager(address newAccessControlAddress_) external
NameTypeDescription
newAccessControlAddress_addressNew address for the access control.
  • Emits NewAccessControlManager.
  • Only owner.
  • ZeroAddressNotAllowed is thrown when newAccessControlAddress_ contract address is zero.

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_) external
NameTypeDescription
source_addressMinter whose recorded minted amount is cleared
destination_addressMinter that receives the recorded minted amount
  • Controlled by AccessControlManager using migrateMinterTokens(address,address).

Returns the blacklist status of the address.

function isBlackListed(address user_) external view returns (bool)
NameTypeDescription
user_addressAddress of user to check blacklist status.
NameTypeDescription
[0]boolbool status of blacklist.