NFT721/1155
These functions are implemented on top of the standard NFT Protocols.
Functions
mint
function mint(uint256 _variationId) external payable
Mints a new token with the specified variation ID.
Parameters:
Name | Type | Description |
---|---|---|
_variationId | uint256 | The ID of the token variation to mint. |
mintWithURI
function mintWithURI(
address _signer,
bytes calldata _signature,
string calldata _uri,
bytes calldata _salt
) external payable;
Mints a new token with the specified variation ID.
Parameters:
Name | Type | Description |
---|---|---|
_signer | address | The address of the signer of the signature. |
_signature | bytes | The signature of the minting data. |
_uri | string | The URI for the minted token.. |
_salt | bytes | The salt value for signature verification. |
mintWhitelist
function mintWhitelist(bytes32[] memory _merkleProof, uint256 _variationId) external payable;
Mints a new token for a whitelisted address using a Merkle proof.
Parameters:
Name | Type | Description |
---|---|---|
_merkleProof | bytes32[] | The Merkle proof for address whitelisting. |
_variationId | uint256 | The ID of the token variation. |
mintWithURIWhitelist
function mintWithURIWhitelist(
bytes32[] memory _merkleProof,
address _signer,
bytes calldata _signature,
string calldata _uri,
bytes calldata _salt
) external payable;
Mints a new token for a whitelisted address using a Merkle proof and a signature.
Parameters:
Name | Type | Description |
---|---|---|
_merkleProof | bytes32[] | The Merkle proof for address whitelisting. |
_signer | address | The signer address used for the signature. |
_signature | bytes | The signature to be verified. |
_uri | string | The URI of the token. |
_salt | bytes | The salt used in the signature. |
subscribeToEntity
function subscribeToEntity(
address _owner,
uint256 _tokenId,
uint256 _entityId,
string calldata _entityDefaultUri
) external
Adds a single URI slot to a single non-fungible token (NFT) and initializes the added slot with the given entity's default URI. So that, token owner subscribes to the entity.Entity owner can change the URI of the slot. The added slot's initial state will be pre-filled with the entity's default URI.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the token owner. |
_tokenId | uint256 | The ID of the token to which the slot will be added. |
_entityId | uint256 | The ID of the slot's entity. |
_entityDefaultUri | string | The entity's default URI that will be set to the added slot. |
subscribeToEntities
function subscribeToEntities(
address _owner,
uint256 _tokenId,
uint256[] calldata _entityIds,
string[] calldata _entityDefaultUris
) external
Adds multiple URI slots to a single token in a batch operation. So that, token owner subscribes to the entity.Entity owner can change the URI of the slot. Slots' initial state will be pre-filled with the given default URI values.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the token owner. |
_tokenId | uint256 | The ID of the token to which the slots will be added. |
_entityIds | uint256[] | An array of IDs for the slots that will be added. |
_entityDefaultUris | string[] | An array of default URI values for the added slots. |
updateURISlot
function updateURISlot(
address _owner,
uint256 _entityId,
uint256 _tokenId,
string calldata _updatedUri
) external
Updates the URI of a token's entity slot.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the token owner. |
_entityId | uint256 | The ID of the entity slot. |
_tokenId | uint256 | The ID of the token. |
_updatedUri | string | The updated URI for the entity slot. |
directUpdateURISlot
function directUpdateURISlot(
uint256 _entityId,
uint256 _tokenId,
string calldata _updatedUri
) external
Updates the URI of a token's entity slot without checking the owner.Only the Subscribed entity owner can change the URI of the slot.
Parameters:
Name | Type | Description |
---|---|---|
_entityId | address | The ID of the subscribed entity. |
_tokenId | uint256 | The ID of the NFT. |
_updatedUri | string | The updated URI for the entity slot. |
directUpdateURISlots
function directUpdateURISlots(
uint256 _entityId,
uint256[] calldata _tokenIds,
string[] calldata _updatedUris
) external
Updates the URI of a token's entity slot without checking the owner.Only the Subscribed entity owner can change the URI of the slot.
Parameters:
Name | Type | Description |
---|---|---|
_entityId | address | The ID of the subscribed entity. |
_tokenIds | uint256[] | The IDs of the entity slot. |
_updatedUris | string[] | The updated URI for the entity slot. |
transferTokenEntityURI
function transferTokenEntityURI(
address _owner,
uint256 _tokenId,
uint256 _entityId,
string calldata _transferredUri
) external
Updates the URI of a token's entity slot.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the token owner. |
_tokenId | uint256 | The ID of the token. |
_entityId | uint256 | The ID of the entity slot. |
_transferredUri | string | The new URI for the entity slot. |
resetSlotToDefault
function resetSlotToDefault(
address _owner,
uint256 _tokenId,
uint256 _entityId,
string calldata _entityDefaultUri
) external
Resets the URI of a token's entity slot to its default value.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the token owner. |
_tokenId | uint256 | The ID of the token. |
_entityId | uint256 | The ID of the entity slot. |
_entityDefaultUri | string | The default URI for the entity slot. |
transferOwnership
function transferOwnership(address newOwner) public override;
Transfers the ownership of the collection to a new owner.
Parameters:
Name | Type | Description |
---|---|---|
_owner | address | The address of the new owner. |
transferCollectionOwnership
function transferCollectionOwnership(address newOwner) external;
Transfers the ownership of the collection to a new account.
Parameters:
Name | Type | Description |
---|---|---|
newOwner | address | The address of the new owner. |
withdraw
function withdraw() external
Allows owners to withdraw their funds from the contract.
protocolWithdraw
function protocolWithdraw() external
Allows authorized parties to withdraw funds from the contract.
tokenEntityURI
function tokenEntityURI(uint256 _tokenId, uint256 _entityId) external view returns (string memory)
Returns the entity URI for the given token ID and entity ID.
Parameters:
Name | Type | Description |
---|---|---|
_tokenId | address | The ID of the token whose entity URI is to be returned. |
_entityId | address | The ID of the entity associated with the given token. |
Return Values:
Type | Description |
---|---|
string | The URI of the given token's entity slot. |
getCollectionInfo
function getCollectionInfo()
external
view
returns (
uint256 entityId,
uint64 collectionId,
uint8 mintType,
uint8 mintPerAccountLimit,
bool isWhitelisted,
bool isFree,
uint256 templateId,
uint256 mintCount,
uint256 totalSupply,
uint256 mintPrice,
string[] memory collectionURIs,
address verifier
)
Returns the information about the collection.
Return Values:
Name | Type | Description |
---|---|---|
entityId | uint256 | The ID of the entity. |
collectionId | uint64 | The ID of the collection. |
mintType | uint8 | The type of minting. |
mintPerAccountLimit | uint8 | The maximum number of mints per account. |
isWhitelisted | bool | A flag indicating if the collection is whitelisted. |
isFree | bool | A flag indicating if the collection is free. |
templateId | uint256 | The ID of the template. |
mintCount | uint256 | The number of mints. |
totalSupply | uint256 | The total supply of tokens. |
mintPrice | uint256 | The price of minting. |
collectionURIs | string[] | An array of collection URIs. |
verifier | address | The address of the verifier. |
getRoyaltyInfo
function getRoyaltyInfo()
external
view
returns (
uint256 royalty,
uint256 withdrawnAmountByOwner,
uint256 withdrawnAmountByProtocol,
uint256 savedAmountOwner,
uint256 totalWithdrawn
)
Returns information about the royalty configuration and amounts.
Return Values:
Name | Type | Description |
---|---|---|
royalty | uint256 | The royalty percentage set for the protocol. |
withdrawnAmountByOwner | uint256 | The total amount withdrawn by the owner. |
withdrawnAmountByProtocol | uint256 | The total amount withdrawn by the protocol. |
savedAmountOwner | uint256 | The amount saved by the owner. |
totalWithdrawn | uint256 | The total amount withdrawn overall. |
getProtocolBalance
function getProtocolBalance() external view returns (uint256)
Returns the balance of the protocol.
Return Values:
Type | Description |
---|---|
uint256 | The balance of the protocol after deducting the owner's saved amount and calculating the royalty. |
getOwnerBalance
function getOwnerBalance() external view returns (uint256)
Returns the balance of the owner.
Return Values:
Type | Description |
---|---|
uint256 | The balance of the owner after deducting the owner's saved amount and calculating the royalty. |
getProtocolRoyalty
function getProtocolRoyalty() external view returns (uint256)
Returns the royalty percentage set for the protocol.
Return Values:
Type | Description |
---|---|
uint256 | The royalty percentage for the protocol. |