project screenshot 1
project screenshot 2
project screenshot 3

Beastieland

Beastieland is the first animal NFT collection responding to global environmental changes 🐼 Built with #SmartWeave Contracts, Beasties die out with negative climate trends and have offspring with positive ones - creating an emotional bond to human impact on the environment 🌎

Beastieland

Created At

NFTHack 2022

Project Description

Beastieland is a dApp aiming to create emotional feedback to the climate changes caused by human activities 🌎

By creating an interactive animal NFT collection that responds to the global temperature a viewer can feel the effects of human actions on living species. Emotions are the key component for an individual to associate with the cause and take action. So with Beastieland, instead of seeing a raw number of CO2 emissions, you experience the consequences from the perspective of animal species 🐘

To keep environmental friendliness, we use Arweave blockchain, which relies on emission neutral Proof of Access, to store NFTs and SmartWeave Contracts for dApp execution.

As the first iteration of the dApp we created a collection of 5 animal NFTs: Panda, Lion, Elephant, Fox and Zebra. Global temperature changes are considered to be one of the key global climate factors, so we chose this metric as background for animals reactions. Some of them are more resistant, while some more vulnerable to temperatures swings 🌡️

We've implemented a mock oracle contract for the hackathon purposes so that our app users can change the temperature value and see the impact of that change. However, in the next iteration of the Beastieland, we will connect our NFT contract to the real blockchain oracle with the real climate values. We will also connect more types of data that can influence animals: CO2 emissions, deforestation, ozone layer depletion, etc.

Our NFT SmartWeave contract has an innovative way of calculating tokens metadata. On each call of the "getAllTokens" query function, it fetches the latest temperature value from the oracle contract. This value is used to dynamically calculate corresponding attributes and images for each NFT token. Currently, NFT images may present an animal, an animal with offspring, or a ghost.

Initially, all the animals are safe and sound, but when the temperature is below a specific threshold, an animal dies and becomes a ghost. Thankfully, when the temperature rises above that threshold, the conditions are again hospitable and an animal comes back to life. Moreover, when the temperature gets to an animal-friendly level, the offspring appears! We wanted to emphasise that the results of human activity are reversible and it's up to our decisions if we make a change or not ✅

If such NFT collection would generate revenue, a portion of it would be transferred to organisations fighting for positive climate impact or supporting directly endeared species.

How it's Made

'=== Tech stack ===

Frontend: React.js (hosted on Vercel)

Smart contracts: SmartWeave (arweave-based contracts)

Tests: Jest + arlocal

Image storage: Arweave blockchain

=== Smart contracts description ===

We've implemented 2 SmartWeave smart contracts:

  1. Oracle contract - used to provide the latest world climate data (currently the average temperature in the world)

Available queries: getCurrentValue, getLatestChanges

Available methods: saveNewValue

Link to the deployed oracle contract: https://viewblock.io/arweave/address/x_ylfKSDlwynd5cEmAAsIwCNO4c3iY2mrKujb9xjnbk?tab=code

  1. NFT Beastie contract - NFT contract with dynamically calculated metadata and dynamically generated images for each token.

Available queries: getAllTokens

Available methods: mintNFT, transfer

Link to the deployed nft-beastie contract: https://viewblock.io/arweave/tx/q_j_wq0WdVLuuHIRRUrbq-G191JqwMMYrxsXUOQmGq8

Link to the deployed nft-beastie contract source: https://ngdmbjax6egbtqeuakeimute262uww35rm4h4qt4dgrg5cmnqa6a.arweave.net/aYbApBfxDBnAlAKIhlJk17VLW32LOH5CfBmibomNgDw

We've decided to use SmartWeave because it suits perfectly for dynamic NFT generation.

SmartWeave is a new generation of smart contracts built on Arweave. It uses lazy-evaluation to move the burden of contract execution from network nodes to smart contract users. You can learn more about it here: https://github.com/redstone-finance/redstone-smartcontracts/blob/main/docs/SMARTWEAVE_PROTOCOL.md

SmartWeave was designed to efficiently handle large datasets, which was very helpful in our case. Because our initial plan was to generate images on the fly in the smart contract code. SmartWeave makes it possible to process images right in the contract's code thanks to its integration with Arweave blockchain and Javascript support.

But due to time limitations, we've selected a simpler way. We just hosted images on Arweave and implemented dynamic links selection for each NFT token. Image link selection is based on the data provided by the oracle contract and each NFT token configuration.

You can read the nft-beastie contract source code here: https://github.com/redstone-finance/nft-beasties/blob/main/contracts/beastie-nft/contract.js

=== Web app ===

We've implemented a Single Page Application in React. It has 2 main views:

  1. NFT collection page - the page displaying beastie NFTs with their metadata. Each NFT is presented as a card with its name and expands with more details on the mouse hover.

  2. God mode page - the page where you can change the average world temperature in the oracle smart contract. It was created just for demo purposes. In the production app, the data would be provided by multiple trusted and financially incentivised data providers.

background image mobile

Join the mailing list

Get the latest news and updates