ShareXUSDT
Inherits: ERC20, AccessControl
Title: ShareX USDT
This is a test token for development purposes only
ERC20 token for ShareX ecosystem testing on BSC testnet
State Variables
MINTER_ROLE
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE")
DECIMALS
uint8 private constant DECIMALS = 6
MAX_SUPPLY
uint256 public constant MAX_SUPPLY = 1_000_000_000 * 10 ** DECIMALS
Functions
constructor
Constructor that gives DEFAULT_ADMIN_ROLE and MINTER_ROLE to the deployer
constructor() ERC20("ShareX USDT", "XUSDT");
decimals
Returns the number of decimals used to get its user representation
function decimals() public pure override returns (uint8);
mint
Mints tokens to a specified address
function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE);
Parameters
| Name | Type | Description |
|---|---|---|
to | address | The address to mint tokens to |
amount | uint256 | The amount of tokens to mint |
burn
Burns tokens from the caller's account
function burn(uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | The amount of tokens to burn |
burnFrom
Burns tokens from a specified account (requires allowance)
function burnFrom(address from, uint256 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
from | address | The account to burn tokens from |
amount | uint256 | The amount of tokens to burn |
batchMint
Batch mint tokens to multiple addresses
function batchMint(address[] calldata recipients, uint256[] calldata amounts)
external
onlyRole(MINTER_ROLE);
Parameters
| Name | Type | Description |
|---|---|---|
recipients | address[] | Array of addresses to mint to |
amounts | uint256[] | Array of amounts to mint |
faucet
Limited to 1000 USDT per call to prevent abuse
Faucet function for testnet - allows anyone to mint small amounts for testing
function faucet() external;
Events
TokensMinted
event TokensMinted(address indexed to, uint256 amount);
TokensBurned
event TokensBurned(address indexed from, uint256 amount);
Errors
MaxSupplyExceeded
error MaxSupplyExceeded();
InvalidAmount
error InvalidAmount();