ERC20Mintable.sol 645 B

123456789101112131415161718192021222324
  1. pragma solidity ^0.5.0;
  2. import "./ERC20.sol";
  3. import "../../access/roles/MinterRole.sol";
  4. /**
  5. * @dev Extension of `ERC20` that adds a set of accounts with the `MinterRole`,
  6. * which have permission to mint (create) new tokens as they see fit.
  7. *
  8. * At construction, the deployer of the contract is the only minter.
  9. */
  10. contract ERC20Mintable is ERC20, MinterRole {
  11. /**
  12. * @dev See `ERC20._mint`.
  13. *
  14. * Requirements:
  15. *
  16. * - the caller must have the `MinterRole`.
  17. */
  18. function mint(address account, uint256 amount) public onlyMinter returns (bool) {
  19. _mint(account, amount);
  20. return true;
  21. }
  22. }