MintNFT
Inherits: NFTBase, IMintNFT, ERC2981, Initializable
State Variables
_characterId
uint256 internal _characterId;
_noteId
uint256 internal _noteId;
_web3Entry
address internal _web3Entry;
_tokenCounter
uint256 internal _tokenCounter;
_originalReceiver
mapping(uint256 => address) internal _originalReceiver;
Functions
onlyWeb3Entry
modifier onlyWeb3Entry();
onlyOwner
modifier onlyOwner();
initialize
Initialize the mint nft.
function initialize(
uint256 characterId_,
uint256 noteId_,
address web3Entry_,
string calldata name_,
string calldata symbol_
) external override initializer;
Parameters
Name | Type | Description |
---|---|---|
characterId_ | uint256 | The character ID of the note to initialize. |
noteId_ | uint256 | The note ID to initialize. |
web3Entry_ | address | The address of web3Entry contract. |
name_ | string | The name to set for this NFT. |
symbol_ | string | The symbol to set for this NFT. |
mint
Mints a note NFT to the specified address. This can only be called by web3Entry, and is called upon note.
function mint(address to) external override onlyWeb3Entry returns (uint256 tokenId);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address to mint the NFT to. |
Returns
Name | Type | Description |
---|---|---|
tokenId | uint256 | uint256 The minted token ID. |
setTokenRoyalty
Changes the royalty percentage of specific token ID for secondary sales. Can only be called by character owner of note.
function setTokenRoyalty(uint256 tokenId, address recipient, uint96 fraction)
external
override
onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | The token ID to set. |
recipient | address | The receive address. |
fraction | uint96 | The royalty percentage measured in basis points. Each basis point represents 0.01%. |
setDefaultRoyalty
Changes the default royalty percentage for secondary sales. Can only be called by character owner of note.
function setDefaultRoyalty(address recipient, uint96 fraction) external override onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
recipient | address | The receive address. |
fraction | uint96 | The royalty percentage measured in basis points. Each basis point represents 0.01%. |
deleteDefaultRoyalty
Deletes the default royalty percentage. Can only be called by character owner of note.
function deleteDefaultRoyalty() external override onlyOwner;
originalReceiver
Returns the original receiver of specified NFT.
function originalReceiver(uint256 tokenId) external view override returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of original receiver. |
getSourceNotePointer
Returns the source note pointer mapped to this note NFT.
function getSourceNotePointer()
external
view
override
returns (uint256 characterId, uint256 noteId);
Returns
Name | Type | Description |
---|---|---|
characterId | uint256 | The character ID. |
noteId | uint256 | The note ID. |
supportsInterface
Query if a contract implements an interface
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC2981, ERC721Enumerable)
returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the contract implements interfaceID and interfaceID is not 0xffffffff, false otherwise |
totalSupply
Count NFTs tracked by this contract
function totalSupply() public view override returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | A count of valid NFTs tracked by this contract, where each one of them has an assigned and queryable owner not equal to the zero address |
tokenURI
A distinct Uniform Resource Identifier (URI) for a given asset.
Throws if _tokenId
is not a valid NFT. URIs are defined in RFC
3986. The URI may point to a JSON file that conforms to the "ERC721
Metadata JSON Schema".
function tokenURI(uint256 tokenId) public view override returns (string memory uri);