- Create a new token contract that extends the default ERC20 contract created from the first three recipes. You can also include the following functions as part of the ERC20 contract itself, but it is recommended to modularize the code for better reusability:
pragma solidity ^0.4.23;import "./ERC20.sol";contract Mintable is ERC20 { ...}
- Create a mint function that will accept the target address and token amount as inputs. It should return a boolean value just like the transfer function:
function mint(address _to, uint amount) public returns (bool) { }
- Use this function to create new tokens and allocate them to a target user account. It is also important to add the newly created token count to the total supply function: