[SOLVED] Sync event function does not update anymore

Hi Team,
I am encountering an issue that my created event syn does not do its job anymore.
When I create a new transaction and it does not sync.
The detail relative info FYI below:

transaction hash: 0x34b80718e5fb6d5c79ca6687bf228dfc7c3351da20cd093cc0c5e02299b05d96
my server URL: https://li8crrzx4alq.grandmoralis.com:2053/server
The sync topic: ERC20Bought(address,address,address,uint,unit)
table name: SwapHistory
server type: bsctestnet

This sync event was created on 1/6. At that time I tried several transactions and it worked fine.
But Just now, I signed two transactions and it does not work.
When I look into the database, I found that in EvenSync table, it shows yesterday was the last sync_start as below:

Now, no matter how I do transaction and it does not sync.
As you can see the contract event on bscscan: https://testnet.bscscan.com/address/0xf5555a991bce039229f8bbb1779164eb1034355b#events
There are 6 ERC20Bought events history (2 from today, 4 from 7 days ago). But in the SwapHisotry table created by syncevent in moralis server, it only shows 4 which is from 7 days ago.

Let me also share the eventsync setting FYI:

Might I know how can I work it around?
Many thanks

there was a problem yesterday-today, can you try again now or in 4-5 hours?

1 Like

Thanks for the reply. I just realized the missing transactions have been back.

1 Like

I am encountering the same issue again for another syncEvent. Might I know if it is also the issue from server, or my mis-setting?

Detail info below:
my server URL: https://li8crrzx4alq.grandmoralis.com:2053/server
The sync topic: tokenTransferred(address, uint, uint , address, address)
table name: SendBepTx
server type: bsctestnet

The sync setting:

The event on bscscan(testnet):
transaction: https://testnet.bscscan.com/tx/0x29ef74f8b7fd0502a530ec0088e0b9e5b84e897c912cfca75ada22acbf33eabd

The SendTx table (not syncing):

Many thanks!

this is not a valid topic, the topic doesn’t have to use spaces, you can search other posts on forum on how to validate the topic

I appreciate your prompt reply.
After removing the space, it is still not working. please see detail below:

that is not a valid data type, you could use directly the hash of the topic, it may be faster, instead of uint it should be uint256

I tried uint256 like below, but still no luck.

it may also take few minutes after you do it right, you can validate if you have the right topic using

you can validate if you have the right topic with a syntax like this:

web3 = await Moralis.enableWeb3()

and then check the resulting hash to be equal to topic0 of that event, or use directly that topic 0 in the interface for topic

Yes, I did try (Copied the topic from moralis sync setting panel and hash it to compare with bscscan topic0) and found it is exactly the same. please see below. But it is still not syncing

ok, this means that is no longer a problem related to the topic

can you try to restart your server now?

It is correct to restart by the “update and restart” button below:

After doing “Update and Restart” it is still not syncing, you could have a look at the screenshot below:

And I found it very weird is that when I look into the “EventSync” table and I found that it shows the last_synced_block is exactly the block of that transaction.
But In the table of SendBepTx --> it still remain 0 raw.
You can have a look at the screenshot below:

The setting is historical data sync “ON”:

ok, now is the problem with field names that start with _, you have to rename all those field name in the abi to not start with _: https://docs.moralis.io/moralis-server/automatic-transaction-sync/smart-contract-events#name-field-limits

Thanks for your pointing out that, really helpful. The very last question is that does it mean that I will also need to modify the smart contract accordingly since the event arguments of the smart contract are all start with “_”.

you don’t need to modify the smart contract, only the abi that you paste on sync event you have to modify it

1 Like

Thanks so much sir, Let me have a try.

Hello Sir, After trying, it is working now. I appreciate your great support

1 Like