Transactions
There are various types of transactions that can be made on the SWT platform.
When a transaction is made, a fee is charged. This fee is based on the "max fee" the user is willing to pay for the transaction, the "counted fee" for the transaction type and other special conditions, and the "execute fee" if the transaction involves a smart contract.
The types of transactions include:
Transaction Type
Description
Transfer
This includes the simple transfer of the SWT native currency between two accounts
Smart Contract
Includes the transaction types of Deploy, Execute, Payable, New State, and Emitted, as listed below
Deploy
Deploys a smart contract
Execute
Executes a smart contract
Payable
Transfers funds to a smart contract
New State
Sets a new state for a smart contract
Emitted
This type of transaction occurs when one smart contract generates another smart contract.
Transfer
As the name implies, a transaction of this type simply transfers native SWT currency from one wallet address to another.
Deploy
The following steps outline this type of transaction:
Funds are reserved (reserved funds) and charged, based on the the "max fee" from the user’s account
Then, a smart contract is compiled and a "new state" transaction is generated
If the “new state" transaction is null or "max fee" is exceeded, then;
"Reserved funds" of the "max fee" are returned
The "counted fee" is deducted for a "deploy" transaction
The "execute fee" is deducted
The minimum"counted fee" is deducted for a "new state" transaction
If the "new state" transaction is successful:
"Reserved funds" of the "max fee" are returned
The "counted fee" is deducted for a "deploy" transaction
The "execute fee" is deducted
The "counted fee" is deducted for a "new state" transaction
Execute
The following steps outline this type of transaction:
Funds are reserved (reserved funds) and charged, based on the the "max fee" from the user’s account
Then, a smart contract is compiled and a "new state_"_ transaction is generated
If the “new state" transaction returns an empty state or "max fee" is exceeded, then;
"Reserved funds" of the "max fee" are returned
The "counted fee" is deducted for an "execute" transaction
The "execute fee" is deducted
The minimum"counted fee" is deducted for a "new state" transaction
If the execution was successful:
"Reserved funds" of the "max fee" are returned
The "counted fee" is deducted for an "execute" transaction
The "execute fee" is deducted
The "counted fee" is deducted for a "new state" transaction
Payable
The following steps outline this type of transaction:
Funds are reserved (reserved funds) and charged, based on the the "max fee" from the user’s account
Then, a smart contract is compiled and a "new state" transaction is generated
If the “new state" transaction returns an empty state or "max fee" is exceeded, then;
"Reserved funds" of the "max fee" are returned
The "counted fee" is deducted for a "payable" transaction
The "execute fee" is deducted
The minimum"counted fee" is deducted for a "new state" transaction
If the execution was successful:
"Reserved funds" of the "max fee" are returned
The amount is transferred to a smart contract account
The "counted fee" is deducted for a "payable" transaction
The "execute fee" is deducted
The "counted fee" is deducted for a "new state" transaction
Emitted
An "emitted" transaction performs additional actions in the system to provide a higher level of automation. The fee is calculated based on the above mentioned rules.
This type of transaction is represented by any one of the following transactions in the system:
Transaction
Transaction
"Execute" transaction
"Payable" transaction
Last updated