* Change import path from zos-lib to upgrades in all contracts * Update readme with new naming * Update package and deps names * Change path to initializable in AST of networks.jsons * Migrate manifest version * Use new oz file locations * Rename in ERC20Migrator comments * Update SDK install instructions in README * Update gitignore to use new session file name * trigger CI * Fixes to readme and package version * Use 2.5.0 release of OpenZeppelin SDK
34 lines
1.1 KiB
Solidity
34 lines
1.1 KiB
Solidity
pragma solidity ^0.5.2;
|
|
|
|
import "@openzeppelin/upgrades/contracts/Initializable.sol";
|
|
import "./ERC721Metadata.sol";
|
|
import "../../access/roles/MinterRole.sol";
|
|
|
|
|
|
/**
|
|
* @title ERC721MetadataMintable
|
|
* @dev ERC721 minting logic with metadata
|
|
*/
|
|
contract ERC721MetadataMintable is Initializable, ERC721, ERC721Metadata, MinterRole {
|
|
function initialize(address sender) public initializer {
|
|
require(ERC721._hasBeenInitialized());
|
|
require(ERC721Metadata._hasBeenInitialized());
|
|
MinterRole.initialize(sender);
|
|
}
|
|
|
|
/**
|
|
* @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;
|
|
}
|
|
|
|
uint256[50] private ______gap;
|
|
}
|