* Bump required compiler version to 0.5.2. * Fix shadowed variable warning in ERC20Migrator. * Rename Counter to Counters. * Add dummy state variable to SafeERC20Helper. * Update changelog entry. * Fix CountersImpl name. * Improve changelog entry.
25 lines
767 B
Solidity
25 lines
767 B
Solidity
pragma solidity ^0.5.2;
|
|
|
|
import "./ERC721Metadata.sol";
|
|
import "../../access/roles/MinterRole.sol";
|
|
|
|
|
|
/**
|
|
* @title ERC721MetadataMintable
|
|
* @dev ERC721 minting logic with metadata
|
|
*/
|
|
contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole {
|
|
/**
|
|
* @dev Function to mint tokens
|
|
* @param to The address that will receive the minted tokens.
|
|
* @param tokenId The token id to mint.
|
|
* @param tokenURI The token URI of the minted token.
|
|
* @return A boolean that indicates if the operation was successful.
|
|
*/
|
|
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {
|
|
_mint(to, tokenId);
|
|
_setTokenURI(tokenId, tokenURI);
|
|
return true;
|
|
}
|
|
}
|