Separate ERC721Mintable (#1365)
* separate part of ERC721Mintable into ERC721MetadataMintable * remove mint and burn from 721 tests * Fixed linter error. * fix ERC721 mint tests * Minor fixes.pull/1389/merge
parent
b41b125c15
commit
744f567f40
@ -0,0 +1,32 @@ |
||||
pragma solidity ^0.4.24; |
||||
|
||||
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 tokenURI |
||||
) |
||||
public |
||||
onlyMinter |
||||
returns (bool) |
||||
{ |
||||
_mint(to, tokenId); |
||||
_setTokenURI(tokenId, tokenURI); |
||||
return true; |
||||
} |
||||
} |
Loading…
Reference in new issue