Confirmed transactions come with a receipt under the result field when fetching the transaction in JSON format.
The following are the fields a receipt may have. These fields generally apply to both payment and contract transactions.
|cumulative_gas||string||The total gas consumed in this transaction|
|epoch_num||string||The epoch number in which this transaction was confirmed|
|success||boolean||The result of this transaction (|
For smart contract transactions, additional information relating to smart contract execution is contained in additional fields under the "receipt".
If a transaction is successful (i.e., the success field is
true), these fields will be present:
|accepted||boolean||Indicates whether the last transition in this transaction incurred a balance transfer|
|event_logs||json-array||A list of event logs emitted by the contract during processing. Each log contains:|
|transitions||json-array||A list of internal transitions invoked during the processing of the transaction by the Scilla interpreter. Each transition contains:|
If a transaction is unsuccessful (i.e., the success field is
false), no balance transfer will be executed. Additionally, these fields will be present:
|errors||json-object||An object containing a key-value field. The key [string] indicates the depth at which the error occurred. The value part is a JSON array that lists the error codes [int] reported. The list of possible error codes can be found here.|
|exceptions||json-array||A list of exceptions returned by the Scilla interpreter. Each exception contains:|
Recommended Steps for Exchanges Polling for Incoming $ZIL Deposit from Smart Contract Transactions
- Confirm that the success field is set to
- Traverse the transitions JSON array. For each transition, for a successful deposit of
$ZILvia the smart contract, the following must be fulfilled:
- _recipient corresponds to a known deposit address controlled by the exchange.
- _tag is either
_tagcan be found under
msgfield. If either
msgis not present, there is no incoming deposit from this particular transition.
- _amount is non-zero.
- Check the _recipient and _amount to complete the information on the balance transfer. In such a case, you can confirm that there is a deposit
to address _recipient with value _amount (in
- Continue traversing the remaining transitions and checking for more deposits.