0

Some addresses on Etherscan like this one show both type of transactions (ERC20 and ERC721) on Etherscan. So, does that mean that both standards can be implemented at the same time for a token?

  • Can you provide an example of "ERC-20 transaction" for this contract? The contract you mentioned only implements ERC-721, not ERC-20. – Morten Jul 28 at 9:33
  • Check this it has a separate erc 20 txns tab etherscan.io/address/… – mahamzaidi Jul 28 at 9:34
  • These transactions are ERC-20 tokens sent to the contract, not from the contract. You can send tokens to any address, including contracts. – Morten Jul 28 at 11:07
1

That looks like the contract is the recipient of both types of tokens. The contract might have functionality to also transfer the tokens out of it but it might not. If it doesn't have such functionality the tokens simply stay there and can never be transferred out of it.

You can't implement both of the standards in one contract as they have overlapping function names - the function signatures are somewhat similar (maybe even the same, didn't compare too closely) but the actual implementation can only be for one token type.

| improve this answer | |
1

Regarding token recipients

Any address can be the beneficiary, receiving ERC-20 and ERC-721 tokens (and also ERC-1155, ERC-777, and any other tokens).

Regarding token contracts (the thing that emits the events)

However, no, it is not possible for a token contract to both be an ERC-721 and an ERC-20 contract at the same time because those two specifications have overlapping and incompatible requirements.*

Caveats

*I'm putting an asterisk here because ERC-20 is not well-specified. If you have a dog, then that dog is a compliant ERC-20 token. That is because ERC-20 does not say anything about what is required, and therefore your dog is meeting the (nonexistent) requirements. Most "ERC-20" contracts do not actually follow ERC-20.

*Also, if you were to imagine that ERC-20 was written in prescriptive language and it was actually a specification (i.e. hand-waving over my existentialism note above) then there is a single situation where an ERC-20 could could also be an ERC-721 contract. This is a degenerate case. Like in geometry class where your teacher that a point is actually a special kind of a circle. And that is if the ERC-20 and ERC-721 contracts both only have one token and its ID is 1.

| improve this answer | |
0

Standard can be "retro compatible". However, I do not think it is the case for ERC-20 and ERC-721.

Indeed, they are related to different types of token, fongible and non fongible. So you cannot manage both at once in this case as function names are the same, but behavior is different.

However, if you are interested in both fongible and non fongible tokens managed in a single contract or by a single standard, I believe ERC-1155 may be what you are looking for (but not yet validated looks like).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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