This contract governs the issuance and management of B3TR fungible tokens within the VeBetter ecosystem, allowing for minting under a capped total supply.
Extends ERC20 Token Standard with capping, pausing, and access control functionalities to manage B3TR tokens in the VeBetter ecosystem.
bytes32 MINTER_ROLE
bytes32 PAUSER_ROLE
constructor(address _admin, address _defaultMinter, address _pauser) public
Initializes the contract with specified cap, token details, and admin roles
Name | Type | Description |
---|---|---|
_admin | address | The address that will be granted the default admin role |
_defaultMinter | address | The address that will be granted the minter role initially |
_pauser | address | The address that will be granted the pauser role initially |
function pause() external
Pauses all token transfers and minting actions
Accessible only by accounts with the default admin role
function unpause() external
Resumes all token transfers and minting actions
Accessible only by accounts with the default admin role
function mint(address to, uint256 amount) external
Mints new tokens to a specified address
The caller must have the MINTER_ROLE, and the total token supply after minting must not exceed the cap
Name | Type | Description |
---|---|---|
to | address | The address that will receive the minted tokens |
amount | uint256 | The amount of tokens to be minted |
function tokenDetails() external view returns (string, string, uint8, uint256, uint256)
Retrieves token details in a single call
Name | Type | Description |
---|---|---|
[0] | string | name The name of the token |
[1] | string | symbol The symbol of the token |
[2] | uint8 | decimals The number of decimals the token uses |
[3] | uint256 | totalSupply The total supply of the tokens |
[4] | uint256 | cap The cap on the token’s total supply |
function _update(address from, address to, uint256 value) internal
This function overrides ERC20Capped and ERC20Pausable to ensure proper hook chaining
Internal function to update state during token transfers and burns
Name | Type | Description |
---|---|---|
from | address | The address from which tokens are being transferred or burned |
to | address | The address to which tokens are being transferred |
value | uint256 | The amount of tokens being transferred or burned |