forked from blockcoders/harmony-marketplace-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlockcodersHRC1155.sol
55 lines (48 loc) · 1.29 KB
/
BlockcodersHRC1155.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pragma solidity 0.5.17;
import "./ERC1155.sol";
import "./ERC1155Metadata.sol";
import "./ERC1155MintBurn.sol";
import "@openzeppelin/contracts/access/roles/MinterRole.sol";
contract BlockcodersHRC1155 is ERC1155, ERC1155MintBurn, ERC1155Metadata, MinterRole {
string private _name;
string private _symbol;
constructor(
string memory name,
string memory symbol,
string memory uri
) public ERC1155() {
_name = name;
_symbol = symbol;
_setBaseMetadataURI(uri);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
function mint(
address _to,
uint256 _id,
uint256 _quantity,
bytes memory _data
) public onlyMinter {
_mint(_to, _id, _quantity, _data);
}
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public onlyMinter returns (bool) {
_batchMint(to, ids, amounts, data);
return true;
}
}