Perform a free mint
Free mints are the simplest form of collection release. When compared to primary sale, the primary difference is that these are not paid transactions, thus "free". You may also know these as "airdrops".
Immutable offers a number of different options for you to conduct a free mint. Approaches differ in the Immutable features you utilise and there are differences in gas costs and user experience mechanics. These are detailed below.
Why conduct a free mint?
There are generally a number of reasons for conducting a free mint in a web3 game:
- Distribution as a means of reward: This is a tactic for games to keep their communities engaged, allowing players to own a new asset which may or may not be usable in-game. Nevertheless, it provides players with an elevated sense of status and belonging.
- Distribution as a means of customer acqusition: Similar to primary sales, free mint is also often used as a tactic to acquire future players. Thus, similar consideration apply as in a primary sale, you can find these detailed in the Perform a Primary Sale article.
Methods to platform for a free mint
Regardless of the above choice in why you're conducting a free mint, there are two distinct ways of platforming on-chain.
- Direct mint - Includes recommended method, including:
- Airdrop - direct minting to a customers' wallet initiated by developer or studio
- Free claim - direct mint to customer initiated by the customer's action
- Pre-mint and transfer - Not recommended
Method 1: Direct mint
There are 2 different user experience scenarios here,
- The first is when you as a developer initiates a mint and issue to users' wallets without the user needing to take action before the mint
- The alternative is the minting occurs only when a user takes action, ie initiates a mint via a user experience flow
We will take both approaches in turn:
Airdrop: Direct mint to customer initiated by you the game developer / studio
Direct mint using standard Immutable preset contracts
This is our recommended method to do free mints today on Immutable zkEVM, it's the most cost efficient as well as the least amount of front-end development work for your team. The best way to conduct this is by utilising our Minting API and taking advantage of our Gas Sponsorship for Gamer promotional period. You may also trigger this via some game play mechanic, the implementation would be the same.
Our Minting API allows you to mint directly to users' wallet addresses regardless of what the user chooses as their preferred wallet (i.e. Immutable Passport, Metamask etc). We support both ERC-721 and ERC-1155 tokens.
A summary of the relevant minting methods in our Minting API is as follows. Please note again, you should use our standard preset contracts for the Minting API to work.
Method | ERC standard | Where you would use this method | Recommendation |
mintBatch() with Metadata | ERC-721 |
| ✅ Recommend using this method now given the Gas Sponsorship for Gamers promotion |
mintBatchByQuantity() with Metadata | ERC-721 |
| Recommend migrating to using this after the Gas Sponsorship promotion |
safeMintBatch() with Metadata | ERC-1155 |
| Use only if your architecture requires ERC-1155 tokens |
The gas cost for utilising these methods will be subsidised by Immutable until early next year as per our Gas Sponsorship for Gamer promotional. After this, gas should be very cost effective and we will have management and reporting tools made available to you via Immutable Developer Hub.
Direct mint using custom primary sales contract
If you choose to do a free mint with a custom primary sales contract, your contract must inherit OperatorAllowlistEnforced.sol
to ensure proper handling of royalty and protocol fees.
Instructions can be found here.
Please note that when you're using custom contracts, the gas will not be paid for you under our Gas Sponsorship for Gamers promotion.
Free Claim: Direct mint to customer initiated by the customer
You can also create a minting experience where customers can come and "claim" a free mint, with the mint platformed in real time. To do this today, our recommended method is to use the Commerce Widget Primary Sales Flow by creating a primary sale that is priced at 0. Key things to consider are:
- Products offered should have price defined as 0 for each product
- Add limits to control how many can be minted per wallet address
- Create and add to a user allowlist if necessary to reward the right players
As an alternative also, if you want more flexibility to create your own front-end, please look at our Free Mint Dapp in the Community Tool section. This tool utilises the right setup to take advantage of our Gas Sponsorship for Gamers promotion. Note that this is a Immutable community built solution, it is not supported by Immutable product teams.
Method 2: Pre-mint and transfer
This occurs when a game creator (studio) initially mints assets into their collection-owned wallet(s) and then transfers (airdrops) those assets to players. While this approach allows more flexibility in the way you run your free mint (e.g. does not require a smart contract update upon a change in design), it could come at a potentially greater cost to the studio if they are required to pay both the minting and transferring gas fees for each asset.
We do not recommend executing with this method for your free mint on Immutable zkEVM. This is because whilst our Gas Sponsorship for Gamers can cover gas spend for your minting, you will need to pay gas for the additional transfer to users' wallets. Additionally, you will reveal NFT information prior to an airdrop, often concealing this until claim or drop is important.