ERC721MetadataMintable.sol 761 B

123456789101112131415161718192021222324
  1. pragma solidity ^0.4.24;
  2. import "./ERC721Metadata.sol";
  3. import "../../access/roles/MinterRole.sol";
  4. /**
  5. * @title ERC721MetadataMintable
  6. * @dev ERC721 minting logic with metadata
  7. */
  8. contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole {
  9. /**
  10. * @dev Function to mint tokens
  11. * @param to The address that will receive the minted tokens.
  12. * @param tokenId The token id to mint.
  13. * @param tokenURI The token URI of the minted token.
  14. * @return A boolean that indicates if the operation was successful.
  15. */
  16. function mintWithTokenURI(address to, uint256 tokenId, string tokenURI) public onlyMinter returns (bool) {
  17. _mint(to, tokenId);
  18. _setTokenURI(tokenId, tokenURI);
  19. return true;
  20. }
  21. }