Giter VIP home page Giter VIP logo

lazy-mint-contract's Introduction

Lazy Ghost NTFs

Demo

My full article explaining lazy minting can be found on https://dev.to

https://dev.to/hussainzz/lazy-minting-nft-solidity-hardhat-30l1

https://dev.to/hussainzz

Dapp https://ghost-mint-57sbttrch-hussainzz.vercel.app/

Installation

> yarn install

Next,rename env.example to .env and populate values

PRIVATE_KEY=<Your Wallet Private Key>
MUMBAI_RPC_URL=https://polygon-mumbai.g.alchemy.com/v2/<API_KEY>
POLYSCAN_API_KEY=<PolyScan API KEY>

Contract Deployment

> yarn hardhat deploy --network <network_name_defined_in_config>

deployment script should also verify the contract,In case it fails you can manually verify by running

yarn hardhat verify --network <networkName> <deployedContractAddress>  "<constructorArgument>[in this case minterAddress]"

Creating Sales Order [Signed Vouchers]

Run,

> yarn hardhat run scripts/createSalesOrder.js --network <network_name>

This will create file in /lazymintdapp/src/NFTVouchers.json

Unit Tests

> yarn hardhat test

 Lazy Mint NFT Unit Tests
    ✔ Should allow to mint nft with valid voucher (94ms)
    ✔ Should fail to mint nft if price passed is less than voucher price (85ms)
    ✔ Should fail to mint nft with existing tokenId (99ms)
    ✔ Should not allow to mint nft with invalid voucher (48ms)
    ✔ Should fetch tokenURI for the given tokenId (62ms)
    ✔ Should fail to fetch tokenURI for invalid tokenId
    ✔ Should allow owner to withdraw funds (61ms)
    ✔ Should not allow to withdraw funds if one is not an owner (71ms)
    ✔ Owner's balance should reflect after withdrawing funds (68ms)
    ✔ Should return true when checking for ERC721 interface support (44ms)

lazy-mint-contract's People

Watchers

 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.