Minting

Minting the token is done after all the required documents have been put together and uploaded to ArWeave. Minting is done by the backend. A mint queue is in place to ensure that all NFTs are correctly minted.

The mint function in the TimePieceNFT contract has a mechanism to avoid double mints.

/// @param to The owner of the watch
/// @param passportName A unique name to avoid double mints.
/// @param documentId The id of the document on external storage
function mint(
    address to,
    string calldata passportName,
    string calldata documentId
) external;

The passportName parameter avoid double mints by keeping track of the claim status of that passport name. So even if the backend sends two mint transactions with the same parameters, only one will be successful. This is because on the first mint passportName will be claimed.

Last updated