Storey X Harmony: Sustainable clothing rewear and resell on Harmony

Hi again @TakStorey
Would you be so kind to make a video following the NFT given and then show it in the user account the NFT, please? No audio is needed, just the steps. I’m an Android user and would love to see it running to jump to the next step.
Thank you

Hey @jbeltran ! Of course - I’ve noted down the steps below to show the creation of an NFT (I made a Harmony x Storey Test NFT), and then following it all the way through to the final app.

Step 1: Admin Dashboard creates an NFT with the TokenURI (metadata) set to https://storey-the-app.s3.us-west-1.amazonaws.com/StoreyxDB/harmony_test_metadata.json (in the real NFTs they are set to somewhere in ipfs).

Step 2: Once the NFT is created we get a Token ID back:

Step 3: We then transfer this Token to the User’s Wallet by using the Admin Dashboard and inputting the Token ID and the in-app User ID. I am using my account, and my User ID in Storey is apple|000642.a143d49233f84daa8cac984a64a7dddf.0958.

Step 4. We have now created and transferred an NFT to the User Wallet using Harmony via the Admin dashboard! We can also query the database to see that the Custodian Wallet for the user is 0xDF06288161E186D90b05E7d3f5C4Bc2a0ed30ac8. This is stored in the Storey backend. If you directly interact with the Harmony Chain via web3.js or similar you can view the owner of this NFT via the Token ID is in fact this wallet address (since it is ERC721). You can query the Storey backend here to see the contents of the NFT:

https://interim-storey-app.herokuapp.com/web3/debugNFT?address=0xDF06288161E186D90b05E7d3f5C4Bc2a0ed30ac8

You can see the metadata via the TokenURI returned is:

[{“tokenId”:15,“tokenURI”:“https://storey-the-app.s3.us-west-1.amazonaws.com/StoreyxDB/harmony_test_metadata.json”}]

Step 5. The User can now view this NFT on their homepage in the app - please see here. You can see that the NFT is also shown in the User’s public profile page, in the NFT tab. Users with NFTs also have a hexagon shaped profile image:

In fact there are multiple videos showing the NFTs at work here:

Step 6. We also have a Storey Discord here: Storey. Aside from this they have other channels to ask about their NFT - and if they wish to transfer their NFT to their own Harmony Wallet we help them and they can take it out and do whatever they like with it. We also help them Bridge this to Ethereum if they want to too using the Harmony Bridge.

Let me know what other information you need!

@jbeltran Just let me know how to proceed! @giv too

@jbeltran Hey there! Can I ask kindly if you saw the videos / information above? Thanks a lot - we’re still looking for guidance on what I need to do to move past this milestone. Thanks!

@jbeltran @giv @lij Hey there - can I get an idea of where the hold up and what the next steps are? We have an agreed Grant milestone schedule which I believe has been passed. I’m not sure how much of this is to do with the recent downturn in crypto - and whether you are fighting fires or doing other things but I would expect some kind of response to this instead of dragging it out for quite a while now. Any information will be appreciated thanks.

Hello, sorry for the late reply.
Being busy by sure.
I saw the videos and thank you for putting it together.
Sorry, I’m missing a video in which you show the audit of the move from the app to harmony explorer.
I don’t have an iPhone, so I’d like to see how is the process and URL’s behind with the NFT added it to the blockchain. I’ve entered in the URL’s but I can see just JSON records.
Would you please walk through the steps as a user and the back explorer blockchain record?

Thank you
Will be closer to your reply so I can reply to you faster.
Best,

Hey there!

I think maybe I need to make it clearer - users of the app on iPhone (“Users”) cannot mint NFTs. The company (“Admin”) mints NFTs on the backend using the dashboards shown into custodian wallets that are connected to Users, which they can then view on the app (as shown by the videos). I can share the contracts here (they are not that interesting - just bare bones ERC721 contracts without the IERC721Enumerable interface because it is optional and wasteful of gas.

The Admin mint function code is:

export const createNFT = async (tokenURI: string) => {
  const web3 = web3AsOwner();
  const accounts: any = await web3.eth.getAccounts(); // The Company account

  const storeyxDB = contract(StoreyxDBArtifact); // the ERC721 contract address = 0x425b4567571bbf61ab24cbbf6cf71a924904833c
  storeyxDB.setProvider(web3.currentProvider);
  const instance = await storeyxDB.deployed();
  const tx = await instance.create(tokenURI, {from: accounts[0]}); // the mint function in the contract
  return tx;
};

After which Admin transfers the NFT to the User’s wallet.

You can see the transactions in the explorer for the NFT contract Harmony Blockchain Explorer

Here is the tx for safeTransfer of an NFT from Admin to User: Harmony Blockchain Explorer

The NFTs dont show properly in the Harmony Explorer because the explorer relies on the contract implementing the IERC721Enumerable interface! I don’t know why it requires that since the EIP says that is an OPTIONAL interface on the contract.

Instead if you just interacted with the Harmony blockchain directly you can easily verify it exists on the User wallet. This is the code to do this on the backend:

const web3 = web3AsOwner();
    const storeyxDB = contract(StoreyxDBArtifact); // the ERC721 contract address = 0x425b4567571bbf61ab24cbbf6cf71a924904833c
    storeyxDB.setProvider(web3.currentProvider);
    const instance = await storeyxDB.deployed();

    const nfts: any = [];
    const curNFTCountBN = await instance.curNFTCount.call();
    const curNFTCount = curNFTCountBN.toNumber();
// just iterate through all token IDs and get the owner
    for (let tokenId = 1; tokenId <= curNFTCount; ++tokenId) {
      const ownerOfAddress = await instance.ownerOf.call(tokenId.toString());
      if (ownerOfAddress.toLowerCase() === address.toLowerCase()) {
        const tokenURI = await instance.tokenURI.call(tokenId);
        console.log(`tokenId: ${tokenId} tokenURI: ${tokenURI}`);
        nfts.push({tokenId, tokenURI});
      }
    }
return nfts;

The URLs I have given you are the backend calls that do all the above code and give you the metadata JSONs for display.

If you want to see if completely on Explorer then I need to redo the whole NFT contract to include the IERC721Enumerable interface. Just let me know if you want that thanks!

@jbeltran @giv Hi! Does my explanation make sense?

From the looks of it @TakStorey you have gone way, above and beyond what any other grant applicant has done in order to prove your prototype… from the video… testnet… heroku proof that the tokens actually work… I am not entirely sure what the hold up is.

1 Like

Hey everyone! Is there anything else I need to do to prove this? I am happy to reveal more but I think i’ve described every stage of the journey - if you feel there is any questions just let me know thanks!

Hey man. You deserve you approval. @frwrdslosh I’ll tag him again

2 Likes

Hi there again.
Sorry, but it takes me more time to look at the code, explorer, etc.
Ok, from my point of view it’s working, although the only thing that concerns me and it did since some messages before is that the NFT isn’t really a property of the user, isn’t it?
I mean, can a user walk away with his own NFT?
Maybe this doesn’t make sense as if the game disappears the NFT won’t have too much value, but at least is an NFT user property.
Does it make sense?
By the ay, I’ll push it with the team and let you know to be validated as Milestone concluded. sounds good?
Thank you and sorry for the late reply.

Best,
:blue_heart:

1 Like

No problem - and you’re absolutely right to ask about this point. In fact this is very transparent and I am not hiding the fact that when the user gets their NFT it is not “completely owned by their own wallet”. They can at any time set up their own wallet and ask for a transfer (which we can then do) so they “properly” own it. We chose this design on purpose (basically using custodian wallets attached to their user account) because we are really trying to experiment with the easiest way to onboard mainstream users who may not know what an NFT is, and would not care about setting up Metamask / managing their own wallet etc. It’s a product decision and we now have some use cases which can inform us of new features in future on how to tackle this :slight_smile: Hope that makes sense!

1 Like

Yes, honestly, it’s fare and a really good explanation as most people don’t know about many things that we consider “simple”. Thanks for the explanation.

3 Likes

Thanks! @giv for visibility - looks like its a go!

Hey folks @jbeltran @giv just a gentle nudge - I believe I have completed the milestone, shall I open up a request for tokens as before? Thanks!

Good afternoon.
Pushing it inside the team for Milestones completed.
Stay tune this week please.
And ping me anytime.
Thank you

Thanks for that! Where can I keep track as its been more than a few months and I would like to know what is happening. Thanks! @giv

Hey folks~ hope you’re having a good day! I believe I have passed my milestone and would like to receive the agreed payments please :slight_smile: Pinging @giv - ok’ed by @jbeltran , cc’ing @lij . Can I go through the previous process? Thanks!

2 Likes

Hey is anyone still around? I’m not asking for much - I have completed the work for a milestone grant - and it would be good to know when I can get it? Im not going to stop until this is resolved I think Harmony folks are professional people so I am patient. @giv @lij (Irrespective of whatever is happening on the macro crypto price action I need these grants to pay previously contracted work in fiat so this stuff is real business and not a game)

3 Likes