4

I am familiar with ERC20 and ERC721. Now exploring more about ERC1155.

Just like we can send a fraction of ERC20 based token. can we send a fraction of ERC1155 based fungible token?

2 Answers 2

1

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

You can check the ERC1155 API here and the EIP proposal here.

0

There's a related question, with a very clear answer.

In practice, the ability to send fractions of a ERC20 token is an illusion, as within the EVM all our numbers are integers, and only by convention we tell the reader to interpret them as decimals by setting the decimal point at some position.

With any ERC-20 contract, that position is returned by the decimals function. For Ether, that is 18, conventionally.

You could agree with yourself (set your own convention) and say that your fungible token defined in your ERC1155 contract should be seen as decimals, that is, you could define the decimal point position. Either the same value for all your fungible tokens within the contract, or per TokenID.

Transfer a value less that 10^(decimals), that would be less than 1.

While the ERC-20 interface prescribes this decimals() function, ERC-1155 does not. In the EVM float-less environment, it's up to us programmers to define whether and how EVM integers need to be interpreted where we need fractional quantities.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.