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:
-
lazy minting or just in time minting.
-
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.
-
MaxSupply: total number of token that we want to mint(it can be any number without increasing transaction fee)
-
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:
-
Ethereum Magicians:Idea : minting one billion NFTs or 2^256
-
Ethereum Magicians: EIP Draft : mint arbitrary number of tokens(ERC-721) via EIP-2309
-
GitHub: EIP-draft_ERC721FancyMint.sol
benefits
-
no minting fee for any number of token.
-
users can view the tokens before owning them.
-
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.
and as I promised they all minted with no transaction.
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
Ask:
-
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.
-
If you can get one from this collection it’s an honor for me.
-
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.
sciNFTist.eth