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
      • Continuation Transaction
        Continuation Transaction
      • Create Alias Transaction
        Create Alias Transaction
      • Data Transaction
        Data Transaction
      • Exchange Transaction
        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
      Transaction Types
    • Transaction Validation
      Transaction Validation
    Transaction
  • Mainnet, Testnet, Stagenet
    Mainnet, Testnet, Stagenet
  • Node
    • Generating Node
      Generating Node
    • Validating Node
      Validating Node
    • Generator’s Income
      Generator’s Income
    • Block Reward
      Block Reward
    • Leased Proof of Stake
      Leased Proof of Stake
    Node
  • Block
    • Block Generation
      • Base Target
        Base Target
      • Generation Signature
        Generation Signature
      Block Generation
    • Block Height
      Block Height
    • Block Signature
      Block Signature
    • Block Timestamp
      Block Timestamp
    • Transactions Root Hash
      Transactions Root Hash
    • Genesis Block
      Genesis Block
    Block
  • Oracle
    Oracle
  • Order
    Order
  • Protocols & Data formats
    • Cryptographic Practical Details
      Cryptographic Practical Details
    • Waves-NG Solution
      Waves-NG Solution
    • Waves-NG Protocol
      Waves-NG Protocol
    • Fair Proof of Stake
      Fair Proof of Stake
    • 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
        • Continuation Transaction Binary Format
          Continuation 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
        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
        • 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 up to two payments to dApp (one payment before activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions”).

          # Fee

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

          # Versions 2 and 1

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

          Fee = 0.005 + S + 0.004 × P + 0.004 × A + 1 × I

          • If the transaction sender is a dApp or smart account, then S = 0.004, otherwise S = 0.
          • The Invoke Script transaction can contain payments. P is the number of payments in smart assets.
          • The Invoke Script transaction can result in the token transfer, reissue or burning. A is the number of smart assets among these actions.
          • The Invoke Script transaction can result in the token issue. I is the number of issued assets that are not NFT.

          See also the example in the Transaction Fee article.

          # Version 3

          Version 3 of the Invoke Script transaction is added in node version 1.3.0 and enabled with feature #16 “Ride V5, dApp-to-dApp invocations, Continuations”. Versions 1.3.x are now available for Stagenet only.

          Fee = (0.005 + E) × ⌈С / 4000⌉ × + S + 0.004 × P + 0.004 × A + 1 × I + 0,004 × N,

          where:

          E is the extra fee specified in the extraFeePerStep field,

          С is the complexity of the callable function. С/4000 rounded up to the nearest integer is the number of stages in the computation sequence. For details see the Continued Computations article.

          N is the total number of nested invocations via Invoke function. For details see the dApp-to-dApp Invocation article.

          Continued computations and dApp-to-dApp invocation are mutually exclusive, that is, they cannot be initiated by the same transaction.

          # JSON Representation

          {
            "type": 16,
            "id": "DN9Ny8mph4tLjn58e9CqhckPymH9zwPqBSZtcv2bBi3u",
            "sender": "3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb",
            "senderPublicKey": "BvJEWY79uQEFetuyiZAF5U4yjPioMj9J6ZrF9uTNfe3E",
            "fee": 500000,
            "feeAssetId": null,
            "timestamp": 1601652119485,
            "proofs": [
              "2536V2349X3cuVEK1rSxQf3HneJwLimjCmCfoG1QyMLLq1CNp6dpPKUG3Lb4pu76XqLe3nWyo3HAEwGoALgBhxkF"
            ],
            "version": 2,
            "chainId": 84,
            "dApp": "3N28o4ZDhPK77QFFKoKBnN3uNeoaNSNXzXm",
            "payment": [],
            "call": {
              "function": "foo",
              "args": [
                {
                  "type": "list",
                  "value": [
                    {
                      "type": "string",
                      "value": "alpha"
                    },
                    {
                      "type": "string",
                      "value": "beta"
                    },
                    {
                      "type": "string",
                      "value": "gamma"
                    }
                  ]
                }
              ]
            },
            "height": 1203100,
            "applicationStatus": "succeeded",
            "stateChanges": {
              "data": [
                {
                  "key": "3Mw48B85LvkBUhhDDmUvLhF9koAzfsPekDb",
                  "type": "string",
                  "value": "alphabetagamma"
                }
              ],
              "transfers": [],
              "issues": [],
              "reissues": [],
              "burns": [],
              "sponsorFees": []
            }
          }
          
          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.
          - integer: from -9,223,372,036,854,775,808 to 9,223,372,036,854,755,807 inclusive.
          - string or binary: up to 32,767 bytes. Binary value should be base64 encoded.
          - list: up to 1000 elements
          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
          stateChanges Script actions performed by the callable function. In transaction version 3 the structure can also include dApp-to-dApp invocation result
          extraFeePerStep Extra fee for each stage of computations, see the Continued Computations article. The extra fee is specified in the same token as the transaction fee, in atomic units. A value other than null or 0 is only valid when the version 5 dApp script is invoked. The field is added in transaction version 3
          сontinuationTransactionIds List of the Continuation transactions in the computation sequence. The field is added in transaction version 3

          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