GithubHelp home page GithubHelp logo

kamsec / nft-minter Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 4.0 19 KB

Python tool for minting NFTs in a batch from single or multiple addresses.

Python 100.00%
python nft blockchain web3 web3py dapp minter-blockchain

nft-minter's Introduction

NFT-minter

This project allows you to mint NFTs of deployed smart contracts in a batch from single or multiple addresses. It supports Ethereum and Polygon, including test networks.

Table of contents:

  1. Requirements
  2. Installation
  3. Usage
  4. Configuration
  5. Examples

1. Requirements:

2. Installation

  1. git clone https://github.com/kamsec/nft-minter.git
  2. cd nft-minter
  3. pip install -r requirements.txt
    (or just pip install web3==5.25.0)

3. Usage

  1. Specify settings in settings.json (example values):

    {
        "CHAIN_NAME": "Mumbai",
        "CONTRACT_ADDRESS": "0xF83C73a44C4a919aB3DF1B515B470e452032eeF4",
        "MINT_FUNCTION_NAME": "mint",
        "NUMBER_OF_MINTS": 6,
        "MINT_PRICE": 0.1,
        "EXTRA_MIXING_LAYERS": 0,
        "SEND_BACK": true,
        "LOGGING": true
    }
  2. Specify secrets in secrets.json (replace ***):

    {
        "PRIVATE_KEY": "0x***",
        "PROVIDER": "***"
    }
  3. Run the program in one of the available modes, e.g.:

    python minter.py -multi
    

    It will display selected settings, estimate transaction fees, and ask if you want to proceed. Enter y to run the program or anything else to exit.

4. Configuration

Settings (settings.json):

  • CHAIN_NAME - set to one of available chains:
    Ethereum, Ropsten, Rinkeby, Kovan, Polygon, Mumbai
    If you need to add other chain, you can modify CHAINS dict in settings.py
  • CONTRACT_ADDRESS - the address of smart contract deployed on selected chain, with verified source code (available on corresponding blockchain explorer api)
  • MINT_FUNCTION_NAME - the exact name of the minting function of smart contract to execute
  • NUMBER_OF_MINTS - the number of times for minting function to be executed.
    In Multi mode this is also the number of accounts derived, each account will execute mint function once
  • MINT_PRICE - the minimum price of single mint in Ether (or MATIC if we are on Polygon/Mumbai blockchain), not including transaction fee
  • EXTRA_MIXING_LAYERS - only for -multi option - creates additional sets of addresses to mix coins and hide slightly the origin of funds
  • SEND_BACK - only for -multi option - after minting, sends the remaining funds back to the master account
  • LOGGING - enables printing transactions and logging in logs/ directory

In settings.py you can find additional advanced settings, but normally they don't require adjustments.

Secrets (secrets.json):

  • PRIVATE_KEY - Private key of an address, starting with 0x
    You can generate new one by running
    python minter.py -newacc
    
  • PROVIDER - Blockchain API provider key e.g. from Infura, Alchemy or similar

Modes (command-line arguments):

  • -h - help page
  • -newacc - New account mode - generates a new account, displays keys and quits the program
  • -single - Single mode - initializes master_account from PRIVATE_KEY specified in secrets.json and calls specified mint function from it multiple (NUMBER_OF_MINTS) times.
  • -multi - Multi mode - initializes master_account like in Single mode, by hashing the private key derives another NUMBER_OF_MINTS accounts, sends funds to them and mints once from every derived account

5. Examples

Example runs with different settings and modes can be found in logs/ directory.

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.