Inspiration

Zen Garden is a game that helps us to have our virtual forest which we can take care of virtually and then all those actions we take in the game are performed in the real world by the planters who're planting and maintaining those trees.

Games have the power to immerse players in virtual worlds and present complex issues like climate change in engaging and interactive ways. By integrating educational narratives, gameplay mechanics, and real-world data, games can raise awareness, foster empathy, and empower individuals to take action towards addressing the urgent challenges of our changing climate.

What it does

Upon joining Zen Garden, users are given their virtual land to plant trees using tree NFTs. For each virtual tree planted, a real tree is planted in the physical world, creating a tangible impact on the environment. Users can also water their virtual plants by paying a fee, which is then used to maintain and care for the real trees that have been planted.

In addition to its gamified approach to environmental conservation, Zen Garden also allows users to view the exact location of their planted trees on a map. This feature not only increases transparency but also fosters a sense of pride and accomplishment in users who are actively contributing to the preservation of the environment.

By gamifying the process of tree planting, Zen Garden educates users about the importance of environmental conservation and encourages them to become more conscious of their ecological footprint. This increased awareness can lead to more responsible behaviour in other aspects of users' lives, such as reducing waste and conserving energy.

How we built it

Chainlink VRF and Chainlink Automation

  • An ERC721 contract is used for the various Dynamic Tree NFTs that a user can own and plant in their Forest.
  • This contract uses Chainlink VRF to generate the daily growth points of all the Tree tokens minted from the contract
  • This daily growth gets added to the growth points of every minted Tree token and the growth reflects on the frontend as a changed image of the Tree NFT
  • Chainlink VRF is used so that all the different Dynamic Tree NFTs can have different Growth Rate - this is not possible in real life but that's the strategy that adds fun and randomness to the game.
  • This contract also uses Chainlink Automation to call the requestRandomWords() function every 10 minutes
  • Every 10 minutes is only for hackathon purposes and will be replaced by every day (daily) later
  • Deployed on: Polygon Mumbai
  • Deployment address: 0x11e405C734746e129179c576ECBC748C04B006d8

Tree.sol - The contract that uses Chainlink VRF and Chainlink Automation Pixi.js The project incorporates React Pixijs for facilitating the drag-and-drop functionality of NFT Trees owned by users in their Zen Garden.

Challenges we ran into

Chainlink VRF and Chainlink Automation

  • We had some issues integrating Chainlink VRF with our game strategy to generate the daily growth points of all the Tree tokens minted from the contract.
  • Our VRF was running into problems and the requests weren't getting fulfilled due to low gas, we can manually change gas for VRF as it's governed by the gas lane set.
  • We tried writing our smart contract on the Flow blockchain but we couldn't integrate as we ran out of time.

Accomplishments that we're proud of

We're proud that we finally have a working MVP of the idea we had at the beginning of this hackathon. Also, we have come up with a very unique game mechanics using Chainlink VRF and Chainlink Automation to generate the daily growth points of all the Tree tokens minted from the contract.

What we learned

We got a bit late in integrating other sponsors as well as we started a bit late. So we learned that its important to finish things on time๐Ÿ˜…

Also, we deeply got to learn how Chainlink VRF and Chainlink Automation work and this has given really interesting features to our game.

What's next for Zen Garden

  • We'll improve the UI as the current version just depicts the Chainlink functionalities using a very minimalistic frontend
  • We'll add game assets and music to the game
  • We've to collaborate with PhiLand and Treejer Protocol as some inspiration has been taken from those projects as well. We'll use Treejer protocol to verify that the fund from the Tree NFTs actually go to a planter in some part of the world and a tree is planted and taken care of.
  • We'll try to ship the final MVP of the game but the end of June and try to get some grants and alpha testers for the game.

Built With

  • chainlink-automation
  • chainlink-vrf
  • chakra-ui
  • next-js
  • typescript
Share this project:

Updates

Submission history