Skip to content

Commit

Permalink
GITBOOK-2414: synthetic event logs #470
Browse files Browse the repository at this point in the history
  • Loading branch information
theekrystallee authored and gitbook-bot committed Nov 7, 2023
1 parent 85180aa commit b11c1af
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions core-concepts/mirror-nodes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ Once a record file is closed, the consensus nodes generate a signature file. The

Hedera consensus nodes push new record files and signature files to the cloud storage provider – currently AWS S3 and Google File Storage are supported. Mirror nodes download these files, verify their signatures based on their hashes, and only then make them available to be processed.

### Smart Contract Synthetic Logs

Starting with [v0.79](../../networks/release-notes/mirror-node.md#v0.79) of Hedera Mirror Node release, synthetic event logs for Hedera Token Service (HTS) token transactions have been introduced to mimic the behavior of smart contract tokens. Synthetic events are generated for transactions such as:

* `CryptoTransfer`
* `CryptoApproveAllowance`
* `CryptoDeleteAllowance`
* `TokenMint`
* `TokenWipe`
* `TokenBurn`

This feature enables developers to effectively monitor HTS token activities as if they were smart contract tokens. An example code implementation demonstrating using ethers.js to listen to synthetic events can be found [here](https://github.com/ed-marquez/hedera-example-hts-synthetic-events-sdk-ethers). 

### REST API from Hedera

Hedera provides REST APIs to easily query a mirror node that is hosted by Hedera, removing the complexity of having to run your own. Check out the mirror node REST API docs below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Implementing these interfaces simplifies the process of integrating tokens into

**** [**ERC-721: Non-Fungible Tokens (NFTs)**](erc-721-non-fungible-tokens-nfts.md)

**Token Associations**
## **Token Associations**

Before sending a token to a smart contract, you need to confirm whether you need to associate the token with the smart contract before transferring it. The transfer will fail if you transfer a token to a smart contract that was not associated with it first or does not have an open auto-association slot. 

Expand All @@ -23,6 +23,10 @@ You can associate a smart contract with a token in the following ways:
**Note:** `Token association` is for HTS tokens only.
{% endhint %}

## Synthetic Events

Smart contract tokens like ERC-20 and ERC-721 emit events, creating contract logs that developers can query or subscribe to. Hedera Token Service (HTS) tokens are not inherently equipped with such event logs. As a solution to this limitation, Hedera Mirror Nodes now generates synthetic event logs for HTS tokens. Learn more [here](../../mirror-nodes/#synthetic-smart-contract-contract-logs). 

## FAQs

<details>
Expand Down

0 comments on commit b11c1af

Please sign in to comment.