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 onlyInitializingInitializes 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 onlyEmergencyAdminSets 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 onlyEmergencyAdminSets 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 overrideTransfers 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 isActiveMints 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 isFrozenBurns 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