Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Missing Example/Test-Case: Mint NFTs with Different Sets of Metadata and Retrieve That Metadata #77

@johnnyshankman

Description

@johnnyshankman

It's unclear how you mint two different singular NFTs on the same contract with different metadata, which is usually the case for NFT contracts. The token_metadata endpoint is also a little arcane, as it asks for a lambda as the first parameter and I'm not sure what sort of function it expects.

Everything is catered toward a range of NFT IDs with the same metadata.

(* range of nft tokens *)
type token_def =
[@layout:comb]
{
  from_ : nat;
  to_ : nat;
}

The test cases only show one case where you want to mint two NFTs with the same metadata:
https://github.com/oxheadalpha/smart-contracts/blob/master/nft_assets/tezos_fa2_nft_tests/test_fa2.py#L132-L153

So my question is how do I do two?
Is this how I would do two separate ones?

        self.fa2.mint_tokens(
            {
                "metadata": token_metadata1,
                "token_def": {
                    "from_": 0,
                    "to_": 1,
                },
                "owners": [owner1_address],
            }
        self.fa2.mint_tokens(
            {
                "metadata": token_metadata2,
                "token_def": {
                    "from_": 1,
                    "to_": 2,
                },
                "owners": [owner1_address],
            }

Furthermore, how do I check the metadata for a single token with token_metadata?

(**
Implementation of the FA2 interface for the NFT contract supporting multiple
types of NFTs. Each NFT type is represented by the range of token IDs - `token_def`.
 *)

What does "type" mean? It's unclear. A non-fungible token is 1-1 and therefore it's always a unique type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions