[SOLVED] Error adding custom events synchronization

Hello,

When I try to add a new custom event sync, I get the error in the image below

Can you help me, please?

you have to give more info, what did you try to add?

This is the information:

[
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "makerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "swapHash",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "canceledTimeSeconds",
          "type": "uint256"
        }
      ],
      "name": "Cancel",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "makerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "epoch",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "canceledTimeSeconds",
          "type": "uint256"
        }
      ],
      "name": "CancelUpEpoch",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "makerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "swapHash",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "filledTimeSeconds",
          "type": "uint256"
        }
      ],
      "name": "Fill",
      "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": false,
          "internalType": "address",
          "name": "account",
          "type": "address"
        }
      ],
      "name": "Paused",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "account",
          "type": "address"
        }
      ],
      "name": "Unpaused",
      "type": "event"
    },
    {
      "inputs": [],
      "name": "activate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "string",
              "name": "version",
              "type": "string"
            },
            {
              "internalType": "address",
              "name": "makerAddress",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "takerAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "expirationTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "createTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "salt",
              "type": "uint256"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "makerTokenData",
              "type": "tuple[]"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "takerTokenData",
              "type": "tuple[]"
            }
          ],
          "internalType": "struct LibSwap.Swap[]",
          "name": "swaps",
          "type": "tuple[]"
        },
        {
          "internalType": "bytes[]",
          "name": "signatures",
          "type": "bytes[]"
        }
      ],
      "name": "batchFillSwap",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "string",
              "name": "version",
              "type": "string"
            },
            {
              "internalType": "address",
              "name": "makerAddress",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "takerAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "expirationTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "createTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "salt",
              "type": "uint256"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "makerTokenData",
              "type": "tuple[]"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "takerTokenData",
              "type": "tuple[]"
            }
          ],
          "internalType": "struct LibSwap.Swap",
          "name": "swap",
          "type": "tuple"
        },
        {
          "internalType": "bytes",
          "name": "signature",
          "type": "bytes"
        }
      ],
      "name": "cancelSwap",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "epoch",
          "type": "uint256"
        }
      ],
      "name": "cancelUpEpoch",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "deactivate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "destroy",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "string",
              "name": "version",
              "type": "string"
            },
            {
              "internalType": "address",
              "name": "makerAddress",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "takerAddress",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "expirationTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "createTimeSeconds",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "salt",
              "type": "uint256"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "makerTokenData",
              "type": "tuple[]"
            },
            {
              "components": [
                {
                  "internalType": "enum LibSwap.TokenType",
                  "name": "tokenType",
                  "type": "uint8"
                },
                {
                  "internalType": "address",
                  "name": "tokenContract",
                  "type": "address"
                },
                {
                  "internalType": "uint256",
                  "name": "amount",
                  "type": "uint256"
                },
                {
                  "internalType": "uint256",
                  "name": "tokenId",
                  "type": "uint256"
                }
              ],
              "internalType": "struct LibSwap.TokenData[]",
              "name": "takerTokenData",
              "type": "tuple[]"
            }
          ],
          "internalType": "struct LibSwap.Swap",
          "name": "swap",
          "type": "tuple"
        },
        {
          "internalType": "bytes",
          "name": "signature",
          "type": "bytes"
        }
      ],
      "name": "fillSwap",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "paused",
      "outputs": [
        {
          "internalType": "bool",
          "name": "",
          "type": "bool"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ]
  • Sync historical: OFF

If you need more information tell me. Thanks!

try to add the event sync only with a simplified abi that contains only the event for that event that you want to sync

I get the same error. This is the ABI with only the event:

{
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "makerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "swapHash",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "filledTimeSeconds",
          "type": "uint256"
        }
      ],
      "name": "Fill",
      "type": "event"
    }

ok, try to also add [ ] part for the abi with this only event

I tested now with this ABI and it looks like it worked without issues

Do you want to say something like this?

[{
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "makerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "takerAddress",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "swapHash",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "filledTimeSeconds",
          "type": "uint256"
        }
      ],
      "name": "Fill",
      "type": "event"
    }]

I tried but still the same error

yes, like that, the abi is not the issue now

if you look in network tab do you see any specific error?

can you try to logout and login again?

And tried that and it doesn’t work. I have checked the logs, and I see the following error:

2022-08-30T15:02:44.494Z - Error: [object Object]
    at Object.resolveError (/moralis-server/lib/triggers.js:632:17)
    at error (/moralis-server/lib/Routers/FunctionsRouter.js:184:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-08-30T15:02:44.487Z - Failed running cloud function coreservices_addEventSync for user undefined with:
  Input: {"address":"0xF55D1BDE3F4c8e30FF5219383A30449Aabb993bb","abi":{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"makerAddress","type":"address"},{"indexed":true,"internalType":"address","name":"takerAddress","type":"address"},{"indexed":true,"internalType":"bytes32","name":"swapHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"filledTimeSeconds","type":"uint256"}],"name":"Fill","type":"event"},"tableName":"PolygonEventFill","sync_historical":false,"chainId":"0x89","limit":500,"topic":"Fill(address,address,bytes32,uint256)","description":"Sync Fill events"}
  Error: {"message":{"status":502,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"24","etag":"W/\"18-py7kky+nYw+KpM//zLTacYk1OLw\"","x-response-time":"22.855ms","date":"Tue, 30 Aug 2022 15:02:44 GMT","connection":"close"},"buffer":{"type":"Buffer","data":[123,34,101,114,114,111,114,34,58,116,114,117,101,44,34,100,97,116,97,34,58,123,125,125]},"text":"{\"error\":true,\"data\":{}}","data":{"error":true,"data":{}}},"code":141}

The strange thing is that the logs abi do not include the [], but I have included them when creating the synchronization

what is the server url?

https://b1m32vfrz5ke.usemoralis.com:2053/server

this is the error:

Error: No provider found for chain 0x89

try to add again that chain on your server

1 Like

Maybe the problem is this. It is a server that I have created new and these are the metrics

those metrics are not the issue

I have disabled and enabled the network, and it has worked. Thank you very much

1 Like