waves_logo Docs
  • Why Waves
    Why Waves
  • Waves Basics
    Waves Basics
  • Account
    • Creating Account
      Creating Account
    • Address
      Address
    • Account Balance
      Account Balance
    • Account Data Storage
      Account Data Storage
    • Alias
      Alias
    • dApp and Smart Account
      dApp and Smart Account
    Account
  • Token (Asset)
    • Non-Fungible Token
      Non-Fungible Token
    • Smart Asset
      Smart Asset
    • Token ID
      Token ID
    • WAVES
      WAVES
    Token (Asset)
  • Transaction
    • Transaction Fee
      • Sponsored Fee
        Sponsored Fee
      Transaction Fee
    • Signature and Proofs
      Signature and Proofs
    • Transaction Types
      • Burn Transaction
        Burn Transaction
      • Create Alias Transaction
        Create Alias Transaction
      • Data Transaction
        Data Transaction
      • Exchange Transaction
        • Order
          Order
        Exchange Transaction
      • Genesis Transaction
        Genesis Transaction
      • Invoke Script Transaction
        Invoke Script Transaction
      • Issue Transaction
        Issue Transaction
      • Lease Cancel Transaction
        Lease Cancel Transaction
      • Lease Transaction
        Lease Transaction
      • Mass Transfer Transaction
        Mass Transfer Transaction
      • Reissue Transaction
        Reissue Transaction
      • Set Asset Script Transaction
        Set Asset Script Transaction
      • Set Script Transaction
        Set Script Transaction
      • Sponsor Fee Transaction
        Sponsor Fee Transaction
      • Transfer Transaction
        Transfer Transaction
      • Update Asset Info Transaction
        Update Asset Info Transaction
      • Ethereum-like Transaction
        Ethereum-like Transaction
      Transaction Types
    • Transaction Validation
      Transaction Validation
    Transaction
  • Block
    • Transactions Root Hash
      Transactions Root Hash
    • Genesis Block
      Genesis Block
    Block
  • Node
    • Leasing
      Leasing
    • Generator’s Income
      Generator’s Income
    • Monetary Policy
      Monetary Policy
    Node
  • Mainnet, Testnet, Stagenet
    Mainnet, Testnet, Stagenet
  • Unit Zero
    Unit Zero
  • Oracle
    Oracle
  • Protocols & Data formats
    • Cryptographic Practical Details
      Cryptographic Practical Details
    • Leased Proof of Stake
      Leased Proof of Stake
    • Waves-NG Solution
      Waves-NG Solution
    • Waves-NG Protocol
      Waves-NG Protocol
    • Waves 1.5
      Waves 1.5
    • Blockchain Data Types
      Blockchain Data Types
    • Binary Format
      • Address Binary Format
        Address Binary Format
      • Alias Binary Format
        Alias Binary Format
      • Block Binary Format
        Block Binary Format
      • Network Message Binary Format
        • Block Message Binary Format
          Block Message Binary Format
        • Checkpoint Message Binary Format
          Checkpoint Message Binary Format
        • Get Block Message Binary Format
          Get Block Message Binary Format
        • Get Peers Message Binary Format
          Get Peers Message Binary Format
        • Get Signatures Message Binary Format
          Get Signatures Message Binary Format
        • Handshake Message Binary Format
          Handshake Message Binary Format
        • Peers Message Binary Format
          Peers Message Binary Format
        • Score Message Binary Format
          Score Message Binary Format
        • Signatures Message Binary Format
          Signatures Message Binary Format
        • Transaction Message Message Binary Format
          Transaction Message Message Binary Format
        Network Message Binary Format
      • Order Binary Format
        Order Binary Format
      • Transaction Binary Format
        • Burn Transaction Binary Format
          Burn Transaction Binary Format
        • Create Alias Transaction Binary Format
          Create Alias Transaction Binary Format
        • Data Transaction Binary Format
          Data Transaction Binary Format
        • Exchange Transaction Binary Format
          Exchange Transaction Binary Format
        • Genesis Transaction Binary Format
          Genesis Transaction Binary Format
        • Invoke Script Transaction Binary Format
          Invoke Script Transaction Binary Format
        • Issue Transaction Binary Format
          Issue Transaction Binary Format
        • Lease Cancel Transaction Binary Format
          Lease Cancel Transaction Binary Format
        • Lease Transaction Binary Format
          Lease Transaction Binary Format
        • Mass Transfer Transaction Binary Format
          Mass Transfer Transaction Binary Format
        • Reissue Transaction Binary Format
          Reissue Transaction Binary Format
        • Set Asset Script Transaction Binary Format
          Set Asset Script Transaction Binary Format
        • Set Script Transaction Binary Format
          Set Script Transaction Binary Format
        • Sponsor Fee Transaction Binary Format
          Sponsor Fee Transaction Binary Format
        • Transfer Transaction Binary Format
          Transfer Transaction Binary Format
        • Update Asset Info Transaction Binary Format
          Update Asset Info Transaction Binary Format
        • Ethereum-like Transaction Binary Format
          Ethereum-like Transaction Binary Format
        Transaction Binary Format
      • Transaction Proof Binary Format
        Transaction Proof Binary Format
      Binary Format
    • Validation Rules
      Validation Rules
    Protocols & Data formats
  • Glossary
    Glossary
      • English
      • Русский
      On this page
        • Fee
        • Total Complexity
        • Transaction size
        • JSON Representation
        • Binary Format
        • Ride Structure
      waves_logo Docs

          # Invoke Script Transaction

          Invoke Script transaction invokes the callable function of the dApp. Learn more about dApp and script invocation

          In addition to the dApp address, callable function name, and arguments, the Invoke Script transaction can contain payments to dApp. The maximum number of payments is 10. (Before activation of feature #16 “Ride V5, dApp-to-dApp invocations”, the maximum number of payments was 2. Before activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions”, the maximum number of payments was 1.)

          # Fee

          The sender can specify a transaction fee nominated in a sponsored asset instead of WAVES, see the Sponsored Fee article.

          The minimum fee in WAVES for an Invoke Script transaction is calculated as follows:

          Fee = 0.005 + S + 1 × I

          • If the transaction sender is a dApp or smart account, and that the complexity of the account script or dApp script verifier function exceeds the sender complexity threshold, then S = 0.004, otherwise S = 0.
          • I is the number of issued assets that are not NFT.

          Before activation of feature #16 “Ride V5, dApp-to-dApp invocations”
          • The minimum fee was increased by 0.004 WAVES for each execution of asset script in payments and script actions.
          • The extra fee of 0.004 WAVES was required for transactions sent from smart account or dApp regardless of the complexity of the account script or the presence and complexity of the dApp script verifier function.)

          # Total Complexity

          A dApp callable function can invoke a callable function of another dApp, or another callable function of the same dApp, or even itself. All invoked functions are executed within a single Invoke Script transaction. More about dApp-to-dApp invocation

          The maximum total complexity of all callable functions and asset scripts within the transaction depends on the version of Standard library in the first dApp script invoked:

          • If the first dApp script uses version 6, 7, or 8, the total complexity is limited by 52 000.
          • If the first dApp script uses version 5, the total complexity is limited by 26 000. If functions of the script that uses version 6 and above are invoked next, their complexity can exceed 10,000 and is limited only by the total complexity of the transaction.

          The sender's account script complexity is not included in that limit.

          DApp-to-dApp invocation is enabled by feature #16 “Ride V5, dApp-to-dApp invocations”. Before activation of feature #16, the total complexity was not limited.

          # Transaction size

          • For a transaction version 2, the maximum size of InvokeScriptTransactionData (see the Invoke Script Transaction Binary Format article) is 5120 bytes.
          • For a transaction version 1, the maximum transaction size including proofs is 5120 bytes.

          # JSON Representation

          {
            "type": 16,
            "id": "6iYsfcVrty9piDkMtHEJ1CzQdbruGNaXUBSGmSpFuYN7",
            "sender": "3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb",
            "senderPublicKey": "BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E",
            "fee": 500000,
            "feeAssetId": null,
            "timestamp": 1640104777935,
            "proofs": [
              "2kQiPyBGn9uTnD7b4FNvtrNAGTpxPRVDbE4tQrJWuoNjXVs6TenCuYqSyBd4QeBQ7Ng2Fi5G9PdmiNBDXUz3wWqf"
            ],
            "version": 1,
            "dApp": "3N28o4ZDhPK77QFFKoKBnN3uNeoaNSNXzXm",
            "payment": [],
            "call": {
              "function": "foo",
              "args": [
                {
                  "type": "list",
                  "value": [
                    {
                      "type": "string",
                      "value": "theta"
                    },
                    {
                      "type": "string",
                      "value": "iota"
                    },
                    {
                      "type": "string",
                      "value": "kappa"
                    }
                  ]
                }
              ]
            },
            "height": 1844277,
            "applicationStatus": "succeeded",
            "spentComplexity": 57,
            "stateChanges": {
              "data": [
                {
                  "key": "3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb",
                  "type": "string",
                  "value": "thetaiotakappa"
                }
              ],
              "transfers": [],
              "issues": [],
              "reissues": [],
              "burns": [],
              "sponsorFees": [],
              "leases": [],
              "leaseCancels": [],
              "invokes": []
            }
          }
          
          Field Description
          call.function Callable function name. Up to 255 bytes (1 character can take up to 4 bytes)
          call.args.type Argument type:
          - binary
          - boolean
          - integer
          - string
          - list (lists are available after activation of feature #15)
          call.args.value Argument value. Binary value should be base64 encoded
          dApp dApp address base58 encoded or dApp alias with alias:<chain_id>: prefix, for example alias:T:merry (see Chain ID)
          payment.amount Amount of token in payment: an integer value specified in atomic units
          payment.assetId ID of token in payment, base58 encoded. null means that the payment is in WAVES
          spentComplexity Actual complexity of calculations performed by all scripts within the transaction, except the sender's account script
          stateChanges Script actions performed by the callable function and dApp-to-dApp invocation results

          If the call field is not specified, the default function of the dApp is invoked.

          The spentComplexity and stateChanges fields do not need to be filled when sending a transaction, and they are not stored on the blockchain. The node returns these fields when providing transaction data via the REST API.

          The fields that are common to all types of transactions are described in the Transaction article.

          # Binary Format

          See the Invoke Script Transaction Binary Format article.

          # Ride Structure

          The InvokeScriptTransaction structure is used for transaction handling in smart contracts.

          Genesis Transaction
          Issue Transaction
          Genesis Transaction
          Issue Transaction