npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hrc721

v1.0.1

Published

HRC721 Token Template

Downloads

5

Readme

HRC721

HRC721 Token Template

Introduction

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

You can refer to this article for a detailed description of NFT and HRC721.

Deployment

Prerequirements

  1. Install the Solidity compiler. You'd better install it from a binary package or the source code.
  2. Install Solar. Solar is a smart contract deployment tool of Htmlcoin.
  3. Download this project and install dependencies, like this:
$ git clone https://github.com/htmlcoin/HRC721Token.git
$ cd HRC721Token
$ npm install

Deploy HRC721

  1. Start a Htmlcoin full node. For example, a testnet Htmlcoin QT node can be started on Mac like follows. Here you'd better specify the user name, password and port for RPC interfaces. Moreover, you should have some Htmlcoin coins in the node for contract gas.
$ /Applications/Htmlcoin-Qt.app/Contents/MacOS/Htmlcoin-Qt -testnet -server -rpcuser=USER -rpcpassword=PASSWORD -rpcport=4889
  1. Deploy HRC721 using Solar. This command should be executed under the HRC721Token directory. The RPC parameters of the full node you start above should be specified here. You can replace the term name and symbol with anything you want.
$ solar deploy contracts/HRC721.sol '["name","symbol"]' --htmlcoin_rpc=http://USER:[email protected]:4889
exec: solc [contracts/HRC721.sol --combined-json bin,metadata --optimize --allow-paths /Users/htmlcoin/Code/HRC721Token/HRC721Token]
cli gasPrice 40 40
🚀  All contracts confirmed
   deployed contracts/HRC721.sol => 780e2578b08dddc56ca518277a18a2fb6f14da61
  1. After sucessful deployment, the contract address is shown in the command line. A file named solar.development.json is generated under current directory with information about the deployed contract, like the sender address, contract address, ABI and etc.
// part of solar.development.json
{
  "contracts": {
    "contracts/HRC721.sol": {
      "source": "contracts/HRC721.sol:HRC721",
      "abi": ...,
      "bin": "...",
      "binhash": "f9f27b8932c3bdfe03975201cbdd43c4058de166e737f044b43f53446d19468e",
      "name": "HRC721",
      "deployName": "contracts/HRC721.sol",
      "address": "780e2578b08dddc56ca518277a18a2fb6f14da61",
      "txid": "45f71bf4d95680e15a4d857e17be2a13aa8f85403a1e624db4151d8cfb98bf5b",
      "createdAt": "2018-11-12T16:21:33.205371334+08:00",
      "confirmed": true,
      "sender": "hK2ha4bbrVusPwDvM243mLg4SAke9RqUrv",
      "senderHex": "1022ba6fa5f2515857a5b226141144b74c3c7d85"
    }
    ...
  }
}

Interact with HRC721

Using js

See example/cli.

Using Htmlcoin QT

  1. Mint some HRC721 tokens.
    1. Choose "Smart Contracts-Send To" in Htmlcoin QT.
    2. Copy the contract address and ABI to the form.
    3. Choose the function mint and fill the form with specified "to address" and "token id". (Here the address is in hex format, which you can use the command "fromhexaddress" or "tohexaddress" in "Help-Debug Window-Console" to transfer it from or to a base58 format)
    4. Choose the contract sender address as "Sender Address", since only the contract owner can mint new tokens.
    5. Press "SEND TO CONTRACT" button and wait for the created transaction to be confirmed.

image

  1. Call HRC721 functions.
    1. Choose "Smart Contracts-Call" in Htmlcoin QT.
    2. Copy the contract address and ABI to the form.
    3. Choose any function you want execute and Press "CALL CONTRACT" button. The you can see the result.

image image

  1. Check the contract in the blockchain explorer. You can find the token name, total supply and other information in the page. More information about HRC721 will be supported later when needed.

image