Error in firebase Streams Webhook

I am having trouble using the firebase extension:

After triggering the first event the follwing error appeared in the webhook:
Error: no matching event (argument=“topichash”, value=“0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d”, code=INVALID_ARGUMENT, version=abi/5.7.0) at Logger.makeError (/workspace/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/workspace/node_modules/@ethersproject/logger/lib/index.js:247:20) at Logger.throwArgumentError (/workspace/node_modules/@ethersproject/logger/lib/index.js:250:21) at Interface.getEvent (/workspace/node_modules/@ethersproject/abi/lib/interface.js:216:20) at LogParser.read (/workspace/node_modules/@moralisweb3/streams/lib/cjs/index.cjs:611:47) at LogsProcessor.process (/workspace/node_modules/@moralisweb3/streams/lib/cjs/index.cjs:645:39) at Object.logs (/workspace/node_modules/@moralisweb3/streams/lib/cjs/index.cjs:799:60) at /workspace/lib/index.js:63:63 at cloudFunction (/workspace/node_modules/firebase-functions/lib/providers/https.js:50:16) at /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/function_wrappers.js:101:17

is that topic hash in your event or in your abi?

That topic hash should not be in our ABI:

[
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "artist",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "artistContract",
          "type": "address"
        }
      ],
      "name": "DeleteArtistContract",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "artist",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "artistContract",
          "type": "address"
        }
      ],
      "name": "NewArtistContract",
      "type": "event"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "name": "allArtists",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function",
      "constant": true
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "name": "artistContracts",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function",
      "constant": true
    },
    {
      "inputs": [
        {
          "internalType": "string",
          "name": "name",
          "type": "string"
        },
        {
          "internalType": "string",
          "name": "profilePicture",
          "type": "string"
        }
      ],
      "name": "createArtistContract",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "deleteArtistContract",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getAllArtists",
      "outputs": [
        {
          "internalType": "address[]",
          "name": "",
          "type": "address[]"
        }
      ],
      "stateMutability": "view",
      "type": "function",
      "constant": true
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "artist",
          "type": "address"
        }
      ],
      "name": "getArtistContract",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function",
      "constant": true
    }
  ]

If paste the ABI above on moralis it will change to only:

[
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "artist",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "artistContract",
        "type": "address"
      }
    ],
    "name": "DeleteArtistContract",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "artist",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "artistContract",
        "type": "address"
      }
    ],
    "name": "NewArtistContract",
    "type": "event"
  }
]

I think the only difference between our dev and production env is that we ticked on the checkbox: All Transaction Logs

you can look in a block explorer to see for what event this topic0 matches

I can find it in our transactions. Howver I can also find it in my dev mumbai env and the webhook is having no trouble processing the desired events and the ABI configuration is the same.

The production transaction: https://polygonscan.com/tx/0x010092f5c79e3fdbcd0b80f9e4a593c6c8bb2d732cfa53177da7a1628e5987c4#eventlog

The dev mumbai transaction:

The moralis config on both streams is 1:1

We have more info.

The hash in question corresponds to

Web3.keccak(text='RoleGranted(bytes32,address,address)')

Our flow is the following:

  1. Factory deploys child contract and emits event NewArtistContract (we want to catch)
  2. during this we call the constructor of the child contract to set up roles in the newly minted contract. Thiemits the event above. However, this event corresponds to the child contract and is hence not in the ABI.

you can add an event to the abi by modifying the abi, or register two stream configs for 2 different events, if that is the issue

The issue is that we don’t wanna capture the event. The event does not correspond the contract we are following and the cloud function webhook keeps crashing because of that event. The event is not in the ABI and should not be there either!

Hi @biddz

Do you have access to any JSON response of the received webhook which you can share?

I don’t believe the webhook logs the initial input and we can not longer replay it :frowning:

Hi @biddz

I have created a stream similar to your stream configuration.
Is it possible to trigger an event from your contract address 0x4de1... now so I can record a webhook response?

If you have the same contract on testnet we can also test it there. Let me know the testnet address so I will update my stream with it.