Small Grant: a new ERC721 that removes minting fee or no transaction fee minting

Small Grant: a new Implementation of ERC721 that removes minting fee or no transaction fee minting.(ERC721FancyMint.sol)

Title explanation:

As of today there is two way to mint ERC721 NFTs:

  1. lazy minting or just in time minting.

  2. pay the minting fees your self and list them.

but I created a way to mint arbitrary number of NFT wit no minting fee.

how other ERC721 works?

let’s see how any ERC721 tokens are created.

at the heart of any ERC721 there is data storage that hold what token(token Id number) belongs to which Ethereum address.


  • this is a “Mapping”, Mapping is like a kind of magical table/record, it has a default value for every possible entry.
    the default value for addresses are address(0).

  • as people mint tokens, contract populates the mapping with user address.

An ERC721 contract have to determine which tokens exist.

  • for example in ERC721 Implemented by OpenZeppelin the Rationale behind token existence is if a token owner address is 0x0000000000000000000000000000000000000000 (also called address(0)) this token does not exist, if anything else the token is exist and owned by that address.

in the image above only the tokenID 0, 1, 2 are exist.

my Implementation:

This implementation I need to introduce you to 2 new parameter.

  1. MaxSupply: total number of token that we want to mint(it can be any number without increasing transaction fee)

  2. preOwner: preOwner is the address that we want to mint maxSupply of token to.(maybe the creator)

This Implementation uses a new abstraction or for token existence, it check if a Token ID is less than MaxSupply it exists, and if the token owner is any address beside 0x0000000000000000000000000000000000000000 (address(0)) it belong to that address, if the owner was address(0) it belongs to preOwner.

aslo at deployment make the balance of the user equal to MaxSupply.

In this way preOwner have MaxSupply number of token in their wallet.

Example: If we create a collection with this implementation with the MaxSupply of 999, token 0 to 998 would be exist.

If you want to know more about the Implementation please look at the following links:

  1. Ethereum Magicians:Idea : minting one billion NFTs or 2^256

  2. Ethereum Magicians: EIP Draft : mint arbitrary number of tokens(ERC-721) via EIP-2309

  3. GitHub: EIP-draft_ERC721FancyMint.sol


  1. no minting fee for any number of token.

  2. users can view the tokens before owning them.

  3. tokens are accessible trough all Ethereum platforms at the same time. including marketplaces, block explorers, …

Deployed on the mainnet.

Fancy Project : Premeium

I created a collection around this. it has 999 item and the art is on-chain SVG.

and i list them in diffrent market places. something that you can’t do with marketplaces lazy minting contract.

OpenSea Link

LooksRare Link

UniSwap NFTs

and as I promised they all minted with no transaction.

etherscan link

this collections is fully compatible withIERC721 and IERC721Enumerable by using ERC721FancyMint and ERC721FancyMintEnumerable ( it’s a bit too long to explain here )

the code is available here: Github-Fancy_project_premium


  1. I really want to reach to other ERC721 developers to know what they think about this, and what new projects they can create with ERC721FancyMint so If you enjoy this, please share it.

  2. If you can get one from this collection it’s an honor for me.

  3. If nounsDAO could provide 2.5 ETH for me I could really use it to get a laptop and some peripheral, it would be great.

Thank you for your time.


I’m not a dev, but I’d love to learn more. :slight_smile:

This process seems more like you’re pre-minting the tokens under the 0x00… ownership and then people who are later ‘minting’ them are just buying them from that addess. Am I thinking that through correctly?

Also, what is the savings on the mint cost? Do you know what portion of the mint is contract related and what is the gas? I know contracts shoot for gas optimization, I just don’t know enough to speak intelligently about it.

It’s a great question.
the pre-mint process that you mention or lazy minting is different from this.

when the NFTs are are lazy minted:
In that way the tokens data are shown at the platform that created by, and the token are minted(exist) when a person is purchased them. but there are two draw backs that ERC721FancyMint does not have.

  1. you have to trust the platform(e.g. a marketplace like Opensea,…) to does not remove the NFT before it has chance to be fully minted. because the ownership data and token data is not available on Ethereum blockchain yet.
  2. Other Ethereum platforms(other market places, Etherscan, …) do NOT know the token exist yet so you can’t show cases your NFT to other communities at the same time. because when they want to read who is the token owner from the Ethereum blockchain it says “Error: Returned error: execution reverted: ERC721: invalid token ID” also when they wanted to know the tokenURI(the thing that shows token metadata and data) it says “Error: Returned error: execution reverted: ERC721: invalid token ID”

this Implementation that I proposed is used a different way of determining which token exist, instead of looking for owner of a token, I propose we look at the token Id of a token and consider.
and if a tokenId was less than a certain value(max supply) it exist.

this way:

  1. the need to trust a platform is removed, because you can ask this contract on the blockchain and it shows it exist.
  2. since the token exist at deployment the tokens are available trough all Ethereum platform like market places and block explorers, … at the same time. (you can see the screenshots at the original post that it is from opensea, looksrare, uniswap, etherscan)

on the “what is the savings on the mint cost?”:

tldr: the minting cost is zero gas.

let’s see with an example.
In my opinion is one of the best in minting the NFTs and they can mint NFTs very efficiently. they provide creator their own contract that they can mint their NFTs trough that.
this a screen shot from their Docs on Batch Minting

their platform is uses 12 million gas for 200 NFT (don’t get me wrong they did an impressive job) but they say it can’t mint more than 200 token per transaction(.

ERC721FancyMint does not uses transaction for creating NFTs they make them in an abstract way without changing blockchain state, you can see the deployment transaction here:

you can see that it only used around 4 million gas for contract, that has 999 NFT (it can be one billion NFT, the contract does not care)
the magic happens all with the help of EIP-2309 the consecutiveTransfer event(event is a thing that notify other application that there is something to check for) instead of simple one by one transfer.
consecutiveTransfer of token 0 - 998 are here in that same transaction log:

1 Like

@verb-e @davidbrai @ripe this seems pretty interesting, but we’ve reached the point that we’re over my head. You all work with solidity I believe. Would you take a look when you get an opportunity?

1 Like

this is a cool little trick! i can see some circumstances where it is useful and others where the contract creator might not want to do this.

otherwise, i’m curious what the ask is for?

1 Like

thank you for taking the time to read, it means a lot.

the ask is, as an independent researcher I have no source of income yet, I really could use nouns community support. either by supporting the collection or getting a fund.