Problem with streams

Currently we have 4 streams listening to 2 contracts - 2 on testnet and 2 on mainnnet

The stream I am contacting about is tokenminted for contract 0x8ff16797d150af1194b2ef8668123aa1397df95c on goerli

when we tried to add the topic for Transfer we suddenly are getting too much data which should not be happening as we listening for when an nft minted by the contract is sold to get info about that tx like who the new owners is etc and we only minted 2 in tonight’s test. We are also storing those logs in cloudbase and very quickly its eating our quota.

That’s the immediate problem but I also have a secondary question - somehow the streams have been working for fee recieved and tokenminted even though a previous dev added the wrong abi info for each one (doesnt match what is in the contract on etherscan) so just wondering how that is even working.

yes, we are trying to get this transfer event thing solved asap we are trying top push to prod for a live nft mint in 48 hours. Appreciate the help.

what is the stream id that doesn’t work as expected, this one?

{
      "id": "c37c5772-5048-4ed4-9b7d-5faef46ae4a2",
      "webhookUrl": "https://....",
      "description": "PROD",
      "tag": "TokenMinted",
      "demo": false,
      "topic0": [
        "TokenMinted(uint256,uint256,address,address)"
      ],
      "allAddresses": false,
      "includeNativeTxs": false,
      "includeContractLogs": true,
      "includeInternalTxs": false,
      "getNativeBalances": [],
      "triggers": [],
      "abi": [
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "internalType": "address",
              "name": "owner",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "approved",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "uint256",
              "name": "tokenId",
              "type": "uint256"
            }
          ],
          "name": "Approval",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "internalType": "address",
              "name": "owner",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "operator",
              "type": "address"
            },
            {
              "indexed": false,
              "internalType": "bool",
              "name": "approved",
              "type": "bool"
            }
          ],
          "name": "ApprovalForAll",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "internalType": "address",
              "name": "previousOwner",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "newOwner",
              "type": "address"
            }
          ],
          "name": "OwnershipTransferred",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "internalType": "uint256",
              "name": "firstId",
              "type": "uint256"
            },
            {
              "indexed": false,
              "internalType": "uint256",
              "name": "mintQty",
              "type": "uint256"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "contractAddress",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "minter",
              "type": "address"
            }
          ],
          "name": "TokenMinted",
          "type": "event"
        },
        {
          "anonymous": false,
          "inputs": [
            {
              "indexed": true,
              "internalType": "address",
              "name": "from",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "address",
              "name": "to",
              "type": "address"
            },
            {
              "indexed": true,
              "internalType": "uint256",
              "name": "tokenId",
              "type": "uint256"
            }
          ],
          "name": "Transfer",
          "type": "event"
        }
      ],
      "advancedOptions": null,
      "chainIds": [
        "0x1"
      ],
      "status": "active",
      "statusMessage": "Stream is active"
    }

probably this stream id it is:

881a78e8-f9d5-4531-856f-881ed9d9d0bb

{
  "totalWebhooksDelivered": 389,
  "totalWebhooksFailed": 20,
  "totalLogsProcessed": 14883,
  "totalTxsProcessed": 0,
  "totalTxsInternalProcessed": 0,
  "createdAt": "2023-02-07T23:22:42.689Z",
  "updatedAt": "2023-02-15T12:18:53.955Z"
}

maybe you enabled listen to all addresses when you tried to add the transfer event?

here it can depend on what is the difference in the abi, different abis can work for the same event, variable names in the abi can be different for example

for now the only thing that makes sense is if you also enabled listen to all addresses while you tried to add the transfer topic and if you did that then you received all the transfers from the blockchain while listen to all addresses was enabled

881a78e8-f9d5-4531-856f-881ed9d9d0bb yes that is the one

yes we had listen to all addresses on because this contract is a factory and we were trying to follow this

Again - to be clear - the main issue at the moment is that we added the transferfrom topic to our tokenminted event for the factory address at 0x8ff16797d150af1194b2ef8668123aa1397df95c we turned on listen to all addresses and its returning what looks like transfer from all nfts from every contract ever deployed! we are just trying to get transfers from nft contracts created by your factory so we can get [from, to, tokenId, address]

that is what listen to all addresses does, it gets results from any address and that is why you got so many logs

you have to know somehow what are the contract that you are interested in, listen to all addresses with transfer topic will get you too many results, will get you all the transfers from any contract

ok so why then does it say to listen to all addresses in the case of a factory contract which this one is

how can we just listen to transfer events from only the contracts that the factory is creating?

If the event is specific only to your contracts then it will work with listen to all addresses. In this case if it is a transfer event then it will not work because too many contracts use that transfer event.

You could process an event specific to when a new contract is created by the factory and automatically add that new created contract address to a stream config.

1 Like