Developers
  • SWT PROTOCOL
    • Introduction
    • Accounts
    • Transactions
    • Fees
    • Smart Contracts
  • GETTING STARTED
    • Network Node
      • Introduction
      • STEP 1:RENTING A LINUX VPS
      • STEP 2:INSTALLATION OF PUTTY
      • STEP 3:INSTALLATION OF FILEZILLA
      • STEP 4:VPS CONNECTION AND LINUX CONFIGURATION WITH PUTTY (SSH)
      • STEP 5:HOW TO SECURE YOUR VPS
      • STEP 6:USING TMUX THROUGH PUTTY
      • STEP 7:UPLOAD OF THE SWT SOFTWARE WITH FILEZILLA
      • STEP 8:EXTRACT THE SWT SOFTWARE FOLDER
      • STEP 9:RUNNING THE SWT NODE THROUGH TMUX
      • STEP 10:RUNNING THE MONITORING TOOLS
  • API REFERENCE
    • Apache Thrift API
      • Transactions
      • Blocks
      • Smart contract
      • Tokens
      • Wallets
      • Sync info
      • Data structures
    • REST API
      • GetBlocks()
      • GetNodeInfo()
      • GetBalance()
      • GetWalletInfo()
      • GetTokenBalance()
      • GetTransactionsByWallet()
      • GetTransactionInfo()
      • GetEstimatedFee()
      • GetContractByAddress()
      • GetContractFromTransaction()
      • GetContractMethods()
      • ContractValidation()
      • ContractCall()
      • TransactionPack()
      • TransactionExec()
  • SMART CONTRACTS
    • Creating "Hello-world" Smart Contract
    • Smart Contract Methods
    • Smart Contract Standarts
      • Token Smart Contract
      • Escrow Smart Contract
      • Stable coin Token
  • HOW TO REST API
    • Introduction
    • Retrieve a balance from the blockchain
    • Request a specific transaction from the blockchain
    • Sending Transactions to the SWT Blockchain
    • Validating and deploying a Smart Contract with REST API
Powered by GitBook
On this page
  • Transfer
  • Deploy
  • Execute
  • Payable
  • Emitted
  1. SWT PROTOCOL

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

PreviousAccountsNextFees

Last updated 1 year ago