This article was first published on Chainlink
Now that NFTs have burst into the mainstream, developers, gamers, and collectors alike are starting to explore how these unique digital assets can take on new functionalities and unlock even richer in-app dynamics. In our past tutorials, we have walked through how to use Chainlink oracles to build, deploy, and sell NFTs that are verifiably unique and that respond to real-world inputs. These dynamic NFTs are proving to be the next-generation NFTs that go far beyond static digital collectibles. Imagine an NFT that changes every time it is transferred: an artist could make a piece of art and every time someone new buys it, Chainlink VRF generates a random change that makes the artwork provably unique for that buyer.
That is exactly what we will be doing in this post: creating, deploying, and listing a dynamic NFT (dNFT) that changes in a verifiably random manner every time it is transferred. Specifically, we will be creating a spin-off of Schrodinger's cat that switches between sleeping and attacking.
Clone the Dynamic NFT Repo
The first step is to go ahead and clone the dynamic NFT repo.
git clone https://github.com/ZakAyesh/DynamicNFT.git cd DynamicNFT
Once this is done, go ahead and open the project in your code editor of choice. You now need to follow the instructions in the project’s readme file for setting the required environment variables (you will need to get a free account from Infura). In this tutorial, we’ll use the Rinkeby testnet on Ethereum.
export RINKEBY_RPC_URL='www.infura.io/asdfadsfafdadf' export PRIVATE_KEY='abcdef'
You can also add your environment variables to a .env file if you're unfamiliar with environment variables.
Understand the Smart Contract Logic
Go to the contracts folder and open the file named `dNFT.sol`. Once there, you will notice a couple of things. First, ...
To keep reading, please go to the original article at: