Loyalty Harvest
{"type": "project", "title": "Loyalty Harvest", "website": "https://github.com/RohanNero/Loyalty-Harvest", "createdAt": 1694931914974, "userGithub": "RohanNero", "credentials": {}, "description": "The goal of this project is to create a standardized template for  `Reward Event`s. These are simply a period in which holders of a certain NFT are rewarded depending on the amount of time they held their NFT. For example, if I create a `Reward Event` for my NFT collection from block number 10 to block number 20 and fund the event 5 ETH, (for the sake of easy understanding, imagine there are 5 NFTs in total). Then if the user holding `tokenId` 0 holds all the way until block 20, they would receive 1 ETH since they were eligible for 1 in total (5 / 5 = 1). However, if the user holding `tokenId` 1 sold at block number 15, they would get 0.5 ETH.  These `Reward Events`,  allow anyone to incentivize users to hold an NFT they currently own and for new users to buy one. These rewards can be a portion of the sales or revenue from any avenue, the possibilities are endless depending on the user's desired application. The organizer/creator of the event only has to run a script to generate a merkle root using the nft collection data during the event period. Then any user who held can create a merkle proof, and then claim their rewards. This allows the organizers and the users to only have to create a single transaction throughout the entire duration of the event, and since the organizer is only uploading a Merkle root and some additional information about the event, this has very low gas costs. I've already written the smart contract, tests, scripts to create leaves from an inputted nft address, create a Merkle tree using the leaves, create a proof using the tree and the leaves, create a signature that can be recovered to claim the funds. Using ECDSA isn't required to claim, but an additional feature for users who wish to claim from an address other than the one they held the NFT with. I need to flesh them out, write additional tests, and finish creating my frontend that users can interact with, so far only the create leaves script has a functional API paired with it. On my localhost frontend, I'm able to use an input form that searches the blockchain at `nftAddress` from `blockStart` to `blockEnd` and creates leaves using the data from the period, aka what block the NFT was sold at, if it was sold. This is extremely dynamic and can quickly be used to create events for any collection at any time with any amount of funding, and the entire thing is secured through cryptography on the blockchain, in the Merkle Tree, and if using it, the ECDSA recovery.\n", "projectTwitter": "RohanNero"}