Search code examples
nft

Self destructing NFT tokens based in inactivity


I am brand new to NFT but for fun I would like to create a collection. But I want each NFT in the collection to have a feature, which is. It has to be sold every 6 months or it will get burned automatically (180 days after last sale of the NFT).

Can this be done automatically? That the NFT can see last sales transaction and auto burn on a given time (unless sold again)


Solution

  • My answer is related to EVM networks (e.g. Etheruem and Polygon). It might be different on Solana and other networks with the option of renting storage.

    NFT is minted during execution of a transaction. A transaction has the ability to change storage state.

    Once the NFT is minted, it creates a storage record within its collection smart contract. The only way to change the record (e.g. to zero it out by burning the NFT) is to send another transaction.

    Nothing on EVM happens automatically "after specified amount of time" - everything needs to originate from a transaction.

    Having said that, there are few ways around that:

    • There are existing services such as Chainlink Automation that send a transaction once predefined criteria is met.
    • You can also build a simplified monitoring tool yourself - offchain application that sends a transaction from an address that you control after the criteria is met.
    • Or you can incentivize users to send the "burning" transaction (and only validate within your contract that it's really > 6 months after the last trade) so that you don't have to maintain the monitoring tools and pay transaction fees.