Skip to main content

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:​

NameTypeDescription
_variationIduint256The 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:​

NameTypeDescription
_signeraddressThe address of the signer of the signature.
_signaturebytesThe signature of the minting data.
_uristringThe URI for the minted token..
_saltbytesThe 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:​

NameTypeDescription
_merkleProofbytes32[]The Merkle proof for address whitelisting.
_variationIduint256The 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:​

NameTypeDescription
_merkleProofbytes32[]The Merkle proof for address whitelisting.
_signeraddressThe signer address used for the signature.
_signaturebytesThe signature to be verified.
_uristringThe URI of the token.
_saltbytesThe 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:​

NameTypeDescription
_owneraddressThe address of the token owner.
_tokenIduint256The ID of the token to which the slot will be added.
_entityIduint256The ID of the slot's entity.
_entityDefaultUristringThe 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:​

NameTypeDescription
_owneraddressThe address of the token owner.
_tokenIduint256The ID of the token to which the slots will be added.
_entityIdsuint256[]An array of IDs for the slots that will be added.
_entityDefaultUrisstring[]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:​

NameTypeDescription
_owneraddressThe address of the token owner.
_entityIduint256The ID of the entity slot.
_tokenIduint256The ID of the token.
_updatedUristringThe 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:​

NameTypeDescription
_entityIdaddressThe ID of the subscribed entity.
_tokenIduint256The ID of the NFT.
_updatedUristringThe 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:​

NameTypeDescription
_entityIdaddressThe ID of the subscribed entity.
_tokenIdsuint256[]The IDs of the entity slot.
_updatedUrisstring[]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:​

NameTypeDescription
_owneraddressThe address of the token owner.
_tokenIduint256The ID of the token.
_entityIduint256The ID of the entity slot.
_transferredUristringThe 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:​

NameTypeDescription
_owneraddressThe address of the token owner.
_tokenIduint256The ID of the token.
_entityIduint256The ID of the entity slot.
_entityDefaultUristringThe default URI for the entity slot.

transferOwnership​

  function transferOwnership(address newOwner) public override;

Transfers the ownership of the collection to a new owner.

Parameters:​

NameTypeDescription
_owneraddressThe address of the new owner.

transferCollectionOwnership​

 function transferCollectionOwnership(address newOwner) external;

Transfers the ownership of the collection to a new account.

Parameters:​

NameTypeDescription
newOwneraddressThe 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:​

NameTypeDescription
_tokenIdaddressThe ID of the token whose entity URI is to be returned.
_entityIdaddressThe ID of the entity associated with the given token.

Return Values:​

TypeDescription
stringThe 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:​

NameTypeDescription
entityIduint256The ID of the entity.
collectionIduint64The ID of the collection.
mintTypeuint8The type of minting.
mintPerAccountLimituint8The maximum number of mints per account.
isWhitelistedboolA flag indicating if the collection is whitelisted.
isFreeboolA flag indicating if the collection is free.
templateIduint256The ID of the template.
mintCountuint256The number of mints.
totalSupplyuint256The total supply of tokens.
mintPriceuint256The price of minting.
collectionURIsstring[]An array of collection URIs.
verifieraddressThe 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:​

NameTypeDescription
royaltyuint256The royalty percentage set for the protocol.
withdrawnAmountByOwneruint256The total amount withdrawn by the owner.
withdrawnAmountByProtocoluint256The total amount withdrawn by the protocol.
savedAmountOwneruint256The amount saved by the owner.
totalWithdrawnuint256The total amount withdrawn overall.

getProtocolBalance​

function getProtocolBalance() external view returns (uint256)

Returns the balance of the protocol.

Return Values:​

TypeDescription
uint256The 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:​

TypeDescription
uint256The 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:​

TypeDescription
uint256The royalty percentage for the protocol.