MintableERC20
Inherits: IERC20Metadata, ERC20
This ERC20 contract is used for testing purposes, to allow users to mint tokens
State Variables
_decimals
The number of decimals the token uses
uint8 internal _decimals;
Functions
constructor
constructor(string memory _name, string memory _symbol, uint8 __decimals) ERC20(_name, _symbol);
Parameters
Name | Type | Description |
---|---|---|
_name | string | The name of the ERC20 token |
_symbol | string | The symbol of the ERC20 token |
__decimals | uint8 | The number of decimals the token uses |
decimals
function decimals() public view virtual override(ERC20, IERC20Metadata) returns (uint8 __decimals);
mint
Mint tokens to the caller
The minting amount is capped to uint192 to avoid overflowing supply
function mint(uint256 _wei) external;
Parameters
Name | Type | Description |
---|---|---|
_wei | uint256 | The amount of tokens to mint (in wei representation) |
mint
Mint tokens to the specified user
The minting amount is capped to uint192 to avoid overflowing supply
function mint(address _usr, uint256 _wei) external;
Parameters
Name | Type | Description |
---|---|---|
_usr | address | Address of the user to mint tokens to |
_wei | uint256 | The amount of tokens to mint (in wei representation) |