Create a Dynamic NFT that evolves over time using Chainlink Automation. This project utilizes smart contracts to change the NFT's metadata based on time intervals, simulating the growth stages of a flower.
- Deploy on Remix: Use the provided
Flower
contract code. Set theUPDATEINTERVAL
constructor argument to your desired time interval (in seconds). - Verify Inputs: After deployment, call
interval
,name
, andsymbol
functions to confirm your inputs.
- SafeMint Function: Call
safeMint
with your injected provider wallet (ex. Metamask) address to mint your NFT. - Contract Address: Copy the deployed contract address.
- View on OpenSea: Go to testnets.opensea.io and paste your contract address in the search bar to view your NFT. Ensure the Token ID is 0.
- Chainlink Automation: Visit automation.chain.link and select "register new upkeep."
- Custom Logic: Choose "custom logic" and input your contract address.
- Upkeep Name: Enter a name for your automation job.
- Starting Balance: Allocate 3 LINK tokens for the starting balance.
- Register: Leave other fields as default and register your upkeep.
- Interact with Contract: Return to Remix and call the
growFlower
function with your Token ID (0). - Wait and Refresh: After the set interval, refresh your NFT on OpenSea. You should see the updated metadata.
safeMint
: Mint your NFT with an initial stage.growFlower
: Triggers the next growth stage of your NFT.flowerStage
: Returns the current stage of the flower.
This project utilizes Chainlink Automation to periodically call the growFlower
function, simulating the growth process of the flower. It ensures that your NFT dynamically updates without manual intervention.
Your NFT will evolve through predefined stages, with each stage represented by unique metadata stored on IPFS. Starting as a seed, your flower can sprout and eventually bloom, visualizing the lifecycle of a plant.
This guide provides the steps to deploy and interact with a dynamic NFT using Chainlink Automation. By following this guide, you can create an NFT that grows over time, offering a unique digital collectible experience.
For a detailed walkthrough of this project, watch our YouTube tutorial.