Inspiration
In the current NFT and play-to-earn market, A lot of Standalone NFT and game assets cannot generate value (yield), because
- It is an incomplete NFT collection - only a complete or merged collection earns yield
- It is an inactive NFT requiring players to play to generate yield from Play-to-earn activities
What it does
The project is a yield aggregator made for on-chain play-to-earn and NFT with staking mechanism.
This project is built on top of the Creepz project, Creepz Shapeshifter. It is built around the mechanism that by collecting 5 Shapeshifter NFTs, the user can "mutate" a MegaShapeShifter NFT by burning the 5 Shapeshifter NFTs. A mutated NFT allows the user to yield the game token, Loomi. As not every Shapeshifter NFT are used for mutation, and about 30% are un-utilized and sitting in user wallet, this decentralized platform can be used to facilitate the users to aggregator their NFTs and yield the most Loomi in the entire game.
How we built it
Smart contract - Solidity, OpenZeppelin, Chainlink Any API Storage - IPFS Back-end- Node.js Front-end - React, Tailwind
Challenges we ran into
Accomplishments that we're proud of
1. Identifying and Storing the Metadata To begin, we first have to understand how each Shapeshifter identifies itself. For some projects, these metadata are stored on-chain, Cryptopunks is a great example for hosting all attributes on-chain and achieving a high degree of decentralization. However, the operation can be costly, that is why most projects adopt IPFS as the storage for metadata, and the Creepz Shapeshifter NFT is one of them.
Since the metadata is stored in IPFS, smart contracts hosted in Ethereum do not support an HTTP client. Therefore our approach to this is to use ChainLink to identify the corresponding shapeshifter type, number, and send it back to the client for broadcasting to the network.
To implement this, we would need a mechanism to verify that the parameters passed by the client are valid, i.e. verified by our oracle server. This is done by using Elliptic Curve Digital Signature Algorithm, or ECDSA, to sign the message using a secure key that is only kept by the oracle. Once the related functions are called, the parameters first go through ECDSA to verify their validity, and can only proceed if the signature is valid.
This may seem the opposite of decentralization, however, since the metadata is off-chain, we have to rely on this pattern to get accurate data. This is, in fact, how Creepz themselves calculate the corresponding $Loomi bribe for each address using their off-chain oracle as well.
2. Calculating $Loomi Yield with TWAR After we have collected every type of the shapeshifter and mutated them, the mega-shapeshifter will then start passively generating $Loomi. We came up with a variable we called “TWAR” — Time Weighted Average Reward. Without diving too deep into the mathematical equations, it calculates the time-weighted staking reward for one single staked shapeshifter. Using this one single variable, we avoided loops when calculating the staking reward thus reducing the gas for each $Loomi claim.
3. Lowering Gas Per Output Transaction Initially, we had all the shapeshifter pools in one single contract, but we realized it will run into a gas costly problem since every claim will need to update the “TWAR” of every pool in the contract. We decided to split the pools into different contract addresses, then use a proxy contract to navigate users to interact with specific pools. This will minimize gas so that every claim of $Loomi uses less gas overall. Since the pools all have the same functions and code, during the deployment of contracts, we also used Eip-1167 method to clone all the pool contracts instead of redeploying the same code again to save us some gas.
4. Optimization with Circular Flash Stake There is also one requirement by the creepz official to Mega-shapeshifters. Before claiming the $Loomi from the mega-shapeshifters, the address needs to possess a Creepz genesis; they have a checking function _validateCreepzOwner() before each claim. Since we have 7 contract addresses, one for each single shapeshifter pool, we normally would require having 7 creepz genesis for all the addresses, but we did a little trick to achieve the same result with only 1 creepz genesis. We put a single creepz genesis in one of the contract addresses and transfer it to the other addresses the moment the user wants to claim $Loomi so it passes the _validateCreepzOwner() check, this is also what we called the “circular flash stake”.
What's next for NFTfi Aggregator- The Shapeshifters Aggregator
Further expand to other on chain collect to earn projects
Built With
- amazon-ec2
- amazon-web-services
- etherjs
- hardhat
- node.js
- solidity

Log in or sign up for Devpost to join the conversation.