MintableERC20

Git Source

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

NameTypeDescription
_namestringThe name of the ERC20 token
_symbolstringThe symbol of the ERC20 token
__decimalsuint8The 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

NameTypeDescription
_weiuint256The 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

NameTypeDescription
_usraddressAddress of the user to mint tokens to
_weiuint256The amount of tokens to mint (in wei representation)