Is there any specific way of identifying ERC-721, ERC-777, & ERC-223 contract events under the EVM, specifically under the eth.getTransactionReceipt() function?

I know there's a way for ERC-20 tokens by filtering for the Transfer keccak-256 hash:


A brute-force example I could use for CryptoKitties is also filtering for the 'DepositKittyAndMintToken' hash, yet obviously there are many more ERC-721 token events than just CryptoKitties:


I'm running a program that runs two loops: through each transactionHash under each block, and trying to separate all ERC-20, ERC-721, ERC-777, and ERC-223 token events, yet only have it working for ERC-20's.

Any help would be greatly appreciated, thanks!

  • A similar question here. May 9, 2020 at 14:02
  • Oh wow, this is great, thanks! The only discrepancy is I see ERC-20 events with a receipt.topics.length == 3 not 1, while ERC-721's are receipt.topics.length == 1. I just verified on my Geth archive node for a handful of ERC-20 & CryptoKitties transactions, and this appears to be the case.
    – keennay
    May 9, 2020 at 14:13
  • Then they are not standard ERC20 event by definition. May 9, 2020 at 14:26

2 Answers 2


For ERC-721 and modern contract types that support ERC-165 this can be done using introspection.

The basic way to do it (implementation here shown with Node + Ethers) is:

// Use ERC-165 to check if contract is ERC-721, try/catch in case contract does not support ERC-165
const contract = new ethers.Contract(contractAddress, erc165Abi, provider);
let isErc721 = 0;
try {
    isErc721 = await contract.supportsInterface(erc721Id) ? 1 : 0;
} catch (error) {
    // Contract does not support ERC-165

This is excerpted from a full implementation you can study at https://github.com/fulldecent/contract-scanner/blob/main/index.mjs

Also, I have narrated and explain every line of code here if you want to dig deeper, see https://youtu.be/lukshxTYpUw and I have office course ("Community Service Hour") to answer any questions.


...and just like that, came across this:


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.