Help understanding the raw Event data

Hi Community,

I’m currently looking at the raw Event data of the differerent Tornado Cash contracts and there is something I don’t understand:
Let’s take the 0.1 ETH contract as an example for the following…

I expected that every deposit must be attached with 0.1 ETH which is not the case. For example transactions like this one trigger various Deposit Events without having ETH attached to them.
How is this possible, or in other words, how does a deposit works from the contract’s perspective?

I have not yet digged deeper into the fallback function or functions like “migrateState” and would be happy if someone already knows TornadoCash by heart and could explain this to me!

What would be important for me to know is:
Is it legitimate to assume that every Deposit Event truely indicates a deposit into the contract, even though it is triggered together with hundreds of other Deposit Events within the same transaction and even though no value is transferred in the respective transaction?
The same for withdrawals: Can it be assumed that every time a Withdrawal Event is triggerd, 0.1 ETH left the contract?

I’m working on a Tornado Cash dashboard but this logic-barriers make it difficult for me.

Best Greets!


Short answer is no. There are different types of events than deposits.

In the tx you linked to, scroll down and select:

Click to see More

And look at the input data:

Function: migrateState(bytes32[] _commitments, bytes32[] _nullifierHashes)

If it was depositing ETH to be mixed, you would see:

Function: deposit(bytes32 _commitment)

Like in this example tx

Hope that helps! Excited to see the dashboard soon!

1 Like

Thanks for the reply!

I did see that the tx I referred to was not directly calling the deposit function, but the migrateState function instead, however, it led to a number of Deposit events being fired.

I have spent quite some time on that and I think it’s legitimate to assume that every Deposit event indicates that the contract’s predefined allowed-deposit-amount was truely deposited and on the other hand, with every Withdrawal events, the same amount of Funds were actually withdrawn.

I will no longer look into the transaction which triggered the events as not every transaction that triggers Deposit events needs to have ether in it. This means, there are zero-value tx that trigger successful deposits - which was my main learning.