FDAi icon indicating copy to clipboard operation
FDAi copied to clipboard

Create and Update Dynamic NFT

Open mikepsinn opened this issue 1 year ago • 0 comments

User Story

  1. As a generous person, I want to showcase my donations by having an NFT that changes colors based on the amount I've donated to a wallet.

Tasks

  • [ ] Create an API endpoint that returns colored images based on a number provided: 0=Black, >0=Yellow .

  • [ ] Create an NFT contract with updatable metadata using Revise (http://app.revise.network/).

  • [ ] Send the Revise NFT to Wallet A.

  • [ ] Create an API endpoint and a button that:

    • [ ] Fetches all the owners of the NFT.
    • [ ] Fetches all the addresses that have sent tokens to a smart contract.
    • [ ] Loops through the addresses and sums the total contributions to the smart contract.
    • [ ] Updates the metadata on each NFT from the API endpoint https://example.com/donationImage/{amountDonated}.
  • [ ] Create a job that runs and updates the NFT color:

  • [ ] When the NFT is in Wallet A, the color should be yellow.

  • [ ] When the NFT is moved to Wallet B, the color should be black.

  • [ ] When the NFT is moved back to Wallet A, the color should be yellow again.

High-Level Overview

  1. Wallet A gives money to Charity Smart Contract.
  2. Dev gives NFT to Wallet A.
  3. Job runs and sets the NFT color to yellow based on the current amount of donations to the smart contract.
  4. NFT is moved to Wallet B.
  5. Job runs and sets the NFT color to black because the NFT is no longer in Wallet A and therefore not associated with any donations.
  6. NFT is moved back to Wallet A.
  7. Job runs and sets the NFT color to yellow based on the current amount of donations to the smart contract.

The job changes the color of the NFT based on whether it is associated with any donations or not. When the NFT is in Wallet A, it is associated with donations because the owner of Wallet A has made donations to the smart contract. Therefore, the job sets the color to yellow based on the current amount of donations. When the NFT is moved to Wallet B, it is no longer associated with any donations because the owner of Wallet B has not made any donations to the smart contract. Therefore, the job sets the color to black to indicate that the NFT is not associated with any donations. When the NFT is moved back to Wallet A, it is again associated with donations because the owner of Wallet A has made donations to the smart contract. Therefore, the job sets the color back to yellow based on the current amount of donations.

https://docs.google.com/document/d/1_XrLAnj15dXUr7tgWCdJWNoaQseslrsF1GUEXz1KEGQ/edit#

mikepsinn avatar Mar 24 '23 23:03 mikepsinn