Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC1155 full support #49

Open
lucasmenendez opened this issue Jun 7, 2023 · 3 comments · May be fixed by #205
Open

ERC1155 full support #49

lucasmenendez opened this issue Jun 7, 2023 · 3 comments · May be fixed by #205
Assignees
Labels
enhancement New feature or request frozen This issue is currently being held up by external motivations and so on.

Comments

@lucasmenendez
Copy link
Collaborator

Review the implementation and accountability of holder balances to fully support ERC1155 standard tokens.

@lucasmenendez lucasmenendez added the enhancement New feature or request label Jun 7, 2023
@lucasmenendez lucasmenendez self-assigned this Jun 7, 2023
@lucasmenendez
Copy link
Collaborator Author

We found two main issues to support this contract standard:

  • This kind of contracts could be act as an ERC20 (common token) or as an ERC721 (NFT), so we need a mechanism to distinguish them.
  • When an ERC1155 acts as ERC20, it supports using the same contract for more than one token at the same time (identified by ID), so we need to take a decision on how to manage this situation (count all tokens as one, store each token's accountability separately, or only listen to a specific token ID from the contract creation).

We need to decide on solution for both issues before implementing them, but we also feel that this feature is not a priority at the moment.

@jpaulet
Copy link
Member

jpaulet commented Jun 14, 2023

100% agree. This issue right now has a low priority and first we should discuss how to manage it. Stopped until further notice.

@lucasmenendez
Copy link
Collaborator Author

Reading the oficial specification of the ERC1155 I found the following:

The following strategies are examples of how you MAY mix fungible and non-fungible tokens together in the same contract. The standard does NOT mandate how an implementation must do this.

Also they propose a possible implementation of how to mix both uses cases:

The top 128 bits of the uint256 _id parameter in any ERC-1155 function MAY represent the base token ID, while the bottom 128 bits MAY represent the index of the non-fungible to make it unique.

This means that there is no standard way of knowing whether a transfer event involves a fungible token or a non-fungible token.

  • To solve this, we can easily support two at least uses cases (where the ERC1155 works as ERC20 and where it works as ERC721), requesting the way to work with the contract during token creation request. The remaining use case (where the ERC1155 works as ERC20 and ERC721 at the same time) seems hard to solve robustly.

Reading also the OpenZeppelin reference I found another important information:

Also note that, unlike ERC20, ERC1155 lacks a decimals field, since each token is distinct and cannot be partitioned.

This means that the ERC1155 does not implement the decimals parameter, this could be included in the metadata information, but this will require checking the metadata URI from an external source.

  • The only solution is to request this information from the user during the token creation request.

@lucasmenendez lucasmenendez added the frozen This issue is currently being held up by external motivations and so on. label Oct 18, 2023
@lucasmenendez lucasmenendez linked a pull request Sep 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frozen This issue is currently being held up by external motivations and so on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants