β¨ Intro to Contract Looping
Snipe over max-buy limits in one transaction
Last updated
Snipe over max-buy limits in one transaction
Last updated
Katana is compatible with ERC721, ERC1151, and ERC20s
Ever seen minting transactions like this?
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.
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.
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.
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.
Fork Ethereum Mainnet at the block of the reference transaction
Deploy Katana V2 contract set
Simulate identical scenario with newly deployed contracts
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.
Click here to see the results of the benchmark tests comparing Katana V2 to other contract minters.
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.
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.
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!
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.
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:
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.
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.
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.
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