GameFi
  • General Intro
  • 📃R & D
  • 💻Workshop
    • 🏎️NFT Web App Integration
      • 📄Prerequirements
      • Decentralized Storage
      • Smart Contract NFTs
      • Creating the React Dapp
      • Updating Startup File, Wallet Connect & Main Menu
      • Fetching NFTs, Stacks and Hiro API
      • Rendering NFTs owned
      • Selecting an NFT
      • Mapping Scenes
      • Creating the playable game
  • 🪙Trustless Rewards - M1
    • General idea
    • Flow Lobbies
    • Smart Contract
  • 🎨Customizable NFTs - M2
    • General Idea
    • Flow Customizable NFTs
    • Smart Contracts
      • Component
      • Customizable Wrapper
  • 🎁Lootbox on Chain - M3
    • General Idea
    • Tech Explained
    • Smart Contracts
      • Item
      • Lootbox
      • Lootbox Manager
  • 📝Message Signing
    • General Idea
    • GameFi Use Cases
    • App Explained
  • 🪵SFTs
    • General Idea & Base SFTs Static Deployments
    • Metadata Structure
    • Static Flow and Smart Contracts
    • Advanced SFTs Dynamic Deployments
    • Dynamic Flow and Smart Contracts
    • Dapp Integrating SFTs
      • Front End
      • Back End
    • Resources
  • ⚡Subnets
    • Overall for subnets
  • Roadmap
  • 💾Decentralized Storage
    • Gaia
    • Pinata
    • Host SFTs and NFTs into Pinata
    • Gaia integration to host game resources
  • 🔗External Knowledge
    • Getting Started
    • Hiro API
    • Stacks Docs
    • Clarity Book
    • Hiro Tutorials
Powered by GitBook
On this page
  • Create a basic NFT Smart Contract to integrate into the game
  • Edit smart contract
  • Rename MY-OWN-NFT to character
  • Change token-URI
  • Stacks Explorer

Was this helpful?

  1. Workshop
  2. NFT Web App Integration

Smart Contract NFTs

PreviousDecentralized StorageNextCreating the React Dapp

Last updated 2 years ago

Was this helpful?

In order to integrate NFTs into a game, we need a smart contract for the NFTs. We'll create an NFT project locally, edit the NFT smart contract, fund the testnet account with STX and upload it there. The clarinet project should be created in the root folder of the cloned repository.

Create a basic NFT Smart Contract to integrate into the game

Follow Hiro NFT example

Edit smart contract

Rename MY-OWN-NFT to character

Change token-URI

from https://token.stacks.co/{id}.json to ipfs://QmNLo4oeN741Ai5PEafBnDtpXh2XMea8wBUGicTeErCtEB/{id}.json

Stacks Explorer

Faucet - request STX for the address

  1. Connect wallet

  2. Select last option from the right list and press Request STX

Deploy .nft-trait and .my-nft smart contracts on testnet

  1. Select first option from the right list, paste the nft-trait contract from the local project, rename contract name to nft-trait, press Deploy and confirm the transaction

  2. Paste the my-nft contract from the local project, rename contract name to my-nft press Deploy and confirm the transaction

Wait for the smart contracts to get confirmed on the anchor block

Mint NFTs using the sandbox

  1. Copy my-nft contract address

  2. Go back to sandbox, pick the second option from the right list and paste the contract name there

  3. Select claim and call the function

Go to ​

💻
🏎️
https://explorer.stacks.co/sandbox/faucet?chain=testnet
Non-fungible tokens | Hiro Docs
Logo