✍️
Technology Initiative Tracking
  • Solid POD
  • Distributed Consensus
  • Ethereum 2
  • Docker
  • MAC Tips & Tricks
  • Arduino
  • Raspberry Pi
  • ZenCode
  • WASM
  • Substrate Framework
    • Substrate Runtime Developer Academy Course
  • Cryptography
  • Polkadot
    • Chains Actors - Who they are?
    • Crowdloan & Parachain Auctions
  • eIDAS DSS Lib
  • Dfinity
  • NFT
  • reCaptcha
  • Kubernetes
    • K8S Lab on Mac m1
Powered by GitBook
On this page
  • Deploy your First NFT on OpenSea
  • Build your first Tradable NFT from Scratch
  • Step 1: ERC721 Contract preparation
  • Step2: Adding MetaData to the NFT Token
  • NTF with Polkadot

Was this helpful?

NFT

Deploy your first NFT

PreviousDfinityNextreCaptcha

Last updated 3 years ago

Was this helpful?

Deploy your First NFT on OpenSea

Ref:

Build your first Tradable NFT from Scratch

  • This support material can be used as inspiration also:

We will accomplish the following here under:

  • Structuring your ERC721 contract

  • Structuring you off-chain metadata

  • View your items on OpenSea

  • testing out the auction flow for your items.

Step 1: ERC721 Contract preparation

// Clone Git Repo:
$ git clone https://github.com/ProjectOpenSea/opensea-creatures.git

// Use a specific Version of Node.js v12.18.4
// https://app.gitbook.com/@marcantoine-lemaire/s/programming-languages/javascript-programming

// Install it
$ yarn

// Prepare variable needed to deploy SC on Rinkeby:
$ export INFURA_KEY=="<your_INFURA_project_id>"
export MNEMONIC="<metamask>"
export NETWORK="rinkeby"

// Install Truffle
// https://www.trufflesuite.com/docs/truffle/getting-started/installation
$ npm install -g truffle
// or you can install locally with
$ yarn add truffle

// Potential issue because Truffle last version 5.3.5 require node 14.0.0 min
// but here core working on node 12.18

// Install in the project Repo the truffle-hdwallet-provider
// To install the npm package
$ sudo npm install -g @truffle/hdwallet-provider

$ truffle deploy --network rinkeby
// or 
$ DEPLOY_CREATURES_SALE=1 yarn truffle deploy --network rinkeby
// Create contract deployed to 0x7096AF553Cc6C98b4198C9f4d05C0a9A0FBDA6F5
// CreatureFactory deployed to 0xe6E5Fa4DD83446F6f20bfA7202A3352C6d2C9dEe
// From account: 0x7C584e710fE6afA5369A8Bffee47Fc98D76535a5

// Check transaction on Rinkeby
https://rinkeby.etherscan.io/address/0x7c584e710fe6afa5369a8bffee47fc98d76535a5

Next, we'll want to mint new assets to our newly-deployed ERC721 contracts! We'll mint these assets into an account that we control so that we can test the OpenSea auction flow for our items.

// Minting the NFT Token
export OWNER_ADDRESS="0x7C584e710fE6afA5369A8Bffee47Fc98D76535a5"
export NFT_CONTRACT_ADDRESS="0x7096AF553Cc6C98b4198C9f4d05C0a9A0FBDA6F5"
node scripts/mint.js

export OWNER_ADDRESS="0x7C584e710fE6afA5369A8Bffee47Fc98D76535a5"
export NFT_CONTRACT_ADDRESS="0x7096AF553Cc6C98b4198C9f4d05C0a9A0FBDA6F5"
export FACTORY_CONTRACT_ADDRESS="0xe6E5Fa4DD83446F6f20bfA7202A3352C6d2C9dEe"
export NETWORK="rinkeby"
node scripts/mint.js

Enter there the Address ot your NFT-Contract

You can now see your NFT objects:

Then put in sales the NFT with the owner address

Buy it with another address

At this point, we've deployed our first smart contract on the Rinkeby network and minted some new OpenSea creatures on our contract. You should be able to visit rinkeby.opensea.io and view your new creatures as NFTs inside your wallet!

Step2: Adding MetaData to the NFT Token

This is where off-chain metadata comes in to play! Each token identifier in your ERC721 contract will have corresponding metadata URI that returns additional important information about the item, such as the item's name, image, description, etc

So to change your MetaData of your NFT, change the creature.sol and use another URL corresponding to your API

Step3: Embed on your Web Site a NFT

NTF with Polkadot

is the latest standard in non-fungible tokens. ERC-721 defines a minimum interface a smart contract must implement to allow unique tokens to be managed, owned, and traded.

// ! you need to have a special version of node.js to make their script work: See here to change to v12.18.4 of node.js supported:

Project Git: (as illustration on OpenSea NFT platform integration)

To see NFT on OpenSea testnet:

Then Visit a Market place to add you NFT Inside of it:

Look at the transaction:

Creature attribute are defined in

That URL is defined on the Creature.sol:

The default metadata for the creatures is provided by https://opensea-creatures-api.herokuapp.com/api/creature/{token_id}, which is set . Next, you'll need create your custom metadata API.

Pallet named Unique that Gavin is developping:

https://docs.opensea.io/docs
https://docs.opensea.io/docs/1-structuring-your-smart-contract
https://github.com/ProjectOpenSea/opensea-creatures
https://testnets.opensea.io/collection/opensea-creature
http://erc721.org
https://docs.opensea.io/docs/developer-tutorials
ERC721
https://app.gitbook.com/@marcantoine-lemaire/s/programming-languages/javascript-programming
https://github.com/ProjectOpenSea/opensea-creatures
https://testnets.opensea.io/assets
https://testnets.opensea.io/get-listed/step-two
https://testnets.opensea.io/activity/opensea-creatures-v7q0uka4pk
https://rinkeby.etherscan.io/tx/0xf526b6d9f22cc4a4723c4cea9d5ca534bc4700f325862cd5da0d82e6b42fadf1
https://opensea-creatures-api.herokuapp.com/api/creature/1
https://github.com/ProjectOpenSea/opensea-creatures/blob/a0db5ede13ffb2d43b3ebfc2c50f99968f0d1bbb/contracts/Creature.sol#L14
here
https://opensea.io/blog/announcements/announcing-embeddable-nfts/
https://github.com/paritytech/substrate/tree/master/frame/uniques