# ERC1155 support on Etherscan and minting fungible and non-fungible tokens

**URL:** <https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583>\
**Category:** Contracts\
**Created:** [August 18, 2020, 9:53am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583 "2020-08-18T09:53:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeabitTech](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@DeabitTech](https://forum.openzeppelin.com/u/DeabitTech)\
**Post date:** [August 18, 2020, 9:53am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/1 "2020-08-18T09:53:45Z")

</div>

**💻 Environment**

**📝Details**

**🔢 Code to reproduce**

Hi guys i have a question of ERC1155:

when i create a simply smart contract like this:

```auto
pragma solidity ^0.6.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol";

contract Collections is ERC1155 {
    address operator = msg.sender;
    
    uint256 private constant collect1 = 0;
    uint256 private constant collect2 = 1;
    uint256 private constant collect3 = 2;
    
    uint256[] listIds = [collect1,collect2,collect3]; 
    
    constructor() public ERC1155('https://5ea012a211b078001679d41f.mockapi.io/tokens/{id}'){
        
        
    }
    
    function createToken(address account, uint256[] memory ids, uint256[] memory amounts, bytes memory data) public {
        ids = listIds;
        _mintBatch(account, ids, amounts, data);
        
    }
    
    function getIds() public view returns(uint256[] memory){
        return listIds;
    }
    
}

```

when i mint the token i send this token to another account unlike operator address, but i can’t see the balance of token of account on etherscan, why? (i just use ropsten)

2 question: how to decide the mint of non-fungible token or fungible token? how to do this in \_mint function??

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [August 19, 2020, 1:54am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/2 "2020-08-19T01:54:23Z")

</div>

Hi @DeabitTech,

Welcome to the community forum 👋  
Thanks for posting here.

For OpenZeppelin Contracts you should only use code published in an official release. When importing via GitHub you should specify the release tag, otherwise you will get the latest code in the master branch. [https://remix-ide.readthedocs.io/en/latest/import.html#importing-from-github](https://remix-ide.readthedocs.io/en/latest/import.html#importing-from-github)

Please note, in your contract there is no access control, so any account could mint tokens.

> [@DeabitTech](#):
>
> when i mint the token i send this token to another account unlike operator address, but i can’t see the balance of token of account on etherscan, why? (i just use ropsten)

Etherscan supports ERC20 and ERC721. Etherscan doesn't currently support ERC1155, so it won't show the token balances.

You can read the balances from the smart contract.

I deployed the following contract to Rinkeby and verified the smart contract source code.

[https://rinkeby.etherscan.io/address/0x09208ed67613d42086141d3efb546dc9d794e255#readContract](https://rinkeby.etherscan.io/address/0x09208ed67613d42086141d3efb546dc9d794e255#readContract)

We can use Etherscan's read/write interface to interact with the token, including checking balances.

 ![Etherscan 1155 balance](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/4/4915c3331aefdd7240c5da9d170992a103562f92.png)

### GameItems.sol

Remix version of example from: [https://docs.openzeppelin.com/contracts/3.x/erc1155#constructing\_an\_erc1155\_token\_contract](https://docs.openzeppelin.com/contracts/3.x/erc1155#constructing_an_erc1155_token_contract)

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

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC1155/ERC1155.sol";

contract GameItems is ERC1155 {
    uint256 public constant GOLD = 0;
    uint256 public constant SILVER = 1;
    uint256 public constant THORS_HAMMER = 2;
    uint256 public constant SWORD = 3;
    uint256 public constant SHIELD = 4;

    constructor() public ERC1155("https://game.example/api/item/{1}.json") {
        _mint(msg.sender, GOLD, 10**18, "");
        _mint(msg.sender, SILVER, 10**27, "");
        _mint(msg.sender, THORS_HAMMER, 1, "");
        _mint(msg.sender, SWORD, 10**9, "");
        _mint(msg.sender, SHIELD, 10**9, "");
    }
}

```

You may want to deploy this example and have a play with it to see what you can do with ERC1155. Also see the ERC1155 OpenZeppelin Contracts documentation: [https://docs.openzeppelin.com/contracts/3.x/erc1155](https://docs.openzeppelin.com/contracts/3.x/erc1155)

> [@DeabitTech](#):
>
> 2 question: how to decide the mint of non-fungible token or fungible token? how to do this in \_mint function??

A fungible token in ERC1155 has a quantity greater than one.  
A non-fungible token in ERC1155 has a quantity of one.

If you want a fungible token, mint multiples of them. In the example above Silver, Gold, Silver, Swords and Shields are fungible, whilst Thors Hammer (as only one is minted) would be non-fungible.

* * *

You may want to look at the ERC1155 Preset contract as a way to get started.

> **[ERC1155](https://docs.openzeppelin.com/contracts/3.x/erc1155#Presets)**
>
> The official documentation for OpenZeppelin Libraries and Tools

---

<div class="post-metadata">

**Author:** ![DeabitTech](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@DeabitTech](https://forum.openzeppelin.com/u/DeabitTech)\
**Post date:** [August 19, 2020, 2:34am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/3 "2020-08-19T02:34:11Z")

</div>

Okay, i undestand all,  
I just write a little articol (in italian language) on medium, see out of link:

> **[Solidity Tutorial— Multi Standard Token: ERC-1155](https://medium.com/deabit/solidity-tutorial-multi-standard-token-erc-1155-25bf2c0a270e)**
>
> Questa volta cambiamo trend.. o meglio, andiamo nel dettaglio del “backend” delle nostre amatissime Dapp: gli Smart Contract!

Thank you for all

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [August 19, 2020, 3:00am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/4 "2020-08-19T03:00:43Z")

</div>

Hi @DeabitTech,

Thanks for sharing your article.

Can you update your import in your article so that it imports from an official release of OpenZeppelin Contracts rather than the master branch?

```auto
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.1.0/contracts/token/ERC1155/ERC1155.sol";

```

---

<div class="post-metadata">

**Author:** ![DeabitTech](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@DeabitTech](https://forum.openzeppelin.com/u/DeabitTech)\
**Post date:** [August 19, 2020, 9:10am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/5 "2020-08-19T09:10:45Z")

</div>

sure [https://medium.com/deabit/solidity-tutorial-multi-standard-token-erc-1155-25bf2c0a270e](https://medium.com/deabit/solidity-tutorial-multi-standard-token-erc-1155-25bf2c0a270e)

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [August 24, 2020, 2:18am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/6 "2020-08-24T02:18:14Z")

</div>

Hi @DeabitTech,

Would you like to post your article in #general:guides-and-tutorials

---

<div class="post-metadata">

**Author:** ![DeabitTech](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@DeabitTech](https://forum.openzeppelin.com/u/DeabitTech)\
**Post date:** [August 24, 2020, 10:35am UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/7 "2020-08-24T10:35:49Z")

</div>

Hi @abcoathup,

Sure, thank you for opportunity!

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [November 3, 2020, 10:51pm UTC](https://forum.openzeppelin.com/t/erc1155-support-on-etherscan-and-minting-fungible-and-non-fungible-tokens/3583/8 "2020-11-03T22:51:10Z")

</div>

Split this topic on November 3, 2020, 10:51pm UTC

A post was split to a new topic: [How is the ERC1155 metadata bound to the tokenid?](https://forum.openzeppelin.com/t/how-is-the-erc1155-metadata-bound-to-the-tokenid/4376)
