0

I'm looking to create a set where after a set period of time (a week, a month, a year) the token expires and all its value is wiped. Is it possible to do this and if so how?

0

Yes, this is possible. To accomplish this, you would start with your preferred NFT standard and a timestamp on creation. It also depends what you mean by having its value 'wiped'. Value is something determined by buyers and sellers in a market. So assuming 'wiped' means destroyed, you can have the NFT destroyed after your deadline has passed. One caveat is that you would need someone actually call the NFT to self-destruct after deadline is passed.

To implement a deadline of 365 days, you set the constructor to have something like:

uint _start;

constructor() { _start = block.timestamp; }

function checkTime() external { if(block.timestamp >= _start + 365 days) { selfdestruct(owner); } }

Then after 365 days, you or an automated script needs to call the contract "checkTime()" and the NFT will be gone.

2
  • Hi, thankyou for answering the question. I am fairly new to coding so how much do you want to teach me the basics of how to do this?
    – Amie
    Sep 4 at 17:28
  • Hi Amie, I enjoy teaching blockchain so I'm open to the idea. We can discuss availability in a separate channel since such pricing would depend how much time would you need from me and your general level of programming experience. Though this is a relatively easy task. Reach me at t.me/bigbrotha1
    – Bigbrotha
    Sep 4 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.