# Unable to understand the ERC-1155 standard

**URL:** <https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950>\
**Category:** Smart Contracts\
**Tags:** erc1155\
**Created:** [November 5, 2022, 5:45am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950 "2022-11-05T05:45:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 5, 2022, 5:45am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/1 "2022-11-05T05:45:37Z")

</div>

Hello everyone,  
I am quite confused with the ERC-1155 standard. Few questions for that.

1. If we assign a baseURI in the constructor then the uri function will return that base URI for every  
tokenId passed into the function. So how can we make the tokens fungible. As there would be URI  
for every token ID.
2. How will the wallets and exchanges know the decimals for the tokens?? Because there is no  
implementation for decimals in ERC-1155.

---

<div class="post-metadata">

**Author:** ![CryptoWorld](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cryptoworld/32/16709_2.png) [@CryptoWorld](https://forum.openzeppelin.com/u/CryptoWorld)\
**Post date:** [November 5, 2022, 11:52am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/2 "2022-11-05T11:52:28Z")

</div>

It is the “base” url, you append the token Id after the url so it becomes unique.

ERC-1155 is about NFT’s not about ERC-20. ERC-20 is all about using a token like a cryptocurrency as if it is money. you need decimals to tell what the exact value is. NFT’s don’t represent a value but an “object” so decimals is not relevant to it.

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 5, 2022, 12:18pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/3 "2022-11-05T12:18:15Z")

</div>

But ERC1155 is a multi token standard, right?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/3X/3/3/3375b3274e9bd08dfabafc181472a754a92a563c.png)  
I am confused with this.

---

<div class="post-metadata">

**Author:** ![CryptoWorld](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cryptoworld/32/16709_2.png) [@CryptoWorld](https://forum.openzeppelin.com/u/CryptoWorld)\
**Post date:** [November 5, 2022, 1:24pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/4 "2022-11-05T13:24:36Z")

</div>

Yeah technically it’s for managing multiple tokens in 1 contract, so ERC-20 and ERC-721’s

The implementation is pretty much always used for managing multiple NFT types.

I’m not sure where your above information comes from. The specification itself doesn’t specify any ERC-20 interfaces. It is more for managing those tokens. However it is compatible with it, allowing you to implement it in such a way to interact with it as if it was one.

[https://eips.ethereum.org/EIPS/eip-1155](https://eips.ethereum.org/EIPS/eip-1155)

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 5, 2022, 1:32pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/5 "2022-11-05T13:32:35Z")

</div>

The above information comes from Ethereum's official website.

> **[ERC-1155 Multi-Token Standard | ethereum.org](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/)**
>
> Ethereum is a global, decentralized platform for money and new kinds of applications. On Ethereum, you can write code that controls money, and build applications accessible anywhere in the world.

That's what I am confused with. It is being created to manage fungible as well as non-Fungible tokens.  
And ERC20 fungible tokens don't have any URI attached. So in that case I think, we don't provide any BaseURI, instead tokens would have their own URIs attached through mapping. What are your views on this??  
And also ERC20 fungible tokens needs decimal to work.  
Or am I getting it wrong?  
Maybe the fungible tokens they are talking about, are the NFTs itself which are same having the same token ID.

---

<div class="post-metadata">

**Author:** ![CryptoWorld](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cryptoworld/32/16709_2.png) [@CryptoWorld](https://forum.openzeppelin.com/u/CryptoWorld)\
**Post date:** [November 5, 2022, 1:42pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/6 "2022-11-05T13:42:29Z")

</div>

You can add those interfaces of erc-20 and manage the fungible token that way.

But the eip doesn’t work as an a erc-20 in itself, it’s just providing you with an standard way so you can handle multiple different tokens like approving, getting the balance etc.

There is no problem in allowing the NFT’s you manage to not use a baseurl, it’s how most NFT’s use it.

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 5, 2022, 2:01pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/7 "2022-11-05T14:01:11Z")

</div>

So we can't define fungible tokens in ERC1155 contract.

---

<div class="post-metadata">

**Author:** ![CryptoWorld](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cryptoworld/32/16709_2.png) [@CryptoWorld](https://forum.openzeppelin.com/u/CryptoWorld)\
**Post date:** [November 5, 2022, 2:13pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/8 "2022-11-05T14:13:36Z")

</div>

You can implement it and it will work, it’s just not directly part of erc -1155.

---

<div class="post-metadata">

**Author:** ![mfer8023](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mfer8023/32/11458_2.png) [@mfer8023](https://forum.openzeppelin.com/u/mfer8023)\
**Post date:** [November 12, 2022, 1:17pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/9 "2022-11-12T13:17:57Z")

</div>

hi

let me try to give you a better understanding about ERC1155.

(1)  
**the fungible token doesn't have to have a decimal with it.**

think cash -- there's no 1.42 USD. or casino token -- there's no 1.42 chip (represents 1.42 USD) too.

(2)

> EIP-1155:  
> "A standard interface for contracts that manage multiple token types. A single deployed contract may include any combination of fungible tokens, non-fungible tokens or other configurations (e.g. semi-fungible tokens)."

**a contract deployed based on eip-1155 allows us to manage multiple token types** -- (a) fungible token(s) "without a decimal" along with (a) non-fungible token(s) -- **within one contract.**

i created a "simple" ERC1155-based nft collection deployed at goerli as an illustration:

> **[Simple1155 | Address 0x3ae337C693a9a0888998e475076e4eB964cc5b81 | Etherscan](https://goerli.etherscan.io/address/0x3ae337C693a9a0888998e475076e4eB964cc5b81#code)**
>
> The Contract Address 0x3ae337C693a9a0888998e475076e4eB964cc5b81 page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on...

on the second txn i called `mintBatch` method on the contract:

> **[Goerli Transaction Hash (Txhash) Details | Etherscan](https://goerli.etherscan.io/tx/0x818944c4ca7033bc9ae2d964eeefb70daa1d0b344898b78fb2787a5638332696)**
>
> Goerli (GTH) detailed transaction info for txhash 0x818944c4ca7033bc9ae2d964eeefb70daa1d0b344898b78fb2787a5638332696. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.

mintBatch allowed us to mint "multiple" -- non-fungible token (1 id = 1 amount/quantity = ERC721) and fungible token (1 id \> 1 amount). as many as we want within one transaction.

 ![2nd txn](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/3X/9/3/93bd23b9134a207ca8025ca64787f4c7dcfabd95.png)

on this case (image above), i mint batch 3 ids (= token IDs) where:  
id #1 is non-fungible (only 1 amount of quantity)  
id #2 is fungible (10,000 amount of quantity)  
id #3 is fungible (100,000,000 amount of quantity)

note:  
it is a prove to show that within one contract can have multiple token types.

(3)

> EIP-1155:  
> "In contrast, the ERC1155 Multi Token Standard allows for each token ID to represent a new configurable token type, which may have its own metadata, supply and other attributes."

since each id may have its own metadata, you can look at its opensea testnets collection page:

> **[simple erc1155 collection - Collection | OpenSea](https://testnets.opensea.io/collection/simple-1155)**
>
> for educational purpose only

eg. "mfer gold token" (id #2, with total amount of supply = 10K):

> **[mfer gold token - simple erc1155 collection | OpenSea](https://testnets.opensea.io/assets/goerli/0x3ae337c693a9a0888998e475076e4eb964cc5b81/2)**
>
> disclaimer - the asset is for educational purpose only.

note:  
this is the feature that ERC20 doesn't have. where we can create a fungible token represented with a unique identifier (id) pointing to where its metadata's location (uri).

(4)

> EIP-1155:  
> "New functionality is possible with this design such as transferring multiple token types at once, saving on transaction costs."

on the 3rd txn, i called `safeBatchTransfer` on the contract:

> **[Goerli Transaction Hash (Txhash) Details | Etherscan](https://goerli.etherscan.io/tx/0x11367837db004ec2f2a711d877dc80550e0d5e76f586b893dd313b1cafb46b25)**
>
> Goerli (GTH) detailed transaction info for txhash 0x11367837db004ec2f2a711d877dc80550e0d5e76f586b893dd313b1cafb46b25. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.

 ![3rd txn](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/3X/0/2/02897df9dc6cf06b00d1c23d28188c4c0f6cdccc.png)

on this case (image above), i transfer batch 3 ids (= token IDs) to 1 address, where:  
id #1 (total amount: 1)  
id #2 (total amount: 234)  
id #3 (total amount: 4,560)

note:  
it is a prove that we can transfer multiple token types at once within one transaction.

hope it helps mfer.

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 13, 2022, 9:44am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/10 "2022-11-13T09:44:58Z")

</div>

Really appreciate your explanation mate.  
So let me get this straight, ERC1155 allows us to create fungible token but those tokens are not like ERC20 token as they all have a URI metadata, and don't have decimals.  
We can just say that it makes the NFTs fungible?  
We can't create tokens like USDT or DAI from this contract, which are only digits and doesn't contain any type of metadata assigned to them. Am I right??

---

<div class="post-metadata">

**Author:** ![mfer8023](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mfer8023/32/11458_2.png) [@mfer8023](https://forum.openzeppelin.com/u/mfer8023)\
**Post date:** [November 13, 2022, 10:03am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/11 "2022-11-13T10:03:24Z")

</div>

> We can just say that it makes the NFTs fungible?

yesss

> We can't create tokens like USDT or DAI from this contract, which are only digits and doesn't contain any type of metadata assigned to them. Am I right??

and yesss ser

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 13, 2022, 10:16am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/12 "2022-11-13T10:16:37Z")

</div>

Okay, Thanks.  
This was really stressing me out.

---

<div class="post-metadata">

**Author:** ![CryptoWorld](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cryptoworld/32/16709_2.png) [@CryptoWorld](https://forum.openzeppelin.com/u/CryptoWorld)\
**Post date:** [November 13, 2022, 10:35am UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/13 "2022-11-13T10:35:37Z")

</div>

Seems like I misunderstood a part of the EIP. So indeed no ERC-20 support, but more like multiple different ERC-721’s with an additional value attached to it and allowing transfer of those values/amounts. Makes sense.

---

<div class="post-metadata">

**Author:** ![Solidity\_Learner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/solidity_learner/32/10643_2.png) [@Solidity\_Learner](https://forum.openzeppelin.com/u/Solidity_Learner)\
**Post date:** [November 13, 2022, 12:33pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/14 "2022-11-13T12:33:13Z")

</div>

Yeah,  
We can also say adding the fungibility to NFTs. 👀

---

<div class="post-metadata">

**Author:** ![mfer8023](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mfer8023/32/11458_2.png) [@mfer8023](https://forum.openzeppelin.com/u/mfer8023)\
**Post date:** [November 13, 2022, 5:06pm UTC](https://forum.openzeppelin.com/t/unable-to-understand-the-erc-1155-standard/32950/15 "2022-11-13T17:06:17Z")

</div>

yeah true... that's why eip-1155 was inspired by enjin coin.

imagine with erc1155, in one nft collection (one contract), we can release some non-fungible items like the avatars/characters and we can have fungible items for the game items (swords, poisons, etc) and/or its currency.
