IERC20Mintable
Interface for an ERC20 token with controlled minting and burning capabilities.
This interface extends the standard ERC20 functionality to include administrative functions for token supply management with proper access control. The mint and burn functions are restricted to the contract owner to ensure controlled supply changes. Key Features:
- ERC20 compliance for standard token operations
- Controlled minting and burning functionality with owner access control Events:
- Mint: Emitted when new tokens are minted
- Burn: Emitted when tokens are burned Access Control:
- mint(): Only owner
- burn(): Only owner
- ERC20 operations: All users
Functions
mint
Mints new tokens to the specified address, increasing total supply.
Only callable by the contract owner. This function increases both the total supply and the recipient's balance. Requirements:
- Caller must be the owner
toaddress must not be zero Emits:- Mint event with recipient and amount
- {Transfer} event from zero address to recipient
function mint(address to, uint256 amount) external;| Name | Type | Description |
|---|---|---|
to | address | Address to receive the newly minted tokens |
amount | uint256 | Amount of tokens to mint |
burn
Burns tokens from the specified address, decreasing total supply.
Only callable by the contract owner. This function decreases both the total supply and the target address's balance. Requirements:
- Caller must be the owner
fromaddress must not be zerofrommust have sufficient balance- If
fromis different fromspender,spendermust have allowance forfrom's tokens Emits: - Burn event with source address and amount
- {Transfer} event from source address to zero address
function burn(address from, address spender, uint256 amount) external;| Name | Type | Description |
|---|---|---|
from | address | Address to burn tokens from |
spender | address | Address initiating the burn (for allowance checks if different from from) |
amount | uint256 | Amount of tokens to burn |
Events
Mint
Emitted when new tokens are minted to an address.
This event is emitted after successful execution of the mint function. It provides transparency for token supply increases.
event Mint(address indexed to, uint256 amount);| Name | Type | Description |
|---|---|---|
to | address | The address receiving the minted tokens |
amount | uint256 | Number of tokens minted |
Burn
Emitted when tokens are burned from an address.
This event is emitted after successful execution of the burn function. It provides transparency for token supply decreases.
event Burn(address indexed from, uint256 amount);| Name | Type | Description |
|---|---|---|
from | address | Address whose tokens are burned |
amount | uint256 | Number of tokens burned |