GithubHelp home page GithubHelp logo

terryribaudo / nft-deployer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaywelsh/nft-deployer

0.0 1.0 0.0 291 KB

UI for deploying NFT contracts and minting NFTs

Home Page: https://vagabond.mypinata.cloud/ipfs/QmW8ft5vEG7DcEkzZz2zEcgUYTHzNyPBJY4r3tXA4zTN8D/#/

License: MIT License

HTML 2.15% TypeScript 96.70% CSS 1.16%

nft-deployer's Introduction

NFT Deployer

Handles the deployment of NFT contracts as well as minting of NFTs on said contracts.

Right now only deploys and mints ERC721 contracts/tokens.

Demo

The ERC721 Contract

This is the smart contract that is deployed by this tool, it simply passes a name (sort of like a "full name", e.g. Ether) and symbol (sort of like a "short name" e.g. ETH) into the constructor of the contract.

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;

// 3.1.0-solc-0.7 openzeppelin
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract ERC721NFT is ERC721, Ownable {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;

    constructor(string memory tokenName, string memory tokenSymbol) public ERC721(tokenName, tokenSymbol) {}

    function mint(address recipient, string memory tokenURI) public onlyOwner returns (uint256) {
        _tokenIds.increment();

        uint256 newItemId = _tokenIds.current();
        _mint(recipient, newItemId);
        _setTokenURI(newItemId, tokenURI);

        return newItemId;
    }

}

IPFS Metadata Hash

For the IPFS Metadata hash, this refers to the IPFS hash of the token Metadata that has been uploaded to an IPFS provider such as your own IPFS node or something like Pinata.cloud

Here is an example of NFT metadata, the "image" property should have the QmXa7itoeFWYsSGxJuZg2FhnUGTsnhc5YemSdzMEbBGW4F portion of the metadata replaced with your NFT media, the rest of the content should also be adjusted to be applicable to your piece:

{
   "name":"The name of your NFT",
   "description":"The description of your NFT",
   "image":"ipfs://QmXa7itoeFWYsSGxJuZg2FhnUGTsnhc5YemSdzMEbBGW4F",
   "attributes":[
      {
         "trait_type":"Type",
         "value":"NFT + Physical"
      },
      {
         "trait_type":"Artist",
         "value":"The Name Of The Artist"
      },
      {
         "trait_type":"Edition",
         "value":"1/1"
      },
      {
         "trait_type":"Dimensions",
         "value":"28.6 x 19.7 x 5 cm / 11.25 x 7.75 x 2 in"
      },
      {
         "trait_type":"Case Dimensions",
         "value":"33.02 x 22.23 x 6.99 cm / 13 x 8.75 x 2.75 in"
      },
      {
         "trait_type":"Medium",
         "value":"Acrylic & Ink"
      },
      {
         "trait_type":"Support",
         "value":"Canvas"
      }
   ]
}

Uploading the following JSON data to IPFS will return a hash, in this case QmbAywJY1pvRkzUBAtDrRXBcT5agncKhmy1PcA1877xxth which resolves to this, this QmbAywJY1pvRkzUBAtDrRXBcT5agncKhmy1PcA1877xxth would then be used in the Metadata IPFS Hash field on the minting page (the tokenURI could be stored on-chain as either ipfs://QmbAywJY1pvRkzUBAtDrRXBcT5agncKhmy1PcA1877xxth or https://vagabond.mypinata.cloud/ipfs/QmbAywJY1pvRkzUBAtDrRXBcT5agncKhmy1PcA1877xxth, it's up to you to decide whether to make use of plain ipfs://<IPFS-HASH> URLs or if you would rather point to your own node endpoint, most decent parses should be able to extract the IPFS hash from a URL which points to your own IPFS node, but if you would rather not rely on that, use the ipfs://<IPFS-HASH> value as the tokenURI).

Environment Variables

If you have an Infura API key, add it to the .env.sample file and then rename the file to .env

Install Dependencies

npm install or yarn

Start app

npm start or yarn start

Supported Networks

  • Ethereum Mainnet
  • Rinkeby
  • Goerli
  • Kovan
  • Ropsten

nft-deployer's People

Contributors

jaywelsh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.