DineroERC20.sol
General Overview
The DineroERC20.sol
contract is an extension of the standard ERC20 token, incorporating additional features for minting and burning tokens in a permissioned manner. It achieves this by implementing access control mechanisms, which are governed by the MINTER_ROLE
and BURNER_ROLE
. These roles are crucial, as only accounts assigned with them are authorized to mint or burn tokens, respectively.
This controlled approach to token supply management is made possible through the integration of OpenZeppelin's AccessControlDefaultAdminRules
contract.
Technical Overview
Inherits: ERC20, AccessControlDefaultAdminRules
Author: redactedcartel.finance
State Variables
MINTER_ROLE
BURNER_ROLE
Functions
constructor
Parameters
Name | Type | Description |
---|---|---|
_name | string | Token name |
_symbol | string | Token symbol |
_decimals | uint8 | Token decimals |
_admin | address | Admin address |
_initialDelay | uint48 | Delay required to schedule the acceptance of a access control transfer started |
mint
Mints tokens to an address
Only callable by minters
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address to mint tokens to |
_amount | uint256 | Amount of tokens to mint |
burn
Burns tokens from an address
Only callable by burners
Parameters
Name | Type | Description |
---|---|---|
_from | address | Address to burn tokens from |
_amount | uint256 | Amount of tokens to burn |