Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions HIP/hip-1195.md
Original file line number Diff line number Diff line change
Expand Up @@ -1004,23 +1004,24 @@ records for a single transaction,
consensus.handle.maxFollowingRecords=50
```
The `CryptoTransfer` handler will execute hook calls in the following order:
1. All `pre_tx_allowance_hook` calls in the HBAR `TransferList`, in the order they appear in the `CryptoTransferTransactionBody`.
2. All `pre_tx_allowance_hook` calls in the fungible `transfers` of the `tokenTransfers`
list, in the order they appear in the `CryptoTransferTransactionBody`.
3. All `pre_tx_sender_allowance_hook`, `pre_tx_receiver_allowance_hook`, calls in the non-fungible `nftTransfers` of
the `tokenTransfers` list, in the order they appear in the `CryptoTransferTransactionBody`.
(_Note:_ if both sender and receiver hooks are present, then the sender hook is executed first.)
4. All `pre_post_tx_allowance_hook` calls in the HBAR `TransferList`, in the order they appear in the `CryptoTransferTransactionBody`.
5. All `pre_post_tx_allowance_hook` calls in the fungible `transfers` of the `tokenTransfers`
list, in the order they appear in the `CryptoTransferTransactionBody`.
6. All `pre_post_sender_tx_allowance_hook`, `pre_post_tx_receiver_allowance_hook`, calls in the non-fungible `nftTransfers` of
the `tokenTransfers` list, in the order they appear in the `CryptoTransferTransactionBody`.
7. All `pre_post` hooks previously executed in steps (4) to (6), _in the same order they were previously executed_;
1. All `pre_tx_allowance_hook` calls in the HBAR `TransferList`, in the order they appear.
2. For each `TokenTransferList`,
- If for a fungible token, all `pre_tx_allowance_hook` calls in the `transfers` list, in the order they appear.
- If for a non-fungible token, all `pre_tx_sender_allowance_hook` and `pre_tx_receiver_allowance_hook` calls in the
`nftTransfers` list, in the order they appear. (_Note:_ given both sender and receiver hooks in the same
`NftTransfer`, the sender hook executes first.)
3. All `pre_post_tx_allowance_hook` calls in the HBAR `TransferList`, in the order they appear.
4. For each `TokenTransferList`,
- If for a fungible token, all `pre_post_tx_allowance_hook` calls in the `transfers` list, in the order they appear.
- If for a non-fungible token, all `pre_post_sender_tx_allowance_hook` and `pre_post_tx_receiver_allowance_hook` calls
in the `nftTransfers` list, in the order they appear. (_Note:_ given both sender and receiver hooks in the same
`NftTransfer`, the sender hook executes first.)
5. All `pre_post` hooks previously executed in steps (3) and (4), _in the same order they were previously executed_;
while the first call will be to the `allowPre(HookContext, ProposedTransfers)` method signature, the second call will
be to the `allowPost(HookContext, ProposedTransfers)` signature.

A block stream or legacy record stream client can use this well-known ordering to identify which child `ContractCall`
to `0x16d` corresponds to which `HookCall` in a `CryptoTransferTransactionBody`.
A block stream or legacy record stream client can use this ordering to identify which child `ContractCall` to `0x16d`
corresponds to which `HookCall` in a `CryptoTransferTransactionBody`.

### Examples

Expand Down
Loading