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
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC2981, ERC721Enumerable) returns (bool);
totalSupply
function totalSupply() public view override returns (uint256);
tokenURI
function tokenURI(uint256 tokenId) public view override returns (string memory uri);