Transaction in TON a process that includes:
- Sending The incoming message to activate the smart contract;
- Performing actions inside the contract;
- The Generation I 'm going to get you a message . to the other participants.
Common components of the transaction#
- The account to which the transaction belongs;
- Logical time the transaction;
- 0 or 1 the incoming message;
- N of outgoing messages;
- The initial and final condition of the account (including balance);
- The total amount of validator fees;
- Detailed description (type + intermediate steps).
Logical time
- Accurate sequencing of events in Asynchronous system of smart contracts;
- Each outgoing message gets its own timestamp;
- Strictly Growing for one contract message;
- Validators are used for sorting and processing.
Transaction types#
| The type | Appointment |
|---|---|
| The usual | They process incoming messages, change the state, generate outgoing messages. |
| Storage | Payment collection for keeping the account (no code is called) |
| Tick | At the beginning of each block .Masterchain |
| Tock | At the end of the block .Masterchain |
| Split the data . | The account is split into ξ and ξ' (sharding) |
| Merge | How to combine accounts (optimize) |
Ordinary transaction phases#
- Storage phase collecting fees for storage;
- The phase of lending (credit) the account receives the sum of the incoming message;
- Calculating phase (compute) the contract code is called in TVM, ends with an exit-code + new data + a list of actions;
- The phase of action performing actions from the list;
- Bounce phase if interrupted and set Bounce flag → message is returned to sender.
Features of#
Transactions to store
- Validators insert them when:
- The account hasn 't been used in a while .
- Balance is insufficient to pay for storage;
- If the balance falls below the minimum → The account is being frozen ., the code and data are replaced with a hash.
Tick + Tock
- Reserved for special system smart-contracts;
- Automatically called in every block.
The division
- This is a split-preparation transaction . (as tock) for ξ the last in the shardchain block;
- Set up the partition transaction for ξ' with reference to training.
The Association
- Transaction of preparation of the association for ξ' → conversion of state and balance to message-constructor;
- Transaction to set up the association For ξ, it handles the message.