hedera-mirror-node
hedera-mirror-node copied to clipboard
Create synthetic events for HAPI transactions doing multi transfers
With https://github.com/hashgraph/hedera-mirror-node/issues/4738 logic was added in the Mirror node which creates synthetic events for some HAPI transactions.
CryptoTransfer
transactions in Hedera can be used to perform "multi" transfers, where the aggregated balance changes for multiple accounts are provided in the transaction body, the ledger checks if all balance changes sum to zero, and updates the corresponding account balances.
It is a challenge to create the synthetic events in this case, because the needed information - a sender
and a receiver
for each transfer - is not present in the transaction body.
Several different approaches are possible to resolve this if we need to:
- Have an algorithm that matches senders to receivers
- Use a different event signature - create a new one or find an existing multi-transfer signature from an industry-standard Ethereum contract
- Have a placeholder address for the “unknown” sender or receiver address
- event Transfer(address indexed from, address indexed [placeholder], uint256 amount);
- event Transfer(address indexed [placeholder], address indexed to, uint256 amount);
To double-check https://github.com/hashgraph/hedera-mirror-node/releases/tag/v0.86.0
This is blocked and probably not possible in the near future.