Contract Minting 101

ft. Katana V2

Ever seen minting transactions like this?

Transaction

This mint had a limit of “1 token per wallet”. However here you can see that 100 tokens were not only minted, but they were consolidated into a single wallet all in one transaction.

How?

This is known as ‘contract minting’, an NFT botting strategy that can take your mints to the next level.

Katana V2 - The ‘Best’ Contract Minter

Before we dive into what contract minting is, a notable mention is Sensei's Katana V2 contract minter. It is the most gas efficient contract minter on the market. Benchmarks are provided further down in the article.

“Contract minting” can be a confusing term. Every ‘mint’ occurs via a contract, right? So isn’t this just regular minting? Not quite. A contract mint typically refers to a specialised method of sending multiple mint transactions to a contract, but all in one transaction.

Contract minting typically works by creating multiple “child contracts” or “workers" (same thing, different name). These workers are contracts that ‘act’ like an individual user. They are controlled by a ‘parent’ contract. A ‘contract mint’ is simply a transaction telling the parent contract to send the mint transaction via multiple workers.

Gas Efficiency Is King: Why Contract Minting is Important

Contract minting provides a more gas efficient way to mint many NFTs.

All transactions on Ethereum pay an initial upfront “start up cost”. So if you minted 100 NFTs from 100 wallets, you pay 100x more in startup gas costs than you would with a single contract mint! This can add up to some sweet savings that can measurably affect your PnL.

The more gas efficient you are, the more you can increase your priority fee while paying the same, or less in final transaction fees than a user who is being less gas efficient.

Gas efficiency is the #1 priority to assess the effectiveness of a contract minter. Better gas efficiency provides two core important benefits. You pay less to get your NFTs and you can get your transactions prioritized higher than other participants running less efficient contract minters. This ultimately means you can pay more in priority fee while still being more profitable than others.

Creating the best contract minter on the market hasn’t been easy. It has required careful attention to detail and using the right solutions for different problems.

Benchmarking Katana V2

Overview

Benchmarks are conducted for a variety of common scenarios against previous similar on-chain Ethereum transactions.

These include methods involving worker deployment, contract minting, and NFT withdrawal from workers. Scenarios such as “mint then transfer” were not benchmarked due to their relative lack of use cases in gas competitive scenarios where gas efficiency is important.

Each benchmark has a reference transaction that is compared against. Tests were run using Foundry.

Methodology

  1. - Fork Ethereum Mainnet at the block of the reference transaction
  2. - Deploy Katana V2 contract set
  3. - Simulate identical scenario with newly deployed contracts
  4. - Compare gas report for relevant function invocation with reference gas usage

This methodology lets us get to a blockchain state virtually identical to the one at the time of the reference transaction, and simulate with the exact state of the blockchain (including the NFT contract state) as the reference transaction did.

Results

Click here to see the results of the benchmark tests comparing Katana V2 to other contract minters.

Advanced Contract Minting

Sending a mint transaction via worker contracts is the most basic use case of contract minting. Here is a quick overview of other more advanced contract minting techniques, with each one requiring special logic to perform.

‘Mint-to’ Mints

Most public mints have ‘static’ transaction data. This means that the transaction data that Worker A sends will be the same as Worker B. However, there are contracts that require you to specify the wallet address that is minting (the receiver of the NFT) within that transaction data. This means that Worker A will have different transaction data to Worker B.

Token Balance Gated Mints

Very rarely, some mints will require you to hold a specific token (usually another NFT) for your mint transaction to be valid. Since you may not have enough tokens for all your workers to have a valid mint, a sneaky strategy is to send a single token to Worker A, mint via Worker A, send the token from Worker A to Worker B, mint from Worker B, and so on!

Consolidate Mints (a.k.a Transfer Mode)

This mode of operation will mint an NFT via a worker, transfer it to a wallet of your choice, then mint from the next worker, and so on. This looks fancy and seems cool, but it is typically gas inefficient.

Mints usually happen during times of higher than normal gas prices, sometimes ridiculously high. Instead of paying high gas for the transfer operations, it is almost always better to wait for gas to cool down and perform a withdrawal action on your contract minter. However, you might consider this mode if you want to flip as soon as possible and exit all your NFTs.

Limitations

The ‘tx.origin’ Check

One rather big caveat when it comes to contract minting is that you cannot do it to any and every NFT contract. You specifically need a public mint that doesn’t explicitly block contract minters. If you see this line of code in the contract source code, you likely won’t be able to contract mint it:

Txn.sender

This line of code checks that the sender of the transaction (a.k.a “tx.origin”) is the minter (a.k.a “msg.sender”). Since the contract minter will use a worker to send the mint transaction, the minter address will be “msg.sender” but the “tx.origin” will be the address initiating the contract mint.

Whitelist Mints

To contract mint a whitelist drop, you will need some of your worker addresses whitelisted. You cannot contract mint a whitelist drop if your regular Ethereum address is whitelisted. We only recommend submitting worker addresses if you are confident that the contract will be contract mintable. You can verify with the developers of the project if this will be the case.

Withdrawing NFTs

When your worker contract performs the mint, the NFT is transferred to the worker contract (assuming standard contract minting). Since contracts don’t have a private key, you can’t sign orders to sell the NFT on a marketplace without withdrawing them from your workers first.

Summary

When the opportunity permits, contract minting is a superior method of acquiring NFTs. It allows you to pay more gas while paying less in overall transaction fees, but it also looks cool as hell. Combining this with something like MEV Bundling is a killer combo.

  • - Contract minting is the superior way of botting multiple NFTs versus from multiple wallets
  • - Katana V2 has been benchmarked as the most gas efficient contract minter
  • - At a competitive level, gas efficiency is king
  • - There are advanced contracting strategies to be aware of
  • - It is important to understand the environments that allow contract minting to occur
Recent Articles
No new blog posts
The Ultimate NFT Trading Automation
Home
Features
Pricing
FAQs
Blog
© 2023 Sensei. All rights reserved