BaseToken

BaseToken.sol is a contract that provides the base implementation for ERC20 tokens used within the Unlockd Protocol.

Key functions:

function __BaseToken_init(
    address aclManager_, 
    address uTokenVault_, 
    uint8 decimals_, 
    string calldata name_, 
    string calldata symbol_
) internal onlyInitializing

Initializes the BaseToken contract with the provided parameters.

Parameters:

aclManager_: The address of the ACL manager contract.

uTokenVault_: The address of the UToken vault contract.

decimals_: The number of decimals used by the token.

name_: The name of the token.

symbol_: The symbol of the token.


function setActive(bool active) external onlyEmergencyAdmin

Sets the active state of the token.

Parameters:

active: A boolean indicating whether to set the token as active or not.


function setFrozen(bool frozen) external onlyEmergencyAdmin

Sets the frozen state of the token.

Parameters:

frozen: A boolean indicating whether to set the token as frozen or not.


function decimals() public view virtual override returns (uint8)

Returns the number of decimals used by the token.

Returns:

The number of decimals as a uint8.


function _transfer(
    address sender, 
    address recipient, 
    uint256 amount
) internal virtual override

Transfers tokens from the sender to the recipient.

Parameters:

sender: The address of the sender.

recipient: The address of the recipient.

amount: The amount of tokens to transfer.


function _mint(
    address account, 
    uint256 amount
) internal virtual override isFrozen isActive

Mints new tokens to the specified account.

Parameters:

account: The address of the account to mint tokens to.

amount: The amount of tokens to mint.


function _burn(
    address account, 
    uint256 amount
) internal virtual override isFrozen

Burns tokens from the specified account.

Parameters:

account: The address of the account to burn tokens from.

amount: The amount of tokens to burn.

Last updated