Why can't Moralis sync Seaport events?

I’m trying to sync events from the official Seaport contract on Ethereum. It can be found here.

I copied and pasted the address and the abi directly from Etherscan. I found it easier than copying and pasting only the parts that I need. I set MaxHistoricalRecords to 50 and selected an event called OrderFulfilled. I left the filter empty.

OrderFulfilled gets emitted inside an internal function that is called every time the fulfillBasicOrder function is called. Judging from the transactions on Etherscan, this function is called very frequently. However, Moralis doesn’t seem to sync any events. My OrderFulfilled collection is empty.

Since I copied and pasted everything from Etherscan, and the contract is fully functional, I’m not sure why the sync isn’t working. There aren’t any historical events either.

Any ideas why the event isn’t syncing?

EDIT: I checked the logs and I found an error Failed running cloud function coreservices_addEventSync for user undefined with:...Error: {"message":"getaddrinfo EAI_AGAIN coreservices","code":141}. Not sure what it means. I tried syncing again and syncing using only the event object instead of the abi, but my tables are still empty.

try it few times, for big contracts you may get errors sometimes

I tried 5-6 times, no success so far. I have one more server left on a paid plan on another account, is there a better chance of it working there?

there is better chance to work there

Tried there too, selected only 5 historical events. Still no luck. These are the error logs:

2022-09-01T20:00:45.925Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T15:00:39.230Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T13:00:23.972Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T10:00:31.606Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T07:01:18.708Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T07:01:16.981Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T03:01:18.780Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-09-01T02:00:25.085Z - Error: Invalid function: "pluginsReady"
    at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:201:13)
    at /moralis-server/lib/PromiseRouter.js:85:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

there types of errors will show when the server restarts usually

Hmm I guess isn’t possible to do something like this on Moralis, the database is still empty.

What is the data that you used for that event sync?
Abi, topic, address, chain

I wanted to paste the entire abi but it exceeds the character limit. I tried syncing using only the event object as well so I’ll paste only that here. So:

Abi:
{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"orderHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"offerer","type":"address"},{"indexed":true,"internalType":"address","name":"zone","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct SpentItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"recipient","type":"address"}],"indexed":false,"internalType":"struct ReceivedItem[]","name":"consideration","type":"tuple[]"}],"name":"OrderFulfilled","type":"event"}

Topic:
OrderFulfilled(bytes32,address,address,address,(uint8, address, uint256, uint256),(uint8, address, uint256, uint256, address))

Address:
0x00000000006c3852cbEf3e08E8dF289169EdE581

Chain: Ethereum and Mumbai (on Mumbai there aren’t many transactions I need, I was focusing mainly on Ethereum where OrderFulfilled is emitted often).

what is the server url where you tried to sync this event?

For Ethereum I tried here:
https://yarz116yxk6v.usemoralis.com:2053/server

I deleted some syncs I had before, 4 of them should still be active.

one issue could be the topic (based on the fact that it looks like no historical results were found), do you know how to validate that topic?
you could also try to use the hash form of the topic that you will find in an event in etherscan (that could also be used to validate current topic)

No, I’m not sure what validating the topic means.

So I just realized that Moralis put spaces inside the topic. The spaces shouldn’t be there. Can I somehow manually enter the topic?

You can manually add an event sync too, but you will have to add the event sync from code
Those spaces from topic will be replaced later, they are not the issue now

I tried searching by hash and indeed I can’t find anything on Etherscan. I do see the event on Etherscan and oddly enough it is not readable despite the contract being verified.

Looks like reading Seaport events is problematic: https://github.com/ProjectOpenSea/seaport/discussions/546

If someone succeeds in syncing this event, I’d appreciate any pointers.

how did you search by hash?

I searched inside the transaction where fulfillBasicOrder was called. Like this one:

https://etherscan.io/tx/0x72111c35c11d04a8313910d44c7dc9de622985c850a1df1e2d0badf7620c5410#eventlog

I tried calculating the hash of the topic and see if it matches anything shown in the link above. I assumed that it should match this hash:

0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31

since that hash is the first element inside the topics array. Sadly it does not match, I tried it with minor modifications also. It can’t be any other event since fulfillBasicOrder emits only one and it is OrderFulfilled.

The OrderFulfilled event is emitted using assembly. I don’t know if that changes anything. But it looks like people have trouble reading it.

yes, that looks ok, you can use directly that

0x9d9af8e38d66c62e2c12f0225249fd9d721c54b83f48d9352c97c6cacdcb6f31

as topic when you register an event sync, you can do that from code