hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
299 stars 137 forks source link

Emit events from HTS precompiled contract functions #4127

Open stoqnkpL opened 1 year ago

stoqnkpL commented 1 year ago

The functions implemented in the HTS precompiled contract as part of HIP-206 and before HIP-218 was proposed and compatibility between HTS tokens and the ERC20/ERC721 industry standards was introduced, do not emit the corresponding events when the following contract functions are called:

Solution: Emit the Transfer(address indexed from, address indexed to, uint256 value) event on each function call.

mshakeg commented 1 year ago

Hi @stoqnkpL would the ERC20/721 events also be emitted on HTS actions initiated from other than the HTS precompiled contract? For example if an SDK TransferTransaction or an IERC20/721(tokenAddress).transfer() from an EOA.

If a subgraph has an ERC20/721 Transfer event handler then it should be indexing all HTS transfers regardless of how that transfer was initiated.

stoqnkpL commented 1 year ago

Hi @mshakeg, yes, exactly, this is the idea. Some work was done on the Mirror Node side already to support creation of synthetic events for HAPI transactions (e.g. an SDK TransferTransaction). This ticket captures the remaining required work.

AlfredoG87 commented 4 months ago

@georgi-l95 would you say that this ticket completed?