NoteToken
NoteToken
Template for SOT/JOT token
_poolAddress
address _poolAddress
_noteTokenType
uint8 _noteTokenType
_decimals
uint8 _decimals
initialize
function initialize(string name, string symbol, uint8 decimalsOfToken, address poolAddressOfToken, uint8 typeOfToken) public
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual
This function is used to check if the transfer from one address to another is valid.
It uses the registry contract's isValidNoteTokenTransfer
method to verify this.
If the 'from' address is zero, it means that we are minting new tokens and there is no need for validation.
Parameters
Name | Type | Description |
---|---|---|
from | address | The address of the sender. |
to | address | The address of the receiver. |
amount | uint256 | The amount of tokens being transferred. |
poolAddress
function poolAddress() external view returns (address)
The address of the pool is stored in a private variable _poolAddress
.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the pool. |
noteTokenType
function noteTokenType() external view returns (uint8)
Returns the type of Note Token used by this contract.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint8 | uint8 representing the note token type. |
decimals
function decimals() public view returns (uint8)
Returns the number of decimals used to get the user representation of a token amount.
For example, if name
returns "MyToken"
, then a user might see 123456
MyTokens in their wallet,
with decimals()
returning 6
, because the base unit (or "unit") is 0.000001
MyToken.
See {ERC20-_setupDecimals} to change the number of decimals.
burn
function burn(uint256 amount) public
_Burns a specific amount of tokens from the caller's account, reducing its total supply. Requirements:
- The caller must have at least
amount
tokens. Emits a {Burn} event._
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of token to burn. |
mint
function mint(address receiver, uint256 amount) public
Function to mint new tokens
Parameters
Name | Type | Description |
---|---|---|
receiver | address | Address of the account that will receive the newly created tokens. |
amount | uint256 | Amount of tokens to be minted. |
pause
function pause() public virtual
Pauses all token transfers. See {ERC20PresetMinterPauserUpgradeable-pause}.
paused
function paused() public view virtual returns (bool)
This function is used to check if the contract is paused.
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | bool - Returns true if the contract is paused, false otherwise. |
unpause
function unpause() public virtual
Unpauses the contract, re-enabling token transfers and minting.