Skip to content

contract.MintBatchExtension

Aleksey Bykhun edited this page Jan 18, 2023 · 1 revision

MintBatchExtension

Git Source

Functions

onlyNFTOwner

modifier onlyNFTOwner(IERC721Community nft);

mintAndSend

Mint one token to each recipient

function mintAndSend(IERC721Community nft, address[] calldata recipients) external onlyNFTOwner(nft);

Parameters

Name Type Description
nft IERC721Community The NFT contract
recipients address[] The list of recipients, each getting exactly one token

mintAndSendBatch

Mint tokens to a list of recipients

function mintAndSendBatch(IERC721Community nft, address[] calldata recipients, uint256[] calldata amounts)
    external
    onlyNFTOwner(nft);

Parameters

Name Type Description
nft IERC721Community The NFT contract
recipients address[] The list of recipients
amounts uint256[] Amount per each recipient to mint

multisend

Send a batch of tokens to a list of recipients

The sender must have approved this contract to transfer the tokens

Use multisendBatch for ERC721A-optimized transfer

function multisend(IERC721Community nft, uint256[] calldata ids, address[] calldata recipients) external;

Parameters

Name Type Description
nft IERC721Community The NFT contract
ids uint256[] Token IDs to send
recipients address[] The list of recipients

multisendBatch

Sequentially sends tokens to a list of recipients, starting from startTokenId

The sender must have approved this contract to transfer the tokens

Optimized for ERC721A: when you transfer tokenIds sequentially, the gas cost is lower

function multisendBatch(IERC721Community nft, uint256 startTokenId, address[] calldata recipients) external;

Parameters

Name Type Description
nft IERC721Community The NFT contract
startTokenId uint256 The first token ID to send
recipients address[] The list of recipients
Clone this wiki locally