Is it possible to somehow update an existing ERC-721 Token's MetaData after it was already minted?
Let's say we've created a Knight character for a game - by minting an NFT for it, and 3 months later we want to update that Knight's attributes to reflect the amount of experience or treasure it has amassed through game play.
The original URI for this Knight-Token looked something like this:
{
"name" : "KnightToken1",
"description" : "One-of-a-kind-Knight",
"image" : "http://www.mydomain.com/myImages/knightImage.png”,
"attributes" :
{
“Age” : “30",
"Treasure” : “2 Gold Crates”
}
}
We now want to update the "Treasure" attribute to "100 Gold Crates" - how can it be done?
My understanding was that it can't be done - the Blockchain is supposedly immutable after all - but I've seen some posts essentially saying "with our API you CAN do this!" - except they don't tell you how.
So I'm wondering: is this a false claim - or is there really some clever way of updating an already-minted ERC-721's token metadata? And if so, how?
On the other hand, if we, the developers, need to be able to update the “Treasure” attribute of said Knight-NFT - well, by definition we shouldn’t have permission to tweak the attributes of an NFT that is clearly owned by someone else. Cause that would break everything.
Fun!
– Mark55 Sep 28 '20 at 20:09setTokenUrifunction. See here: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol OpenZeppelin contracts are popular for being compliant. Almost everyone uses them. Are you suresetTokenUriis not disallowed by the standard? Moreover any ideas why OpenZeppelin's implementation doesn't have it? – Hassan Baig Jul 27 '21 at 15:02virtualmodifier on thetokenURIdefinition. They do not implement it for you because they usually implement the most popular use case. – William Entriken Jul 28 '21 at 02:12_setTokenUristill exists here. – Sierox Oct 09 '21 at 17:23