How many ERC1155 token can be minted in one block with batchMint function?

Hi all,

I use a very simple ERC1155 to generate token. Today I just do a 10 threads testing to mint 100 tokens by 10 batchMint run at the same time. However, I found I only can mint 1 batchToken in 1 block. rest of the submission are pushed to next block. How can I mint several different batch tokens by mintBatch within one block?
On the other hand, I also notices that same situation happened with batchTransfer. I can only send one batchTransfer at a time, if I send multi batchTransfer, the 2nd submission will be push to next block. I don’t recall any limitation in the ERC1155 specification. Did I do anything wrong?

:computer: Environment

  1. Ubuntu with geth 1.19.20 Ethereum chain
  2. Openzeppelin 3.1.0
  3. Python web3 5.12.0

:memo:Details

  1. include OpenZeppelin ERC1155 library
  2. Generate 10 threads to mint 100 token by 10 batchMint function
  3. Observed that only 1 batchMint in one block. Others are pushed to next. In total 10 blocks to complete.
  4. Observed that same situation with batchTransfer. I only can do 1 batchTransfer at a time.

:1234: Code to reproduce

    // contracts/GameItems.sol
    // SPDX-License-Identifier: MIT
    pragma solidity ^0.6.0;

    import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
    import "@openzeppelin/contracts/access/Ownable.sol";
    contract GameItems is ERC1155 {
        constructor() public ERC1155("https://game.example/api/item/{1}.json") {
        }
        myMintFunc(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) public onlyOwner {
            _mintBatch(to, ids, amounts, data);
        }
    }
1 Like

I found issue on my gas limit setting of my chain. I can submit multiple batchAdd and seal in one block now.

1 Like

Hi @SamT,

I’m glad you were able to resolve. I would have thought that with appropriate gas prices and with room in blocks then multiple batch minting transactions could be put in one block.