Self-melting asset

cloverme

Member
For some gameplay mechanics, it would be interesting to have an asset type that would self-melt in the players wallet. The melt-time could be a mechanic related to a particular block # on the blockchain.
 

Nick_KepithorStudios

Well-known member
If you wanted this without waiting for a mechanic built in you could create them as NFTs, the mint timestamp is logged on your server as aprt of the meta data, after X time you update the token index preventing trade and functionality of the token and replace image with a notice "no longer usable by anyone please melt". A little rough around the edges as a first concept but does what you want.
 

miezekatze

Active member
Ah this is very interesting indeed. I didn't know you could update the token index in such a manner. How is that done?
 

Nick_KepithorStudios

Well-known member
mutation MakeNonTransferable {
CreateEnjinRequest(
identity_id: XX,
type: SET_TRANSFERABLE,
set_transferable_data:
{
token_id: "XXXXXXXXXX",
token_index: "XXXXXXXXXXXX",
transferable: BOUND
}
){
id
state
}
}


For making the individual token_index bound, then change the values on your JSON for that token_index and done.
 

miezekatze

Active member
I see, so we could update the token metadata stored on individual servers. Is there a method to change the token_index that is stored on the blockchain?

Changing the metadata alone would create a mismatch between the data on the blockchain and the updated metadata. How does the TC resolve such a conflict? When you call balanceOf() does it return the token_index on the blockchain or the token_index in the json metadata uri?
 

Nick_KepithorStudios

Well-known member
Seems to be some confusion there.

When you mint NFT's each one has its own token_index. That is the difference between NFTs and FTs.

I set my URI's for all tokens regardless of NFT or FT as https://websitename.com/jsonpage?tokendatastring={id}
That page receives the token data from Enjins requests, and splits the tokendatastring to get the id and the index

I have data for each token_id and token_index on my database.
The code then returns the correct data for that individual token regardless of NFT or FT

In the same way as mentioned earlier, i can update my database to change the stats of 1 token_index.
Then do the same on the Enjin server to change the transferable status of that token_index.

Before you ask about entering 1,000's of entries per NFT, i store the original default state, and only add data for a specific token_index if I am actually making a change to it, then my code looks for a match of both id and index, if none uses the default values.
 

Lawrence

New member
A self-constructed asset is one that a business elects to construct under its own management. A common example of a self-constructed asset is when a company chooses to build an entire facility. In most cases, fixed assets are not self-constructed; instead, they are purchased from third parties, with little additional effort required to install them on-site UPSers.com
 
Last edited:

cloverme

Member
A self-constructed asset is one that a business elects to construct under its own management. A common example of a self-constructed asset is when a company chooses to build an entire facility. In most cases, fixed assets are not self-constructed; instead, they are purchased from third parties, with little additional effort required to install them on-site.
In this case we're talking about assets as in game assets or blockchain assets (like a silver sword in a game) and not a company asset (like a machinery or a truck)
 
Top