ERC1155 new contract for NFT/FT's can we get this in Zeppelin?
This is the EIP, for reference: https://eips.ethereum.org/EIPS/eip-1155
It looks quite interesting and there's a lot of activity in the discussion, it may make a lot of sense to include something like this in OpenZeppelin.
@WhiteRaBot17 are you planning on using this standard? Could you share a bit more about your project?
Thank you very much for this suggestion!
@nventuro I am experimenting with ERC721 contracts for game assets. The ERC1155 is similar to the ERC721 standard but it has a bit more functionality by introducing the double mapping. While ERC721 is capable of serving the purpose, the ERC1155 gives the ability to do batch transfers. So we can create multiple items, and transfer multiple items or multiple quantities of the items.
I know that Unity has added Enjin mintable items to their assets in their software, and this should open up a "multiverse" where games can utilize assets from other games and incorporate them into their own games.
This is an area I am experimenting in among other things.
The only reason why I am a bit hesitant to start using ERC1155 is because I would like to see more adoption, testing, and use of it beyond Enjin.
Given the level of interest in the ERC we're likely to implement it.
Yo I'm working on an implementation here that I may try to get merged into OZ:
https://github.com/gnosis/hg-contracts/pull/21/commits/5623d3e1be5e38ae0b7ccdf5a37c6ef846aae18a
Nice @cag! Is this your original work? I see that the repository is licensed under LGPL. Would you be willing to contribute it under MIT license terms?
Implementation is not really my work; I just did some name changes and comment shuffling to get things more in line with OZ's style. The original is distributed under the Apache 2.0 license.
That said, the (incomplete) test cases are my work, and those I am willing to contribute those under MIT license terms when the time comes. It's still a WIP since the standard is not final yet, and because I am developing alongside our contracts in order to ensure that at least that use case is covered. Since that does not address some potentially common other patterns of use of this standard, it shouldn't be considered complete, but it may be a useful starting point for y'all.
My project involves 100's of ERC20 contracts. My understanding is that this could theoretically replace them all with ONE ERC1155 contract? Plus the benefit of using it for any number of NFTs. If that's the case then yes. I would use this for my project.
My project involves 100's of ERC20 contracts. My understanding is that this could theoretically replace them all with ONE ERC1155 contract? Plus the benefit of using it for any number of NFTs. If that's the case then yes. I would use this for my project.
Yes this is possible, all the functions have an _id var so you can differentiate between different token sets with it.
So erc-20 style balanceOf(address tokenOwner) can instead be called with erc-1155 balanceOf(address _owner, uint256 _id) or balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids).
Erc-20 is a much simpler API design but for implementations that need to mix multiple types like you need it may be a better choice to use erc-1155; This was its reason for being created essentially as modern games need this (which is our use case at enjin).
We have merged ERC1155 from https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1803 into a feature branch: feature-erc1155. If you'd like to help us get this published soon try it out and let us know of any issues you find.
Hello everyone, is there anyway to use ERC1155 using npm? Or only by pulling code from feature-erc1155 branch I can use.
I think the code is not released till yet.
@princesinha19 I believe the only way is downloading the branch for now. I've been experiment with the code and the only way I was able to do it was by checking it out manually.
BTW, I believe the code needs to be refreshed, the other contracts are already using solidity 0.6, but the ERC1155 implementation is still on 0.5, I had to adjust it manually myself.
Not sure if the OZ developers have already done this in their own branches , but if have an updated code in my workspace, I can PR if you want.
@wmitsuda Thanks for the suggestion. I think OZ has already upgraded the contract to solidity version 0.6.
I hope they will release it asap 馃檹
Work for Solidity 0.6 was done in #2130 and merged in the branch already, some more work (like for URI support) is still being reviewed. All in all, #2014 is tracking the work that still needs to be done to land this in master and get it into an actual release.
Pending tasks are now tracked in https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2230
ERC1155 was released in 3.1.
Most helpful comment
Given the level of interest in the ERC we're likely to implement it.