Token Contract
Last updated
Last updated
Token Minting: Controlled minting via MINTER_ROLE with no supply cap.
Transfer Restriction: Token transfers are initially disabled. Only addresses with TRANSFER_ROLE, the owner, or mint operations can transfer tokens before transfers are enabled. Transfers can be permanently enabled via the admin using enableTransfers()
.
Access Control Management: Role-based access control using OpenZeppelin's AccessControlDefaultAdminRules
Default Admin: Grants the ability to enable transfers and manage roles.
Transfer Role: Addresses assigned TRANSFER_ROLE can execute transfers even when transfers are disabled.
Minter Role: Addresses assigned MINTER_ROLE are authorized to mint new tokens.
Features
Role-Based Access Control: Implements OpenZeppelin's AccessControlDefaultAdminRules
DEFAULT_ADMIN_ROLE
: Can enable transfers and manage other roles
MINTER_ROLE
: Can mint new tokens
TRANSFER_ROLE
: Can transfer tokens before transfers are enabled
Controlled Token Transfers:
Transfers are initially disabled
Only addresses with TRANSFER_ROLE
, the owner, or minting operations can transfer tokens when transfers are disabled
Transfers can be enabled by admin (one-way operation - cannot be disabled once enabled)
Token Minting:
Controlled minting through MINTER_ROLE
No maximum supply cap
Inheritance
OpenZeppelin's ERC20
OpenZeppelin's ERC20Burnable
OpenZeppelin's AccessControlDefaultAdminRules
Key Functions
mint(address to, uint256 amount)
: Allows MINTER_ROLE
to mint new tokens
enableTransfers()
: Allows admin to enable transfers for all holders
burn(uint256 amount)
: Allows token holders to burn their tokens (inherited from ERC20Burnable)