Skip to content

Custom ERC721A smart contract designed for efficient NFT creation with low gas consumption.

License

Notifications You must be signed in to change notification settings

QU3B1M/gas-efficient-nft-smartcontract

Repository files navigation

Optimized NFT SmartContract (ERC721A)

NFT contract that use ERC721A to significantly reduce the gas consumption.
You can use this contract to create your NFT Collection just by updating some values\

(I will explain how to do it below)

Using this contract to deploy your own NFT Collection

Follow this steps to deploy your own instance of this contract.

Clone and open the project:

  • git clone https://github.com/QU3B1M/brownie-nft-smartcontract.git
  • cd brownie-nft-smartcontract

Adapting the Contract and Environment

  1. Update the contract (contracts/QBM.sol):

    • Update this file name to your collection name.
    • Update this contract name (QBM.sol: line 11) to the name of your collection
    • Update the collection name and symbol (QBM.sol: line 32)
    • Set the constants values to fit your needs (QBM.sol: line 13 to line 18)
    • Set the base URIs (QBM.sol: line 24 to line 25)
    • Update all the require messages in the file (change QBM to your contract name.)
  2. Update the deploy script (scripts/deploy.py):

    • Update the import, change QBM to the name of your contract (deploy.py: line 2)
    • Update the contract to deploy in the deploy_contract function (deploy.py line 8)
  3. Update the .env file (.env)

    • Set the whitelist sale start date in the format yyyy-mm-dd (WHITELIST_SALE_START)
    • Set the public sale start date in the format yyyy-mm-dd(PUBLIC_SALE_START)
    • Set the private key of the deployer account (PRIVATE_KEY)
    • Set your project's infura project ID (WEB3_INFURA_PROJECT_ID)
    • Set the deployer etherscan API Key (ETHERSCAN_TOKEN)

Installing Brownie and its Dependencies

  1. Create a python virtual environment by running the following command: python3 -m venv venv
  2. Activate the virtual env by running: source venv/bin/activate
  3. Install all this project's dependencies with the following command: pip install -r requirements.txt

Testing and Deploying the Contract

  1. Execute the tests using the command: brownie test
  2. Deploy locally using the command: brownie run scripts/deploy.py
  3. Deploy on Rinkeby using the command: brownie run scripts/deploy.py --network rinkeby
  4. Deploy on Mainnet using the command: brownie run scripts/deploy.py --network mainnet

License

This project is licensed under the MIT license.

About

Custom ERC721A smart contract designed for efficient NFT creation with low gas consumption.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published