HYDRA Documentation
  • Introduction to Hydra Chain
  • HydraGon
    • Migrate to HydraGon
    • Staking Calculator
  • Legacy Hydra
  • FAQ
  • Hydra web wallet
    • Create New Wallet
      • Key File Option
      • Mnemonic Words Option
    • Access Your Wallet
      • From Mnemonic Words
      • From Private Key
      • From Key File
    • Send and Receive Assets
      • Receive Assets
      • Send Assets
    • Add HRC20 Token
    • Setup Offline Wallet
  • Hydra web browser extension
    • How to integrate with dApps
  • Hydra for Beginners
  • Ledger Nano Guide
  • Hydra Bridge
  • HydraDEX
    • Adding and Removing Liquidity
    • Liquidity Mining on HydraDEX
  • Useful Links (Legacy)
  • Essentials
    • UTXOs Accounting
    • Test & Main Networks
    • Desktop wallet basic usage
    • Wallet Encrypt, Backup and Restore
    • Hydra Core Wallet Commands
    • Adding Nodes
    • Encrypt and Unlock Hydra Wallet
    • Wallet Recovery With Salvagewallet
    • bech32 support
    • Repositories
    • Hydra Exchange Usage Guide
    • How to Add Options
    • How to Use bootstrap.dat
    • Command Lines (RPC API)
    • Guidance of Hydra Deployment and RPC Settings
    • How to Build Hydra on Raspbian
  • HRC20 Tokens
    • HRC20 Token
    • HRC20 Raw Transactions
    • HRC20 With Hydrachainjs
    • HRC20 DApp
  • HRC721 Tokens
    • HRC721 Token - How to deploy
  • How Transactions Work
  • Hydra Economy (Legacy)
    • The Flexible Supply Mechanism
    • Legacy Staking Calculator
  • Installation Guides
  • Guide for Linux
  • Guide for Raspberry Pi
  • Guide for MacOS
  • Staking HYDRA Coins
    • Setting up Staking
    • Staking with Windows VPS on AWS
    • Staking with Linux on DigitalOcean VPS
    • How to Stake Hydra on Linux
    • Stake With Linux VPS
    • How to Stake on FreeBSD
    • Hydra node health check
    • Superstaking
    • Delegating to Superstaker
    • Delegating via Mobile App or Web Browser
    • Lydra Basics
    • Understanding LYDRA — Key Concepts and Dynamics
  • Hydra Chain Core Team
  • KYC/AML Policy
  • Privacy Policy
  • API Documentation
    • Explorer API (in work)
      • General Blockchain Info
      • Fetching Transaction History for HYDRA and HRC20 tokens
      • Block Info
      • Transaction Info
    • Hydra DEX API
  • Community Tools
    • Github repository
    • Docker image for Hydra Node
    • Hydradex.org Custom Lists
  • Security Audits Hydra Bridge
Powered by GitBook
On this page

Was this helpful?

  1. HRC721 Tokens

HRC721 Token - How to deploy

How to deploy a HRC721 contract (NFT)

PreviousHRC721 TokensNextHow Transactions Work

Last updated 4 months ago

Was this helpful?

Introduction

This project is an implementation of NFT (non-fungible token) based on ERC721 and OpenZeppelin. You can use it to issue your own NFTs and build corresponding DApps on Hydra chain.

HRC721 Template

We will use a QRC721 template, based on ERC721 and OpenZeppelin templates. Download this project and install dependencies, like this:

$ git clone https://github.com/qtumproject/QRC721Token.git
$ cd QRC721Token
$ npm install

The QRC721 template tree will be installed in the QRC721Token folder. There is no need to edit anything in the template.

For npm to work you need to install nodejs, which will also install npm.

Dev Environment

  1. Install the compiler. You'd better install it from a binary package or the source code. Before you install the compiler check in the headers of the QRC721.sol file and of the imported OpenZeppelin templates which version of the compiler you will need. In our example SOLC 0.5.5+commit.47a71e8f.Linux.g++ was used.

  2. Install . Solar is a smart contract deployment tool of Qtum. Solar is written in GO, so we needed to install also Golang. In our example go1.18.2 linux/arm was used.

Deploy QRC721

  1. Start the full Hydra node with GUI (hydra-qt -testnet). You should have some Hydra coins in the node for contract gas.

  2. Solar can deploy QRC721 and ERC721 contracts, so for using it with Hydra the source code of Solar should be changed to make the proper RPC calls to our Hydra full node. Then the command solar deply can be used. Instead we will use the command with a different option solar compile to only compile the template and get the BYTECODE and ABI. The command should be run in the QRC721Token folder.

cd QRC721Token
solar compile contracts/QRC721.sol

3. Using the Hydra full node with GUI (hydra-qt -testnet) and the BYTECODE and ABI you can now deploy your HRC721 contract. You will be able to enter the name and symbol of your smart contract after you populate the ABI field on the Smart Contracts > Create contracts tab of the Hydra node. Also select in the field “Sender Address” the address that will pay for the contract and push the button “Create Contract”. Wait for a confirmation on the blockchain for the contract to be deployed.

Solidity
Solar