Tokens

ERC721 Part 2: Your NFT on OpenSea

written by
Chris Cao
Date Last Updated
September 19, 2022
Download Project Files

In the tutorial, I am going to show you how to interact with your contract and see your very own nft on OpenSea!

NFT to OpenSea

The hardest part is over. You have made the contract and understand the EIP-721. You are ready to deploy it on a testnet and see it for real on OpenSea. There are many different way to reach this end goal. I am going to show you an simple way to do it with a couple of tool outside ApeWorX. The Web3 ecosystem is incredible, so let me show off some cool tools to bring it all together.

9 Steps to the finish line:

  1. Create a metadata file and an Image for your NFT
  2. Host the 2 files on a NFT media manager site (optional)
  3. Save the new ipfs CID to the your contract.
  4. Compile new content in the contract
  5. Open Ape Console with the testnet and provider
  6. Mint NFT
  7. Verify on OpenSea
  8. ???
  9. Profit

1. Creating a JSON meta data file:

NFT are a digital signature to represent ownership of something tangible. The most common use case is to proof of ownership of a picture and it details behind it. The details can be represented in a metadata file: The metadata file standard is defined by this standard EIP-1155


{
  "name": "ApeNFT #0",
  "description": "This is a place holder for Ape NFT.",
  "external_url": "https://www.apeworx.io/",
  "attributes": [
    {
      "trait_type": "animal",
      "value": "ape"
    },
    {
      "trait_type": "background color",
      "value": "pink"
    },
    {
      "trait_type": "accent color",
      "value": "yellow"
    },
  ],
  "image": "ipfs://QmSdR1bZJNuRuPAqtbqf4JLbSGktshvj4waDjZ6SwFYRoi"
}

2: Host the 2 files on a NFT media manger site (optional)

One of the tool, I recommend is pinata. It is a Media Manager company for content creators and developers to integrate with IPFS (InterPlanetary File System)

IPFS is a protocol, hypermedia and file sharing peer to peer (p2p) for storing and sharing data in a distributed file system. We will be using pinata to manage a metadata file and its image to pin it on an ipfs node for all to use and see.

3. Save the new IPFS CID to your contract

CID means Content Identifier. When you host a file on ipfs, it hashes content address so you can use it discreetly. This is a sample of a CID


ipfs://QmR9BQNHmru4JY1tKKakZCHHZ2kARLKMiRh5J327Hgb6Jt

It view the image hosted on ipfs you can use this format for piñata.


https://gateway.pinata.cloud/ipfs/QmR9BQNHmru4JY1tKKakZCHHZ2kARLKMiRh5J327Hgb6Jt

4. Compile the contract

With the new CID, make sure you find and replace all the CID references. You can test to make sure you got them all by running ape test.

5. Open Ape Console with testnet and provider


$ ape console --network ethereum:rinkeby:alchemy

This is homestretch. Deploy the contract on a testnet, if you want it on OpenSea, you can deploy it on Rinkeby and Polygon if you like.

6. Mint the NFT


In [1]: contract.mint("reciever_address", sender=dev)

7. Verify on a marketplace(OpenSea)

Now that the contract is deployed and you have minted an NFT. Make sure you check it out and see your hard work! You can check your work out on the testnet linked to OpenSea and another testnet with Rariable too.

8. ???

You have done it! You can do whatever you want to the contract is on the blockchain forever!

9. Profit

Let me know what you decide to do with it!

Here are some recommendations on what to do next:

  • Host a frontend so your friends can mint an NFT. (I would love to have one!)
  • Tell me what was easy to understand and hard to grasp. (I want to improve it)
  • Join a hackathon and show this off! (Join a team and make something cool with what you learned)
  • Say hello in our discord! We have an #NFT channel, S H O W I T O F F

If you like what we are about you can donate if you like: ApeWorX's banana fund.

SUBMIT YOUR PROJECTGET HELPLEAVE FEEDBACKAPE ACADEMY GITHUB
SHARE TUTORIAL