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

@nfthashi/contracts

v0.4.0

Published

We provide the contract integrated bridge function as SDK for the users who want to create a more advanced NFT utilizing cross-chain. For example, a chain with minted NFTs, a chain with current NFTs, the itinerancy of NFT bridges, and other NFTs whose met

Downloads

5

Readme

SDK

We provide the contract integrated bridge function as SDK for the users who want to create a more advanced NFT utilizing cross-chain. For example, a chain with minted NFTs, a chain with current NFTs, the itinerancy of NFT bridges, and other NFTs whose metadata changes according to these attributes, and so on, will allow for new expressions that have not been possible before!

You can create those NFTs easily by installing SDK and inheriting the contract follow the instructions in the document below.

How to use

Installation

$ npm i @nfthashi/contracts

The functions and interfaces of each contract are summarized here. https://docs.nfthashi.com/developer-guide/contract-informations

Usage

Once installed, you can use the contracts in the library by importing them:

pragma solidity ^0.8.0;

import "@nfthashi/contracts/NativeHashi721.sol";

contract NativeHashi721Example is NativeHashi721 {
  uint256 private immutable _startTokenId;
  uint256 private immutable _endTokenId;
  uint256 private _supplied;

  string private _baseTokenURI;

  constructor(
    uint32 selfDomain,
    address connext,
    address dummyTransactingAssetId,
    string memory name,
    string memory symbol,
    uint256 startTokenId,
    uint256 endTokenId,
    string memory baseTokenURI
  ) NativeHashi721(selfDomain, connext, dummyTransactingAssetId, name, symbol) {
    _startTokenId = startTokenId;
    _endTokenId = endTokenId;
    _baseTokenURI = baseTokenURI;
  }

  function mint(address to) public {
    uint256 tokenId = _startTokenId + _supplied;
    require(tokenId <= _endTokenId, "NativeHashi721: mint finished");
    _mint(to, tokenId);
    _supplied++;
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    return super.tokenURI(tokenId);
  }

  function _baseURI() internal view virtual override returns (string memory) {
    return _baseTokenURI;
  }
}

See documentation for variables required to deploy to other chains

Constructor arguments

selfDomain

=> The domain ID of the network you deploy

connext

=> The connext handler address of the network you deploy

dummyTransactionAssetId

=> The test ERC20 token address of the network you deploy

You can find the each variables from https://docs.nfthashi.com/developer-guide/informations


If you're new to smart contract development, head to Developing Smart Contracts to learn about creating a new project and compiling your contracts. This Openzeppelin document helps your understanding. https://docs.openzeppelin.com/learn/developing-smart-contracts


Deployment

Token ID should be different in each chain. For example, Rinkeby token ID is 0-999, and Kovan token ID is 1000-1999. After deploying the contract to each chain, all contract connections should be registered.

Publish

cd packages/contracts && yarn cpx 'contracts/**/*.sol' dist && yarn cpx package.json dist/ && yarn cpx README.md dist/ && cd dist && npm publish && cd .. && rm -rf dist && cd ../..