Dynamic NFT update

Hello,

I am trying to update a dNFT, you can find the code repo here muniryasir/d-nft_v2 (github.com), the mint params are following

{
“owner”: {
“Account”: [
“3SfHLNkmy61ZUQkAhMvAwKj47EYDBiUPbn3wHghFD6qGr8WDGc”
]
},
“tokens”: [
[
“04”,
{
“metadata_url”: [
{
“url”: “https://gist.githubusercontent.com/muniryasir/88844fc65168183cb86189128a87805d/raw/c224f3aa913d15537454a01707e2820758bee8cb/gistfile1.txt”,
“hash”: {
“None”: [

                        ]
                    }
                }
           
            ],
            "token_amount": "1"
        }
    ]
]

}

Using following tool,

sctools.mainnet.concordium.software

I see parameters for update be like,

{
“myStringField”: “FieldValue”,
“myNumberField”: 4,
“myArray”: [
1,
2,
3
],
“myObject”: {
“myField1”: “FieldValue”
}
}

My goal is to update the metadata_url (to different link), passed during mint, how will I achieve this considering above information

Hey @YasirM the smart contract uses upgrade function to change the token’s metadata. Not the mint function. And it calls addMetadata function to add a new one. So I believe you shouldn’t call the mint but instead these two functions.
sample json for addMetadata could be:

{
    "tokens": [
        [
            "TOKEN_ID",
            {
                "url": "METADATA_LINK_IPFS",
                "hash": {
                    "Some": [
                        "SHA256 of METADATA"
                    ]
                }
            }
        ]
    ]
}
1 Like

Can you please share for upgrade as well? since goal is to modify existing link