-
-
Notifications
You must be signed in to change notification settings - Fork 398
/
Copy pathnf-token-metadata-mock.sol
60 lines (54 loc) · 1.16 KB
/
nf-token-metadata-mock.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
56
57
58
59
60
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../tokens/nf-token-metadata.sol";
import "../ownership/ownable.sol";
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
contract NFTokenMetadataMock is
NFTokenMetadata,
Ownable
{
/**
* @dev Contract constructor.
* @param _name A descriptive name for a collection of NFTs.
* @param _symbol An abbreviated name for NFTokens.
*/
constructor(
string memory _name,
string memory _symbol
)
{
nftName = _name;
nftSymbol = _symbol;
}
/**
* @dev Mints a new NFT.
* @param _to The address that will own the minted NFT.
* @param _tokenId of the NFT to be minted by the msg.sender.
* @param _uri String representing RFC 3986 URI.
*/
function mint(
address _to,
uint256 _tokenId,
string calldata _uri
)
external
onlyOwner
{
super._mint(_to, _tokenId);
super._setTokenUri(_tokenId, _uri);
}
/**
* @dev Removes a NFT from owner.
* @param _tokenId Which NFT we want to remove.
*/
function burn(
uint256 _tokenId
)
external
onlyOwner
{
super._burn(_tokenId);
}
}