Hi all, I am trying to create a dynamic NFT that changes after a preset period of time. Are there any contracts on openzeppelin that showcase such dynamic NFTs? Can anyone help me with resources? I am looking for anything that will help me write the smart contract for this NFT.
Sorry we don't have a guide for this. What kind of changes do you want for the NFT? Would it just rotate to a new image or somehow some attributes would change over time based on some function? The former is easier to impement.
Yes, that is exactly what I want. It should change to a new image say, after 3 months or so. Please let me know how I can implement something like this.
From what I have learnt till now I need to write a function in my smart contract that uses block.timestamp to check whether the time period has elapsed. But I am unsure how to proceed from there, like how do I need to change the metadata to apply these changes once the target time is reached and so on.
Any help would be extremely valuable. Thanks a lot.
You can implement something like this in the token uri function. but you would need to account for all the days you want it to be changed.
Just do a time check in the tokenURI
Moon runners does something similar with their mooncycle -