Minting functions

Explanation of all possible ways to mint with the contract.

Main functions to use are mintAdvanced and mintTransfer. They have only one difference and that is auto withdrawal during the mint transaction. This consumes less gas than mint + withdraw separately, but using it during gas war will cost more in gas fees overall.

Functions mintData and mintTokenGate has a rare usage.

  • use Data in contracts with mintTo(wallet address), token ID or unique value parameters.

  • use TokenGate in contracts that whitelist a wallet through balanceOf check for different NFT.

    • example: A wallet can mint once if it holds any Azuki token, without it restricting the ID of the same Azuki token for next wallet mint.

Legend for special variables

  • Value Per One

    • Default value > 0

    • If the value is 0, the mint price will be funded with the ETH sent from the main wallet.

    • Input mint price of one mint in WEI to fund mint price directly from clones.

      • Using eth from clones will save around 5k gas per clone, it is a huge difference during gas wars, but on low gas it is not important.

        • around 0.125 ETH saved on a 50 clone mint on 500 gwei

    • Use disperseEth to fund your clones, you can withdraw them whenever with withdrawEth.

  • Transfer Type

    • Default value > 0

    • 0 > executes transfers with transferFrom() function

      • usaully cheaper

    • 1 > executes transfers with safeTransferFrom() function

  • Total Supply Modifier

    • Default value > 0

    • mintTransfer function utilizes totalSupply() value to find correct token IDs to transfer out. Keep this at 0 unless the token counting doesn't start from 0 or 1

    • example: NFT contract starts from Token ID 2, use TotalSupplyModifier > 1

  • Force Exit

    • Default value > True

    • In case of unique data mints, user might not want to exit whole process after one failed task. In that case use Force Exit > False

      • example: Try to mint a contract with token ID param, mint 50 tasks from ID 120-170, continue mint process even if some of them are already minted.

      • Can consume gas without minting any tokens.

function mintAdvanced

  • Parameters

    • NFT contract (address)

    • Mint input/calldata (bytes)

    • Starting contract index (uint256)

    • Amount of contracts (uint256)

    • Repeat per contract (uint256)

    • Value Per One (uint256) [wei value]

  • Usage

    • Change contract index to mint NFT to adjust which contracts will be used

    • Change repeat per wallet based on individual NFT contract mint conditions

function mintTransfer (ERC721 only)

All mints happen on first contract, after each repeat all the NFTs minted get transferred to recipient's address, which allows the process to loop.

  • Parameters

    • NFT contract (address)

    • NFT recipient (address)

    • Mint input/calldata (bytes)

    • Starting contract index (uint256)

    • Repeat per contract (uint256)

    • Amount of contracts (uint256)

    • Tokens per Task (uint256)

    • Value per One (uint256) [wei value]

    • Transfer Type (uint256)

    • Total Supply Modifier (uint256)

  • Usage

    • Mint + transfer out in one transaction

function mintData

  • Parameters

    • NFT contract (address)

    • Nested array Mint input/calldata (bytes[][])

    • Total amount of tasks on all contracts (uint256)

    • Starting contract index (uint256)

    • Value per One (uint256)

    • Force Exit (boolean)

  • Usage

    • NFT contract with mintTo parameter

    • NFT contract with other parameter that is unique in every transaction

function mintTokenGate

Get access to mint through holding the gate NFT and transfer it to next contract to mint it again

The first contract needs to hold the specified gate NFT IDs, gate NFTs can be withdrawn after the mint is over from the last contract that minted with regular NFT withdraw function

You need to have one more deployed contract after your loop so the token can be transferred to it and withdrawn manually after at the end.

  • Parameters

    • NFT contract (address)

    • Token Gate contract (address)

    • Array of Token Gate IDs (uint256[])

    • Mint input/calldata (bytes)

    • Starting contract index (uint256)

    • Amount of Contracts (uint256)

    • Repeat per Contract (uint256)

    • Value per One (uint256)

  • Usage

    • NFT contracts with balanceOf check for other NFT contract and no limit restrictions on IDs

function mintTokenGateData

Combination of mintData and mintTokenGate

  • Parameters

    • NFT contract (address)

    • Token Gate contract (address)

    • Array of Token Gate IDs (uint256[])

    • Nested array Mint input/calldata (bytes[][])

    • Total amount of transactions on all contracts (uint256)

    • Starting contract index (uint256)

    • Value per One (uint256)

    • Force Exit (boolean)

  • Usage

    • NFT contracts with balanceOf check for other NFT contract and no limit restrictions on IDs with a parameter that is unique in every transaction

Last updated